<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YYHZM9FTBZQGW">
<input type="hidden" name="amount" value="20.00">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>这是一个paypal沙盒按钮。我想做的所有事情就是在我的网站上发布用户购买的所有产品的总价。
我创建了一个没有任何东西可以发布的按钮,因为基本上我想使用一个php变量在未来动态发布,所以我认为我不需要在沙箱创建按钮功能中设置商品价格,名称,数量。我该怎么做呢。

这是输出。我希望项目的价格是不可编辑的描述和数量一样
发布于 2012-02-26 07:02:18
你不能动态覆盖数量的原因是因为你有一个所谓的“PayPal托管按钮”。
通过托管按钮,金额存储在PayPal的一侧,不能被“amount”变量覆盖。您可以使用非托管按钮,也可以使用BMUpdateButton调用动态更新按钮的金额。
请求BMUpdateButton的示例如下所示:
USER=Your API username
PWD=Your API password
SIGNATURE=Your API signature
VERSION=82.0
HOSTEDUBTTONID=The value of <input type="hidden" name="hosted_button_id" value="">
BUTTONTYPE=The type of button. E.g. BUYNOW
BUTTONCODE=The type of code you want to get back. E.g. HOSTED
L_BUTTONVAR0=amount=The new amount with a period as separator
L_BUTTONVAR1=item_name=Optional: a new item name if you wish类似地,您还可以使用BMCreateButton API创建一个新按钮,或者使用BMButtonSearch API搜索所有已存储的托管按钮的列表(例如,自动查找按钮的hosted_button_id )
使用托管按钮的原因是因为它更安全。非托管的、未加密的按钮基本上会使金额处于可操纵状态。欺诈性交易等待发生。
https://stackoverflow.com/questions/9438868
复制相似问题