IPN Verification on Subscriptions No Longer Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At some point in the last few months, the IPN verification I use on the site is no longer working. The URL of the IPN script is being triggered by PayPal's response, but the check for VERIFICATION doesn't happen anymore. This is for a subscription transaction.
Below is the basic framework of code I've been using. And like I said, up until a few months ago, it was working fine. I should also add that the PayPal account changed in that time too, although I don't see how that would have affected it. The IPN setting is set to on, and the URL is being properly triggered.
// read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system 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 ('ssl://www.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // ****************************** PAYMENT IS VERIFIED foreach($_POST as $key => $value){ echo $key." = ". $value."
"; } if($transaction_type == 'subscr_signup') { } else if($transaction_type == 'subscr_payment') { } else if($transaction_type == 'subscr_cancel') { } else if($transaction_type == 'subscr_eot') { } //*******************************************************************************************************************// } else if (strcmp ($res, "INVALID") == 0) { // **********************PAYMENT INVALID OR DID NOT GO THROUGH } } // End Of While Loop fclose ($fp); } // Of if(!$fp)
One last thing. I inserted some error logging into this script (not shown in the framework above), and for the response code, I am getting HTTP/1.0 400 Bad Request, and Invalid URL messages. I just don't know what that could be referring to.
Thanks for any help provided.
- Labels:
-
Reporting Center
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://www.paypal-community.com/t5/PayPal-Payments-Standard/Postback-to-PayPal-suddenly-stopped-wor...
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the first sentence, is the word "not" a typo? Should it be "now"?
"You need to update your script to use HTTP 1.1 instead of 1.0, which is NOW a requirement of PayPal. More info on that available here:"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @angelleye can you please give a look to this issue that is ongoing from July 1st and that does affect a lot of users even if paypal doesn't make any mention of it in the paypal status website? Thanks
https://www.paypal-community.com/t5/PayPal-Reporting/Malformed-IPNs-the-response-contains-unreadable...
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Encrypted subscription button has stopped working in NVP/SOAP APIs
- Subscription Quantity Not Working in PayPal Payments Standard
- PAYMENT.SALE.COMPLETED signature verification failed in sandbox mode in REST APIs
- Website payment preferences, auto return stopped working with new subscription payment button in PayPal Payments Standard
- Save Credit Card for later in REST APIs