Empty IPN response using php / curl

musaffar
New Community Member

Hi

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.

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;
```

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.

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?

Kind Regards
Musaffar

Login to Me Too
1 REPLY 1

MTS-Aaron
PayPal Employee
PayPal Employee

Hi @musaffar 

 

When looking at this, the URL kind of stuck out to me. The documentation here seems to say the link should be "https://ipnpb.paypal.com/cgi-bin/webscr (for live IPNs)" along with the prefixing the returned message with the cmd=_notify-validate. I guess I'd try a few different variations just to see if I couldn't get some response from there.

 

Also, refer to some of this information to see if you are seeing any IPN messages sent in your IPN history. Just something to check in case your notification URL is different in your account or for some reason there's a bigger reason that IPNs aren't getting sent.

 

Hope this helps!

-Aaron

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.