PayPal IPN回发失败 [英] PayPal IPN postback failure
问题描述
我最近将我的Magento实时网站从1.6.2.0升级到1.7.0.0. 从升级后开始,我现在在贝宝标准付款中遇到问题. 当客户使用PayPal付款时,PayPal上的付款会顺利进行,但是Magento订单状态不会更新,而是保持待处理"状态.
I have recently upgraded my Magento live website from 1.6.2.0 to 1.7.0.0. Starting after the upgrade, I now have a issue in PayPal Standard Payment. When a customer pays by using PayPal, the payment on PayPal goes smoothly, but the Magento order state is not updated and stays in "pending" state.
我已经检查了多个报告此问题的网站,但仍然无法解决问题.
I have checked various websites reporting this, but I can't still solve the problem.
我有payment_paypal_standard.log报告此: .... [postback_result] => [例外] => PayPal IPN回发失败.有关详细信息,请参见paypal_unknown_ipn.log."
I have the payment_paypal_standard.log reporting this: ".... [postback_result] => [exception] => PayPal IPN postback failure. See paypal_unknown_ipn.log for details."
但是我没有创建paypal_unknown_ipn.log,因此无法获得有关该错误的更多信息.
But I have no paypal_unknown_ipn.log being created, so I can't have more info about the error.
进行更多调查,我发现可能的麻烦是返回的PayPal回发字符串未正确解密,但是我没有找到真正的解决方案来帮助我解决问题.
Investigating more, I have found the possible trouble is that the returning PayPal postback string is not correctly decrypted, but I have not found a real solution that help me to solve the problem.
有没有一种方法可以很快找到解决方案? 谢谢大家.
Is there a way to find a solution shortly? Thank you all in advance.
推荐答案
请参见 http://doghouse.agency/article/debugging-paypal-ipn-postback-failures-magento
基本上,CURL有时会决定在回发请求标头中添加期望:100"字段,以检查是否允许发送此请求.这会导致CURL响应字符串与Magento(最高1.7)的预期值不同
Basically, CURL sometimes decides to add a "Expect: 100" field to the postback request-header to check if it's allowed to send this request. This causes the CURL response string to be different than what Magento (up to 1.7) expects
更改
$response = preg_split('/^\r?$/m', $response, 2);
$response = trim($response[1]);
到
$response = preg_split('/^\r?$/m', $response);
$response = trim(end($response));
,它应该可以解决此特定问题.当然,您可能会遇到其他问题,例如CURL错误.在这种情况下,请记录CURL错误号.有关CURL错误编号的列表,请参见此页面: http://curl.haxx. se/libcurl/c/libcurl-errors.html
and it should fix this specific issue. Of course, you could be experiencing a different issue, ie a CURL error. In that case, log the CURL error number. See this page for a list of CURL error numbers: http://curl.haxx.se/libcurl/c/libcurl-errors.html
这篇关于PayPal IPN回发失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!