December 21, 2014

PayPal IPN Tester and Code Samples

I must have been living under a rock for a long time — I didn’t know that PayPal had an Instant Payment Notification Simulator (tester)… I’ve been using the PayPal sandbox for quite some time, but for whatever reason, I didn’t know that they had a tool that would allow me to test my IPN scripts by themselves.

PayPal allows us to test out our payment buttons in two ways — by testing how a transaction takes place from the buyer’s and seller’s sides, and to test any IPN script that you have installed.

In order to use these tools, you must signup at the PayPal Developer website, and then you’ll have to create a couple of test accounts (buyer & seller) to test a payment button.

In order to test your IPN script, after you’re logged into your PayPal developer account, you’ll want to scroll to the bottom of the page and click on the Instant Payment Notification (IPN) simulator link. This will allow you to test a great number of PayPal’s payment types — eChecks, shopping cart checkout, “buy it now” button payments, refunds, etc. I can’t believe i just stumbled upon this myself.

If you’re in need of IPN code samples, PayPal offers sample scripts in several languages:Perl, Coldfusion, ASP.net, PHP and a couple of others. I can’t vouch for any of the code except for the Perl IPN script, but that one works perfectly.

You can download the sample PayPal IPN scripts from this page.

One thing to mention, though. If you’re going to use your PayPal developer account to test the Instant Payment Notification scripts in the IPN simulator, you need to change the POST URL from:

https://www.paypal.com/cgi-bin/webscr

to

https://www.sandbox.paypal.com/cgi-bin/webscr

Otherwise you’ll likely go mad trying to figure out why your PayPal IPN script isn’t working.

I stumbled upon this (the Instant Payment Notification tester) the other day, and wanted to share it here. As for the advice about changing the URL — I wasted about an hour trying to figure out why the supplied PayPal IPN script didn’t work… I had the wrong URL — I thought I would share that as well.

Be sure to change the POST URL back to the main PayPal URL before you use the IPN code for actual purchases.

Related Topics

comments

One Response to “PayPal IPN Tester and Code Samples”

  1. jim from Motion simulators(new comment) on July 27th, 2009

    Paypal is great… the IPN does make life easier.

Leave a Reply




CommentLuv Enabled

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.