PayPal IPN模拟器返回"INVALID",但我遵循了规则

Bra*_*ton 1 php paypal paypal-ipn guzzle

所以我有一个PHP服务,唯一的工作就是接受PayPal IPN连接.我正在使用PSR7 $request->getBody()->getContents()从PayPal IPN模拟器请求中获取以下内容.

payment_type=echeck&payment_date=Tue%20Jun%2007%202016%2012%3A56%3A47%20GMT+0100%20%28BST%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer@paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John%20Smith&address_country=United%20States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San%20Jose&address_street=123%20any%20street&business=seller@paypalsandbox.com&receiver_email=seller@paypalsandbox.com&receiver_id=seller@paypalsandbox.com&residence_country=US&item_name=something&item_number=AK-1234&quantity=1&shipping=3.04&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&txn_type=web_accept&txn_id=787223012&notify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AfBnnvbsi0E9urbgYYn51fFWPj23
Run Code Online (Sandbox Code Playgroud)

所以,当我使用后狂饮6这回POSTING以https://www.sandbox.paypal.com/cgi-bin/webscr使用以下body.

cmd=_notify-validate&payment_type=echeck&payment_date=Tue%20Jun%2007%202016%2012%3A56%3A47%20GMT+0100%20%28BST%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer@paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John%20Smith&address_country=United%20States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San%20Jose&address_street=123%20any%20street&business=seller@paypalsandbox.com&receiver_email=seller@paypalsandbox.com&receiver_id=seller@paypalsandbox.com&residence_country=US&item_name=something&item_number=AK-1234&quantity=1&shipping=3.04&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&txn_type=web_accept&txn_id=787223012&notify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AfBnnvbsi0E9urbgYYn51fFWPj23
Run Code Online (Sandbox Code Playgroud)

我得到INVALID回应.我不知道它是否来自处理SSL终止的服务器的不同IP地址是问题还是我只是疯了.

我在PayPal的模拟器请求体上运行了差异,我发送回的身体没有cmd变量,没有区别.

小智 7

似乎新的IPN模拟器界面在payment_date字段中使用javascript日期.如果你手动将它设置为类似今天它可以正常工作.无论这是IPN模拟器端的编码/解码问题,还是IPN监听器,我都不确定.