0

在从 PayPal 的 IPN 购物车结账消息传递的所有变量中,为什么不存在每个项目的数量?我目前只有变量num_cart_items,它有助于指示他们签出的商品数量,但每个商品都没有描述每次购买数量的变量。

非常感谢任何帮助!

谢谢 :)

4

1 回答 1

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 数据的样本吗?

于 2013-05-29T09:18:44.703 回答