Empty IPN response using php / curl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- subscription_id has disappeared in REST APIs
- PHP SDK error: broken content-length header in SDKs
- Advanced checkout and no 3DS information in the response in REST APIs
- Paypal 3DS intigration error in NVP/SOAP APIs
- A gateway error log add to get detailed information response from paypal. in PayPal Payments Standard