One of the benefits of having your own merchant account is the level of integration that it provides.

A payment gateway enables your customers to pay without leaving your website, and there is almost no limit to the ways that you can build specific functionality related to payments that makes business easier for customers and your business.

Fortunately, even if you don’t have a merchant account, you can automate a number of things using PayPal’s Instant Payment Notification (IPN) system.

PayPal IPN enables PayPal merchants’ applications to receive automated notifications about payment status so that these applications can perform whatever functions are desired when specific payment events occur.

Want your website to perform some function once a payment has cleared? Does your application need to know when a PayPal subscription has expired? If so, PayPal IPN is a simple yet powerful solution.

Setting Up IPN

Getting started with IPN is easy thanks to the fact that PayPal provides sample code for ASP.net, Cold Fusion, Java, Perl and PHP.

The code is extremely straightforward and with minimal modification can serve as a working script.

The PayPal IPN documentation lists the various variables that are sent with IPN notifications as well as the most important variable – the payment events that it provides notification for.

For instance, if you want your script to do something when a payment has been cleared, you will look for the payment_status variable to be “Completed”.

If you want to know that a subscription has expired, you will look for the txn_type variable to be “subscr_eot.”

By building a script that deals with all of the possible events that are used with the type of payments that you’re accepting and the type of business logic you want to have performed automatically when payment events occur, you can build scripts that significantly reduce the amount of manual work that some merchants have in managing PayPal payments.

Samples

In addition to its sample code, PayPal links to a number of tutorials showing how to implement IPN-based applications. These are worthwhile to look through.

There is also no shortage of PayPal IPN scripts that can be purchased or commercial solutions that use PayPal IPN. However, the sample code provided by PayPal is satisfactory and unless you have a significantly complex application, should suffice.

Telling PayPal to Use IPN

Once your script is set up, you need to tell PayPal where it’s located so that it can send the notifications to it.

The easiest place to do this is in your PayPal order form code.

For instance, if your PayPal IPN script is called ipn.php, add the following hidden form field to your PayPal code:

Summary

Implementing PayPal IPN is a great way to automate many activities that PayPal merchants often handle manually and is a decent compromise for merchants not ready to move up to their own merchant accounts.

For merchants looking for a more integrated solution with a complete API similar in nature to those offered by payment gateways and which allows merchants to keep users on their websites throughout the entire order process, PayPal’s Website Payments Pro offering is another intermediary solution.