Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php PayPal IPN始终返回无效_Php_Paypal_Paypal Sandbox_Paypal Ipn - Fatal编程技术网

Php PayPal IPN始终返回无效

Php PayPal IPN始终返回无效,php,paypal,paypal-sandbox,paypal-ipn,Php,Paypal,Paypal Sandbox,Paypal Ipn,我正在使用PayPal的IPN模拟器测试我的IPN侦听器。每次我发送IPN时,它都返回“无效”。我不明白为什么。尽我所能,我可以告诉我的原始帖子数据和我发送回贝宝进行验证的数据是相同的。唯一的区别是URL编码和添加的cmd=\u notify-validate 以下是我的原始帖子数据: residence_country=US&invoice=abc1234&address_city=San+Jose&first_name=John&payer_id=TESTBU

我正在使用PayPal的IPN模拟器测试我的IPN侦听器。每次我发送IPN时,它都返回“无效”。我不明白为什么。尽我所能,我可以告诉我的原始帖子数据和我发送回贝宝进行验证的数据是相同的。唯一的区别是URL编码和添加的
cmd=\u 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&notify_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&notify_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在提供的示例代码几乎相同,只是做了一些小的修改,使其在我特定的服务器环境中工作


你知道为什么没有验证吗?

字符串在编码之前没有被解码;)

在再次编码之前,您是否对数据进行解码?看看这两个字符串上的街道,它看起来像是被编码了两次。捕捉得不错。就这样。本来应该解码字符串的那一行实际上是在编码。我错过的一定是一个错误的自动完成。谢谢如果你把你的回答作为一个答案,我会把它标记为正确的。我怎样才能得到我的IPN原始帖子数据。我想将其与我的验证数据进行比较@DavidNguyen@FarrisFahad在IPN logsI下,如果您有相同的问题,您能解释一下如何解决此错误吗?@TejasMehta必须以HTML编码的字符串返回数据,因此如果您正在对其进行HTML解码,请确保再次对其进行HTML编码。