Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Paypal IPNs have stopped working for us yesterday


tobybailey

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

Link to comment
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

Link to comment
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

Link to comment
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
Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...