PayPal IPN Issue, but works in Sandbox fine

断了今生、忘了曾经 提交于 2019-12-03 20:09:38

I found the problem, OMG, it was in the certification file:

Just changed the following:

curl_setopt($ch, CURLOPT_CAINFO, 
    dirname(__FILE__)."/cert/api_cert_chain.crt");

To the actual filepath on my server starting at /home/

curl_setopt($ch, CURLOPT_CAINFO, "FULL FILE PATH/cert/api_cert_chain.crt");

OMG I'm stupid! Works perfectly now! Yayyy!

You should use postback URL as https://ipnpb.paypal.com/cgi-bin/webscr instead of https://www.paypal.com/cgi-bin/webscr for live.

I was struggling with this for a while, and it turned out to be my firewall.

During testing I'd added two rules to allow HTTPS outbound to www.paypal.com and www.sandbox.paypal.com, and it seemed to work fine. In hindsight that was just because the sandbox only has one IP address!

So when I added www.paypal.com to the firewall in iptables it resolved the IP then, but of course later the IP I got from DNS was different, so the firwall started blocking.

As @Latha says, you should use ipnpb.paypal.com instead of www.paypal.com. This is because they list the IP addresses for this domain so you can add them to your firewall spec. They are currently...

173.0.84.8
173.0.84.40
173.0.88.8
173.0.88.40

They are soon (25 March 2014) going to add a lot more, you can find a full list here...

https://ppmts.custhelp.com/app/answers/detail/a_id/92

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!