Curl/php来自PayPal IPN URL的空响应 [英] Curl / php Empty response from PayPal IPN url

查看:96
本文介绍了Curl/php来自PayPal IPN URL的空响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的几天中,我们的PayPal IPN已停止工作,并收到PayPal的空响应.服务器或我们的代码中没有任何变化.

In the past couple of days, our PayPal IPN has stopped working and receiving a empty response from PayPal. Nothing has changed on the server or in our code.

尝试使用PayPal IPN url只是返回一个空响应.

Attempting to cUrl to the PayPal IPN url simply returns an empty response.

$url = "https://www.paypal.com/cgi-bin/webscr?cmd=_notify-validate";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');

$data = curl_exec($ch);
curl_close($ch);

print $data;

以上内容应返回"INVALID",并可以在我的本地主机和其他服务器上按预期工作. 将网址更改为PayPal以外的任何其他域也可以正常工作.

The above should return "INVALID" and works as expected on my localhost and from other servers. Changing the url to any other domain other then PayPal also works without issues.

因此,它似乎只收到了来自paypal.com的空响应

So it seems it only received the empty response from paypal.com

我想知道是否有人遇到了这个问题,或者是否可以指出希望解决的地方?

I wonder if any one has run into the issue or could give pointers where to look in the hope to- resolve it?

亲切问候 穆沙拉夫

推荐答案

似乎Paypal在周末进行了一些安全更改.自星期天以来,一些oscommerce用户已经出现类似的症状,而卷曲错误被证明是:

It looks like Paypal made some security changes at the weekend. Some oscommerce users have been getting similar symptoms since Sunday with the curl error turning out to be:

SSL证书问题:无法获取本地颁发者证书

SSL certificate problem: unable to get local issuer certificate

在他们的情况下,这是由于本地证书副本仅具有Paypal证书,而没有根证书或中间证书,以及用于更新它的解决方案.

In their cases it was due to the local certificate copy only having the Paypal certificate and not the root or intermediate certificates, with the solution to update it.

可以在以下位置找到工作证书: OSCOM Phoenix github

The working certificate can be found in: OSCOM Phoenix github

这篇关于Curl/php来自PayPal IPN URL的空响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆