在从PayPal的IPN购物车结帐消息传递的所有变量中,为什么每个商品都没有数量?我目前只有变量 num_cart_items ,这有助于表明他们检出了多少项,但每个项目都没有变量来描述每个购买的数量。
非常感谢任何帮助!
谢谢:)
答案 0 :(得分:0)
我测试了您的代码并稍作调整以添加其他项目。我也在沙箱而不是实时服务器。
下面的代码对我来说很合适,这基本上就是你的代码。
<form name="paypalSubmit" method="POST" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="sandbo_1111111@angelleye.com">
<input type="hidden" name="image_url" value="">
<input type="hidden" name="item_name_1" value="Xbox Live 12 Month Gold">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Test Widget 2">
<input type="hidden" name="quantity_2" value="5">
<input type="hidden" name="amount_2" value="5.00">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cancel_return" value="../">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="0">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="Pay now with PayPal!">
</form>
这导致以下IPN命中我的服务器。
Array
(
[mc_gross] => 28.54
[protection_eligibility] => Ineligible
[item_number1] =>
[tax] => 2.54
[item_number2] =>
[payer_id] => E7BTGVXBFSUAU
[payment_date] => 02:14:13 May 29, 2013 PDT
[payment_status] => Completed
[charset] => windows-1252
[mc_shipping] => 0.00
[mc_handling] => 0.00
[first_name] => Drew
[mc_fee] => 1.13
[notify_version] => 3.7
[custom] =>
[payer_status] => verified
[business] => sandbo_1111111@angelleye.com
[num_cart_items] => 2
[mc_handling1] => 0.00
[mc_handling2] => 0.00
[verify_sign] => AWRBYJcBybrYpBI1KkvirwZh2gF5A8KmDftB0jwwIJb8qnifB-Ur32ZE
[payer_email] => sandbo_2222222@angelleye.com
[mc_shipping1] => 0.00
[mc_shipping2] => 0.00
[tax1] => 0.00
[tax2] => 0.00
[contact_phone] => 747-668-4003
[txn_id] => 03N63014BS023794T
[payment_type] => instant
[payer_business_name] => Drew Angell's Test Store
[last_name] => Angell
[item_name1] => Xbox Live 12 Month Gold
[receiver_email] => sandbo_1111111@angelleye.com
[item_name2] => Test Widget 2
[payment_fee] => 1.13
[quantity1] => 1
[quantity2] => 5
[receiver_id] => ATSCG2QMC9KAU
[txn_type] => cart
[mc_gross_1] => 1.00
[mc_currency] => USD
[mc_gross_2] => 25.00
[residence_country] => US
[test_ipn] => 1
[transaction_subject] => Shopping CartXbox Live 12 Month GoldTest Widget 2
[payment_gross] => 28.54
[ipn_track_id] => e46d696f3e2a
)
如您所见,IPN数据包含各个项目名称的变量和预期的数量。如果你没有得到同样的东西,你可以发布原始IPN数据样本吗?