【问题标题】:PayPal simple upload cart using one button - why is shopping cart empty?PayPal 使用一键简单上传购物车 - 为什么购物车是空的?
【发布时间】:2013-03-07 16:29:19
【问题描述】:

我正在尝试使用以下代码上传购物车,但是当用户点击“立即购买”按钮时,我没有显示用户可以登录付款的 PayPal 订单摘要页面,而是收到一个错误消息说Your shopping cart is empty.

这是我的代码,有什么问题?

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<a href='cart.php?type=current' class='buttonlink previous'>Edit Order</a>&nbsp;&nbsp;<a href='checkout4_confirm.php' class='buttonlink next'>Submit Order</a>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="hosted_button_id" value="JRECLRTYAJDKY">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="XXX@XXX.XXX">
<input type="hidden" name="item_name_1" value="<?php echo $order_number; ?>"> 
<input type="hidden" name="item_number_1" value="1"> 
<input type="hidden" name="quantity_1" value="1"> 
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

【问题讨论】:

    标签: php upload paypal shopping-cart


    【解决方案1】:

    这很可能是由于您正在从您的帐户创建一个托管按钮,但随后您正在修改代码。如果您打算这样做,您需要创建一个明文、非托管按钮。

    在您的帐户中创建按钮时,取消选中第 2 步中的选项以在 PayPal 中保存按钮。然后在生成代码后,单击链接以删除代码保护。这将创建一个明文非托管按钮。然后你应该可以修改按钮了。

    【讨论】:

    • 但是这样就不安全了,对吧?
    • 这取决于您对安全的描述。对于客户的信用卡信息,它仍然是安全的。有人可以右键单击页面并查看源代码是不安全的。保存它,然后修改金额,并处理较少金额的付款。使用非托管按钮的商家只需让他们的系统使用 IPN 进行检查并退还未全额支付的交易。您还可以即时创建托管按钮,然后传递您的信息,而不是事后修改。
    猜你喜欢
    • 1970-01-01
    • 2011-08-31
    • 1970-01-01
    • 2011-04-09
    • 1970-01-01
    • 2015-08-29
    • 2015-10-24
    • 2012-03-11
    相关资源
    最近更新 更多