【发布时间】:2012-06-29 18:37:38
【问题描述】:
这是为我的沙盒“立即购买”按钮生成的代码。我添加了另一个隐藏输入 amount,它将包含一个变量,其中包含要发送到贝宝的总金额(我的网站上没有设定价格)。
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" id="paypal-container-2" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="EJWG97W7YUN4G">
<input type="hidden" name="amount" value="<?php echo $total; ?>" />
<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>
通过阅读类似的问题 can't POST item price in paypal sandbox ,这种方式使隐藏的输入 amount 对用户开放?答案是使用 BMUpdateButton API 来更新按钮数量。我不知道如何在 PHP 中实现 BMUpdateButton API。我如何用 PHP 完成这个?有教程吗?非常感谢任何帮助。
【问题讨论】: