Paypal IPN from the sandbox not working

I spent two hours today trying to figure out why paypal wasn’t sending any instant payment notifications (IPN) to one of our new projects. Everything seemed right, I had notify_url in the form, the script could be accessed remotely, I had logging on for http and the script itself. After processing a payment I had 0 requests from the paypal servers hit our development server.

I read around various blogs and discussion forums for obvious problems, of which there are many (see below), but I was sure I had done everything right!

Eventually I stumbled across some posts on the paypal developers forum where a few posters were complaining that the sandbox IPN posts were either really slow (hours) or just never got sent. Worse still, there was one post where paypal acknowledged that payment notifications just did not work on the sandbox for two months!!

I used the IPN test in the sandbox area to test the script in the end. You have to type in the test values manually and you can’t test the entire process in one go but at least it got the job done. Needless to say, the single IPN tests work flawlessly. As one final test I used two live paypal accounts to send small payments to each other. IPN worked without a hitch on the live paypal site.

So, if you are stuggling to get IPN working and your logs show that paypal is not posting to your server, maybe this is your problem too. Before you assume it is however, I read of many other common issues that although blatantly obvious, many people (including myself) have often fallen for:

  1. I don’t know why, but some people were using URLs like http://localhost/ipn.php for the notify_url value. Their argument is that it works for the return url. The return URL works as localhost because paypal posts the value in your own browser, which can resolve localhost to the computer you are on. Paypals own servers obviously can’t!
  2. The ipn processing script was inaccessible (password protected, behind firewalls, etc). Make sure you can access it from outside your local network and that requests from paypal are in your web server logs.
  3. Certain types of escaping for the POST request to paypal can mean that paypal doesn’t understand the URL.
  4. The IPN processing script erroring before it can log any information. Make sure php/http/whatever logging is enabled for this script – logging is a god send for cases like this.

Hopefully you haven’t fallen for any of the above and its just paypal being crappy. In any case, I hope this post saves somebody a bit of time.

This entry was posted in Googled, Peeves, Web dev. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. ma
    Posted April 10, 2009 at 1:16 pm | Permalink

    That’s good to know it isn’t just me.

    I had a streak of good luck in the beginning, because I had no issues at all. IPNs were instantaneous.

    Now, after having put the project on hold for a week or so and then restarting it, I was afraid I broke something in the program. My logging in the listener didn’t even recognize that the listener started, but I could get it to log when I manually visited the listener url. Hopefully, it is just PayPal’s sandbox.

  2. Alex
    Posted August 8, 2009 at 2:57 pm | Permalink

    We also used to have the problem with Paypal sandbox, and they didn’t respond to the requests for about a week. Fortunately, the Paypal integration with AceFlex ebusiness software has been finished later after Paypal’s servers started to operate again. However, don’t be surprised if other Paypal services suddenly stopped working. Even, if you follow their up-to-date documentation sometimes it doesn’t shoot and you need to find other work-arounds.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

  • Categories

  • Archives