PayPal:按钮代码传递所有变量,但PayPal拒绝它们


Paypal: Button code is passing all variables but paypal is rejecting them

PayPal 没有显示:

  • 总金额
  • 项目编号
  • 塔克斯金额
  • 发票编号

PayPal在下面的代码中仅显示 itemNAME 变量:

<FORM action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="whatever@whatever.what">
<input type="hidden" name="hosted_button_id" value="XXXIDXXX">
<input type="hidden" name="item_name" value="<?php echo$itemNAME;?>"><!--127 chars-->
<input type="hidden" name="item_number" value="<?php echo$itemNUMBER;?>"><!--127 chars-->
<input type="hidden" name="tax" value="<?php echo$TAXamount;?>">
<input type="hidden" name="taxrate" value="20">
<input type="hidden" name="amount" value="<?php echo$TOTALamount;?>"><!-- 127 chars-->
<input type="hidden" name="invoice" value="<?php echo$INVOICEnumber;?>">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="notify_url" value="http://www.whatever.what/notify">
<input type="hidden" name="return" value="http://www.whatever.what/return">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cbt" value="Return to the store.">
<input type="hidden" name="cancel_return" value="http://www.whatever.what/cancel_return">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="image_url" value="http://www.whatever.what/logo.png">
<input type="hidden" name="cpp_logo_image" value="http://www.whatever.what/logo150x50.png">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add instructions here:">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/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.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

我有自己单独的测试文件,单击立即购买按钮后所有变量都可见.
我已经检查了不同的值,但它们在PayPal上不可见(itemNAME 变量除外).

那里可能有什么问题(链接到代码)?

我认为这不是HTML或PHP问题,而是一个PayPal问题。

您的表单正在使用具有特定已保存按钮 ID 的输入hosted_button_id

如果您使用的是在 PayPal 中创建的已保存按钮,则无法传入其中大多数变量,因为PayPal根据已保存按钮信息设置这些变量。您可以包含将预先填充购买者信息的变量,例如他们的姓名和地址。但是,项目编号、税率等都通过PayPal站点在该保存按钮的详细信息中设置。

如果要通过表单传递所有这些变量,则必须放弃hosted_button_id输入。

这里有更多关于它的信息:

https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_formbasics#id08A6F0S0URO