1

我为我的 iOS 应用程序制作了一个 ipn 处理程序。我在我的应用程序中使用经典的 paypal api。问题是当我从 PayPal IPN 模拟器进行测试时,它工作正常。我从模拟器收到了下面的帖子消息(我不记得有快速结帐):

map[
business:[seller@paypalsandbox.com] 
item_number1:[AK-1234] 
receiver_id:[seller@paypalsandbox.com] 
first_name:[John] 
mc_shipping1:[1.02] 
tax:[2.02] 
residence_country:[US] 
txn_type:[cart] 
mc_shipping:[3.02] 
test_ipn:[1] 
custom:[xyz123] 
mc_handling:[2.06] 
mc_handling1:[1.67] 
payer_id:[TESTBUYERID01] 
payment_status:[Completed] 
receiver_email:[seller@paypalsandbox.com] 
mc_currency:[USD] 
verify_sign:[AdsvkafFyuBADI8IS081RggbvUxmAu2ntBemAGacZ3Dx56qQzmc9QzhK] 
address_country:[United States] 
item_name1:[something] 
mc_fee:[0.44] 
address_state:[CA] 
mc_gross1:[9.34] 
payer_status:[unverified] 
last_name:[Smith] 
invoice:[abc1234] 
payment_date:[07:44:54 23 May 2013 PDT] 
address_city:[San Jose] 
mc_gross:[12.34] 
address_street:[123, any street] 
notify_version:[2.4] 
txn_id:[298300930] 
payer_email:[buyer@paypalsandbox.com] 
address_status:[confirmed] 
payment_type:[instant] 
address_zip:[95131] 
address_country_code:[US] 
address_name:[John Smith]
]

但是当我尝试使用沙盒帐户进行测试时,我收到了下面的帖子消息,它也可以正常工作:

map[
fees_payer:[EACHRECEIVER] 
transaction[0].id:[89799058XE923193M] 
verify_sign:[AE6aVMFpE6M3pfCoNe9gPQ4pMixOA9NNUFbTWPTrOik1CqrdIVxc3K3M] 
pay_key:[AP-9DJ400382D973781B] 
transaction[0].id_for_sender_txn:[8MC20151R46812309] 
transaction[0].status:[Completed] 
action_type:[PAY] 
transaction[0].is_primary_receiver:[false] 
sender.useCredentials:[true] 
transaction[0].pending_reason:[NONE] 
transaction[0].amount:[USD 29.00] 
payment_request_date:[Thu May 23 07:46:49 PDT 2013] 
reverse_all_parallel_payments_on_error:[false] 
test_ipn:[1] 
status:[COMPLETED] 
transaction[0].status_for_sender_txn:[Completed] 
transaction[0].paymentType:[SERVICE] 
notify_version:[UNVERSIONED] 
transaction[0].receiver:[mail-facilitator@something.com] 
return_url:[http://www.paypal.com] 
log_default_shipping_address_in_transaction:[false] 
charset:[windows-1252] 
cancel_url:[http://www.paypal.com] 
transaction_type:[Adaptive Payment PAY] 
ipn_notification_url:[http://something.com/ipnhandler/]
]

但是正如您所看到的,这两者之间没有相似之处,并且这里没有任何对我有用的东西。使用模拟器,我得到了付款人姓名、电子邮件等,但使用沙盒帐户,我想我只会通知自己我收到了付款。我想知道为什么会发生这种情况,当应用程序上线时会不会是这样。

4

1 回答 1

0

有点晚了,但是是的,由于交易不同,由于自适应支付而发送的 IPN 是不同的。例如,由于可以有多个接收器,因此使用单个 receiver_id 字段没有意义。Paypal 提供了所有字段和可能值的概述:https ://developer.paypal.com/docs/classic/adaptive-payments/integration-guide/APIPN/

于 2015-09-30T10:17:53.877 回答