我正在使用PayPal的IPN模拟器测试我的IPN侦听器。每次我发送 IPN 时,它都会返回"无效"。我不知道为什么。尽我所能告诉我的原始帖子数据和我发回PayPal进行验证的数据是相同的。唯一的区别是URL编码和添加的cmd=_notify-validate
。
这是我的原始帖子数据:
residence_country=US&invoice=abc1234&address_city=San+Jose&first_name=John&payer_id=TESTBUYERID01&mc_fee=0.44&txn_id=923817247&receiver_email=seller%40paypalsandbox.com&custom=xyz123&payment_date=07%3A44%3A50+31+Oct+2013+PDT&address_country_code=US&address_zip=95131&item_name1=something&mc_handling=2.06&mc_handling1=1.67&tax=2.02&address_name=John+Smith&last_name=Smith&receiver_id=seller%40paypalsandbox.com&verify_sign=ADrwWMGU4CgA.e78xLpNtVihnEe2AKdWo1wY-lMkTec9.xajg4zK.uvs&address_country=United+States&payment_status=Completed&address_status=confirmed&business=seller%40paypalsandbox.com&payer_email=buyer%40paypalsandbox.com¬ify_version=2.4&txn_type=cart&test_ipn=1&payer_status=verified&mc_currency=USD&mc_gross=15.34&mc_shipping=3.02&mc_shipping1=1.02&item_number1=AK-1234&address_state=CA&mc_gross1=12.34&payment_type=instant&address_street=123%2C+any+street
和我的验证数据:
cmd=_notify-validate&residence_country=US&invoice=abc1234&address_city=San%252BJose&first_name=John&payer_id=TESTBUYERID01&mc_fee=0.44&txn_id=923817247&receiver_email=seller%252540paypalsandbox.com&custom=xyz123&payment_date=07%25253A44%25253A50%252B31%252BOct%252B2013%252BPDT&address_country_code=US&address_zip=95131&item_name1=something&mc_handling=2.06&mc_handling1=1.67&tax=2.02&address_name=John%252BSmith&last_name=Smith&receiver_id=seller%252540paypalsandbox.com&verify_sign=ADrwWMGU4CgA.e78xLpNtVihnEe2AKdWo1wY-lMkTec9.xajg4zK.uvs&address_country=United%252BStates&payment_status=Completed&address_status=confirmed&business=seller%252540paypalsandbox.com&payer_email=buyer%252540paypalsandbox.com¬ify_version=2.4&txn_type=cart&test_ipn=1&payer_status=verified&mc_currency=USD&mc_gross=15.34&mc_shipping=3.02&mc_shipping1=1.02&item_number1=AK-1234&address_state=CA&mc_gross1=12.34&payment_type=instant&address_street=123%25252C%252Bany%252Bstreet
我用于侦听器的代码与PayPal https://github.com/paypal/ipn-code-samples 提供的示例代码几乎相同,只需进行一些小的修改即可使其在我的特定服务器环境中工作。
任何想法为什么这没有验证?
字符串在编码之前未被解码;)