Jump to content
tobybailey

Paypal IPNs have stopped working for us yesterday

Recommended Posts

About 36 hours ago something changed and orders started being successfully paid for via Papal (Website Payments Pro Hosted Official on oSC 2.3) but IPN notifications stopped being processed and so the orders were never being updated to paid in the database.

 

Weblogs our end show the IPNs arriving and on Paypal we see them appear in our IPN History as acknowledged.

 

Some part of the verification procedure whereby we have to send back a copy of the IPN and Paypal returns "Verified" or "Invalid" is presumably failing. We get an email generated by our IPN handler saying the IPN was invalid, but a look at the code suggests that would also happen if for some reason we were not getting a response from the Paypal verification server.

 

A week or two ago we had a period of a few hours where the same thing happened but it magically fixed itself and started working again.

 

Does anybody have any ideas/experience on this? If so, I'd be very grateful for suggestions.

 

Toby

Share this post


Link to post
Share on other sites

Hello,

 

I encountered this issue too. Hopefully I've fixed it.

 

Open your "paypal_ipn.php"-script and search for

 

 if ( ($res == 'VERIFIED') || ($res == 'INVALID') ) {
    $result = $res;

    break;
  }

 

and change it to

 

 

  if ( (trim($res) == 'VERIFIED') || (trim($res) == 'INVALID') ) {
    $result = trim($res);

    break;
  }

 

This removes the spaces at the end of the lines. I don't know where they come from, if PayPal changed something.

 

AD

Share this post


Link to post
Share on other sites

Angus, thanks. In fact I tracked this down myself this morning just before seeing your post and arrived at a similar solution. I was logging the paypal response to the verification and it sends something around the important bit I record as

--------------

Content-Type: text/html; charset=UTF-8

-blank line-

8

VERIFIED

0

------------

 

I wonder what the "8" and the "0" are about?

 

On a separate note, we are using the "official" website payments pro i-framed payment solution. It works but we do get a lot of problems with customers not managing to check out due often it would seem to the iframe not appearing. I can't quite decide whether this is caused by Paypal down times, crankyness of the i-frame solution or something subtle we are doing wrong. I'd be interested to know if you are using something similar and what its reliability is like.

 

Toby

Share this post


Link to post
Share on other sites

Hi,

 

I don't know what the numbers represent. I called the ipn-script without valid variables and received "7 INVALID 0" (last 3 lines), so maybe 7 => INVALID; 8 => VERIFIED? But this is just a guess.

 

We use the (customized) standard OSC-paypal-ipn payment module, no iframes. Maybe some of your customers disabled the display of iframes in their browsers?

 

AD

Edited by AngusD

Share this post


Link to post
Share on other sites

IIRC Paypal's documentation says very clearly that the response contains only the word VERIFIED or INVALID. But I'd not be surprised if that was wrong.

 

Most of our customers are not very techy, so I doubt they disable iframes. And sometimes they try again and it works - and I doubt even more that that can be due to their working out how to enable them. Possibly we should look at the solution where the customer gets taken transparently to paypal hosted (but branded by us) pages. But maybe it is just paypal unreliability - they do seem to have s surprising amount of down time.

 

Cheers,

 

Toby

Share this post


Link to post
Share on other sites

I believe, the bucket full of stuff comes from the fsockopen-function. If I use cURL I get only "VERIFIED" or "INVALID", nothing more.

 

Can't tell much of PayPal's downtime. I noticed only one or two (or so) downtimes of PayPal myself.

 

AD

Share this post


Link to post
Share on other sites

I just wanted to note that this is happening for us on multiple sites running MS2.2 on different servers.


Kym

Projects Director @ ozEworks.com

Share this post


Link to post
Share on other sites

Thank you , thank you, thank you for figuring out that it was a trim issue. Spent hours on this problem for a (non-osCommerce) script that I maintain.

 

EDIT: In my case it appears to be an extra newline, not padded spaces. But trim() works either way.

Edited by chadcloman

Check out Chad's News.

Share this post


Link to post
Share on other sites

We raised this issue directly with PayPal but they denied any change had occurred.


Kym

Projects Director @ ozEworks.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×