我正在为我的iOS应用程序创建一个ipn处理程序。我使用经典的贝宝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/]
]
但是正如你所看到的,这两者之间没有任何相似之处,这里没有任何对我有用的东西。使用模拟器时,我可以获得付款人的姓名、电子邮件等信息,但使用沙盒账户时,我想我只会通知自己收到了付款。我想知道为什么会发生这种情况,当应用程序运行时它会是这样的吗?
有点晚了,但是是的,由于交易不同,作为适应性支付的结果发送的ipn是不同的。例如,因为可以有多个接收者,所以只有一个receiver_id字段是没有意义的。Paypal提供了所有字段和可能值的概述:https://developer.paypal.com/docs/classic/adaptive-payments/integration-guide/APIPN/