【问题标题】:Paypal: Button code is passing all variables but paypal is rejecting them贝宝:按钮代码正在传递所有变量,但贝宝拒绝它们
【发布时间】:2013-10-20 02:14:25
【问题描述】:

Paypal 未显示:

  • 总金额
  • 项目编号
  • 税额
  • INVOICEnumber

Paypal IS 在以下代码中仅显示 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>

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

那里可能有什么问题 (link to code)?

【问题讨论】:

  • 您检查过生成的表单 HTML 吗?这比 PHP 代码更重要。

标签: php html paypal e-commerce payment


【解决方案1】:

我认为这不是 HTML 或 PHP 问题,而是 Paypal 问题。

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

如果您使用的是在 Paypal 中创建的“已保存按钮”,则无法传入其中大部分变量,因为 Paypal 会根据“已保存按钮”信息设置这些变量。您可以包含将预先填充购买者信息的变量,例如他们的姓名和地址。但是,商品编号、税率等都是通过 Paypal 网站在 Saved Button 的详细信息中设置的。

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

这里有更多内容:

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

【讨论】:

  • 细节:每件商品都有自己的:EAN 条形码、名称、价格、数量、增值税金额 (GBP)。根据上述,我需要所有变量,或者我可以在一个“INVOICE FEE”变量中收集所有详细信息,其中我需要变量,例如:发票 ID、发票编号、订单日期。客户必须离开:他们的地址(姓名+姓氏或只是企业名称)、送货地址(姓名+姓氏或企业名称)、企业增值税号。问题:我应该使用什么样的按钮(或如何修复我的代码)?我是否必须使用 SSL 发送所有必需的详细信息(或者只需重定向到 paypal 的按钮就足够了)?
  • 按原样尝试,不输入hosted_button_id
  • [已解决] 感谢您的帮助。不幸的是,我不知道如何评价你的答案,因为我的问题完全出现在其他地方,我自己解决了:)
  • @dryhay 万岁!那是什么?
猜你喜欢
  • 1970-01-01
  • 2014-08-31
  • 2013-08-02
  • 1970-01-01
  • 2020-03-17
  • 1970-01-01
  • 2014-04-06
  • 2014-08-27
  • 2014-08-30
相关资源
最近更新 更多