IPN validation

SSSdev
Contributor
Contributor

I've had Paypal IPN processing set up for years and it worked fine. Recently though, processing repeatedly fails. I checked where the glitch was and discovered that the IPN is not getting validated by Paypal. Can someone tell me if there's a bug in any of the following PHP code?

 

Post back to Paypal to validate:

 

$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";

$header .= "Content-Type: application/x-www-form-urlencoded\r\n";

$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";

$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);

 

Then get the validation string:

 

fwrite ($fp, $header . 3);

$res = fread ($fp, 8192);

fclose ($fp);

 

When I check variable $res, it's blank/empty (should be "VERIFIED")

 

=====

 

UPDATE: I checked for variable $fp, and it comes back as "Resource id #16"

 

That doesn't sound right; can anyone tell me what it means and how to fix it if it's wrong?

Login to Me Too
3 REPLIES 3

SSSdev
Contributor
Contributor

Couldn't find anything on Resource id #16 in this forum.

Login to Me Too

Kavyar
Moderator
Moderator

Good day @SSSdev 

 

Thank you for posting to the PayPal community.

 

To address the issue you are experiencing, please find below the links to detailed guides that will assist you in resolving the issue:

 

https://developer.paypal.com/api/nvp-soap/ipn/IPNTesting/#link-ipntroubleshootingtips

 

https://www.paypal.com/us/cshelp/article/how-do-i-troubleshoot-instant-payment-notification-ipn-ts20...

 

If you are still experiencing issues, please create an MTS ticket via the following URL - https://www.paypal-support.com/s/?language=en_US . Please ensure that you provide detailed information and error details when submitting the ticket.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

SSSdev
Contributor
Contributor

Thanks for this, but I think my issue is more deep-rooted -- out-of-date paypal connection protocol set up many years ago. I've hired a developer to update my IPN script. Hopefully that will resolve it.

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.