Paypal IPN 返回已在沙箱中验证,但在实时情况下无效
所以我一直使用贝宝,沙盒模式一切正常。然而,当我用真钱转移到实时贝宝时,IPN 返回无效。
我在这里使用脚本的一个版本( https://cms .paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt )根据我的需要进行修改,只有数据库交互等不同的位
我在这里发现了这个问题( http://www .hebtech.co.uk/blog/paypal-ipn-invalid-on-live-server-but-valid-on-test-server-fixed/ )这似乎是我遇到的问题,基本上说它与地址的可选第二行中的回车有关(在沙箱中的测试帐户上,未填写)。但是主帖中的解决方案和评论中的另一个解决方案不起作用,如下所示
$value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i','${1}%0D%0A${3}',$value);
或
$value = preg_replace('/(.*?)(%0D%0A|%0A)(.*)/i','${1}%0D%0A${3}',$value);
有什么想法吗?让我抓狂。它并没有停止付款,只是意味着在网站上,必须手动将状态更改为已付款
So I have been using paypal, and sandbox mode everything works fine. Yet when I move over to live paypal with real money, IPN returns INVALID.
I am using a version of the script here ( https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt ) modified to my needs, only bits that are different are the db interactions etc
I have found this issue here ( http://www.hebtech.co.uk/blog/paypal-ipn-invalid-on-live-server-but-valid-on-test-server-fixed/ ) which seems to be the problem I am having, and basically says its to do with a carriage return in the optional second line of the address (which on test accounts in sandbox, isnt filled out). But the solution in the main post and another in the comments dont work, as below
$value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i','${1}%0D%0A${3}',$value);
OR
$value = preg_replace('/(.*?)(%0D%0A|%0A)(.*)/i','${1}%0D%0A${3}',$value);
Any ideas? Driving me mad. Its not stopping the payment, but it just means on the site, changing the status to paid has to be done manually
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试这个:
我也遇到自定义字段中的字符
;
问题。查看您发送至 PayPall 的所有字段。还要检查所有字段中除 AZ 或 0-9 以外的任何字符。您可以尝试的最后一件事是在语言编码选项中设置字符集: https ://www.paypal.com/cgi-bin/webscr?cmd=_profile-language-encoding
You can try this one:
I have also problem with character
;
in custom field. Look in all fields you send to PayPall. Also check in all field any character which is not A-Z or 0-9.Last thing you can try is set charset in your language encoding options: https://www.paypal.com/cgi-bin/webscr?cmd=_profile-language-encoding