Php IPN Post数据、IPN模拟器提交的数据和实际购买的数据包含不同的密钥名称
我原本以为我的IPN脚本在从沙盒用户生成的事务发送时根本没有收到任何post数据,但数据实际上就在那里,与IPN模拟器相比,数组中的每个变量都有不同的键名。我在谷歌上搜索过,但没有找到任何人有相同的问题或解决方案 我在用户事务的post数据中注意到,它有一个未设置的“Version”变量,您认为IPN模拟器使用的是一个更新的版本,该版本为密钥指定了不同的名称吗 以前有没有人遇到过这一点,或者也许可以解释一下是什么导致了这一点 这是来自IPN模拟器的post数据:Php IPN Post数据、IPN模拟器提交的数据和实际购买的数据包含不同的密钥名称,php,paypal,paypal-ipn,Php,Paypal,Paypal Ipn,我原本以为我的IPN脚本在从沙盒用户生成的事务发送时根本没有收到任何post数据,但数据实际上就在那里,与IPN模拟器相比,数组中的每个变量都有不同的键名。我在谷歌上搜索过,但没有找到任何人有相同的问题或解决方案 我在用户事务的post数据中注意到,它有一个未设置的“Version”变量,您认为IPN模拟器使用的是一个更新的版本,该版本为密钥指定了不同的名称吗 以前有没有人遇到过这一点,或者也许可以解释一下是什么导致了这一点 这是来自IPN模拟器的post数据: ["test_ipn"]=&
["test_ipn"]=>
string(1) "1"
["payment_type"]=>
string(7) "instant"
["payment_date"]=>
string(25) "22:58:32 Feb 13, 2013 PST"
["payment_status"]=>
string(9) "Completed"
["address_status"]=>
string(9) "confirmed"
["payer_status"]=>
string(8) "verified"
["first_name"]=>
string(4) "John"
["last_name"]=>
string(5) "Smith"
["payer_email"]=>
string(23) "buyer@paypalsandbox.com"
["payer_id"]=>
string(13) "TESTBUYERID01"
["address_name"]=>
string(10) "John Smith"
["address_country"]=>
string(13) "United States"
["address_country_code"]=>
string(2) "US"
["address_zip"]=>
string(5) "95131"
["address_state"]=>
string(2) "CA"
["address_city"]=>
string(8) "San Jose"
["address_street"]=>
string(15) "123, any street"
["business"]=>
string(24) "seller@paypalsandbox.com"
["receiver_email"]=>
string(24) "seller@paypalsandbox.com"
["receiver_id"]=>
string(13) "TESTSELLERID1"
["residence_country"]=>
string(2) "US"
["item_name"]=>
string(9) "something"
["item_number"]=>
string(7) "AK-1234"
["quantity"]=>
string(1) "1"
["shipping"]=>
string(4) "3.04"
["tax"]=>
string(4) "2.02"
["mc_currency"]=>
string(3) "USD"
["mc_fee"]=>
string(4) "0.44"
["mc_gross"]=>
string(5) "12.34"
["mc_gross_1"]=>
string(4) "9.34"
["txn_type"]=>
string(10) "web_accept"
["txn_id"]=>
string(8) "32214658"
["notify_version"]=>
string(3) "2.1"
["custom"]=>
string(6) "xyz123"
["charset"]=>
string(12) "windows-1252"
["verify_sign"]=>
string(56) "A2O3KRKURYa65AG.dmp.MoIqMpDwAmL2IgMH3fAcOss.ur6ERwozl2ty"
}
下面是我在沙箱帐户上的交易数据:
["transaction%5B0%5D.is_primary_receiver"]=>
string(4) "true"
["transaction%5B0%5D.id_for_sender_txn"]=>
string(17) "5SF603183Y786454Y"
["log_default_shipping_address_in_transaction"]=>
string(5) "false"
["transaction%5B0%5D.receiver"]=>
string(37) "sell1_1360732717_biz@derp.com.au"
["action_type"]=>
string(3) "PAY"
["ipn_notification_url"]=>
string(45) "http://portal.derp.com.au/ipn.php"
["transaction%5B1%5D.paymentType"]=>
string(7) "SERVICE"
["transaction%5B0%5D.amount"]=>
string(10) "AUD 199.00"
["charset"]=>
string(12) "windows-1252"
["transaction_type"]=>
string(20) "Adaptive Payment PAY"
["transaction%5B1%5D.id_for_sender_txn"]=>
string(17) "60334361SH094251D"
["transaction%5B1%5D.is_primary_receiver"]=>
string(5) "false"
["transaction%5B0%5D.status"]=>
string(9) "Completed"
["notify_version"]=>
string(11) "UNVERSIONED"
["transaction%5B0%5D.id"]=>
string(17) "8WL542056F860892D"
["cancel_url"]=>
string(38) "http://portal.derp.com.au/"
["transaction%5B1%5D.status_for_sender_txn"]=>
string(9) "Completed"
["transaction%5B1%5D.receiver"]=>
string(37) "sell2_1360732814_biz@derp.com.au"
["verify_sign"]=>
string(56) "An5ns1Kso7MWUdW4ErQKJJJ4qi4-A-p4knnXsUdoGkBReiFAIhHXAyN9"
["sender_email"]=>
string(36) "buy1_1360732893_per@derp.com.au"
["fees_payer"]=>
string(12) "EACHRECEIVER"
["transaction%5B0%5D.status_for_sender_txn"]=>
string(9) "Completed"
["return_url"]=>
string(53) "http://portal.derp.com.au/?p=paypalreturn"
["transaction%5B0%5D.paymentType"]=>
string(7) "SERVICE"
["transaction%5B1%5D.amount"]=>
string(9) "AUD 10.00"
["reverse_all_parallel_payments_on_error"]=>
string(5) "false"
["tracking_id"]=>
string(9) "9ZZVg7JNp"
["transaction%5B1%5D.pending_reason"]=>
string(4) "NONE"
["pay_key"]=>
string(20) "AP-6P166651K3308681V"
["transaction%5B1%5D.id"]=>
string(17) "66117669L4710640J"
["transaction%5B0%5D.pending_reason"]=>
string(4) "NONE"
["status"]=>
string(9) "COMPLETED"
["transaction%5B1%5D.status"]=>
string(9) "Completed"
["test_ipn"]=>
string(1) "1"
["payment_request_date"]=>
string(28) "Wed Feb 13 22:41:09 PST 2013"
}
你走的方向是对的。这取决于您尝试模拟的IPN类型。IPN模拟器已经存在了一段时间,它在自适应支付之前就已经存在了。因此,它不会产生一个IPN职位,将从自适应支付。这可能是以后实现的,但目前不允许您通过它模拟AP事务。如果您想从adaptive payments中测试IPN,您需要通过流程,使用您的test sandbox买家帐户向您的test sandbox卖家帐户付款。IPN模拟器正在返回您将在DoDirectPayment API、Web Accept等中看到的变量。我刚刚了解到,在使用自适应支付时,数据以子数组的形式返回,例如事务[0]。金额,事务[1]。金额等,变量名称仍然不匹配,例如txn_id称为transaction_id,但我现在可以这样做:P如果有人知道变量名称不同的原因,我很想知道!:P