Paypal IPN sandbox returning INVALID

Posted on August 8, 2013 in Web Dev

This is an issue that is very easily overlooked. Paypal have to have some credit here in that they basically give you all the code required to get the IPN up and running properly – and, apart from the issue I’m going to tell you about next, it really does work straight out of the box.

Using the Paypal Sandbox to generate test IPN visits, I kept getting an INVALID response. To find out what my response was, I simply added a different integer to my order_status column; 1 for VERIFIED, or 2 for INVALID.

What you need to do is make sure that when you POST back the IPN data to Paypal, you alter the URL to “https://www.sandbox.paypal.com/cgi-bin/webscr” instead of “https://www.paypal.com/cgi-bin/webscr”. Seems pretty obvious, but also easy to overlook.

If this doesn’t solve your problem, maybe these links will help:

So to re-cap, when you go live with Paypal and Paypal IPN:

  • Ensure you have REMOVED the sandbox part from your IPN page
  • Ensure that your IPN is being sent to the correct URL! In the Paypal IPN settings page I still had my IPN URL as http://dev.___. This meant that real live payments weren’t being processed properly. D’oh. Luckily they were only test live payments.

 

Leave a comment

Was this helpful? Did I miss something? Do you have a question? Get in touch, or tell me below.