Paypal IPN 返回空字符串而不是“VERIFIED”或“无效”
在真实(非沙盒)环境中,Paypal IPN 发送 POST 数据,其中 payment_status = Completed。但是当我尝试从 Paypal 获取交易确认(使用 CURL)时,我收到一个空字符串(不是“VERIFIED”或“INVALID”)。
CURL 不返回任何错误。为了在真实环境中进行确认,我使用 https://www.paypal.com/cgi-bin/webscr< /a> (这是肯定的)。此外,在沙盒中一切正常。
该错误大约2个月前出现。我注意到贝宝改变了网站的一些设计。也许确认过程也发生了变化。但我在文档中没有找到任何更新。
有人遇到过类似的问题吗?
In real (not Sandbox) environment Paypal IPN sends POST data with payment_status = Completed. But when I tried to get transaction confirmation from Paypal (using CURL) I receive an empty string (not "VERIFIED" or "INVALID").
CURL does not return any error. For confirmation in real environment I use https://www.paypal.com/cgi-bin/webscr (that's for sure). Moreover in Sandbox everything works properly.
The error appeared about 2 months ago. I noticed that paypal had changed a little design of the site. Perhaps confirmation process is also changed. But I did not find any updates in the documentation.
Has anybody met a similar problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您得到空响应,请重试。如果所有重试均失败,请发送 500 内部服务器错误,PayPal IPN 服务器将稍后重试。此外,每当收到空响应时,您可能希望记录完整的服务器响应(包括标头)。
If you get empty responses, just retry. If all retries fail, send out a 500 Internal Server Error and the PayPal IPN server will retry later. Also, you might want to log the full server response (including headers) whenever you get an empty response.
比赛迟到了,但以防万一其他人问起。
我已经花了几个小时来解决这个问题,正如我的情况一样,PayPal 要求您使用完整的 URL 来通过 Sandbox 进行 IPN 测试。
例如,使用此 URL“https://www.sandbox.paypal.com/cgi-bin /webscr”而不是“https://sandbox.paypal.com/cgi-bin /webscr”。您需要包含 www,否则 PayPal 会抛出一个空字符串。它不会返回 INVALID,也不会验证 - 它只会给你一个空值。
无论如何,它对我有用。一旦我改变了这一点,一切就都正常运行了。
Late to the game, but just in case anyone else asks.
I've been troubleshooting this for a few hours, and as it happened in my case, PayPal requires you use the full URL for IPN testing with Sandbox.
eg, use this URL "https://www.sandbox.paypal.com/cgi-bin/webscr" rather than "https://sandbox.paypal.com/cgi-bin/webscr". You need to include the www or PayPal will throw you an empty string. It won't return INVALID and it won't Verify - it just gets you an empty.
It worked for me anyway. Once I changed this everything's been up and running fine.