PHP Code

How to integrate PayPal subscriptions with PHP

With my link checking tool I just created, people can use it for free, but they have a limited number of links that they can track. Paid users have more options, and can track more links. So, I needed to be able to use PayPal subscriptions, and I didn't want to have to manually initiate and track them. PayPal publishes their APIs, but I also didn't want to spend days building a PHP class to interface with those APIs! So I did a quick Google search, and was able to find an open source PayPal IPN class. The class was perfect, it allowed me to create and handle subscription info passed from PayPal. Now I can track when users sign up, when the pay, and even when they cancel!



  1. Fantastic. Just what I was looking for. Thanks

  2. the PayPalIPN class does not provide any code for subscription. So would you please help me with the subscription code.

  3. Yes it does. You just need to use the proper form elements.

  4. It would be nice if it was explained how to use this in conjunction with the URL that is created using your paypal subscription link creator. Would you be able to give us a basis guideline.

  5. It's not used with the link. The link creator tool I made is purely for use with Paypal directly. This class is used to interface your app with paypal, to do transactions from your webapp.

  6. The class is very good, but you still need to look up the right paypal parameters and IPN codes in the paypal docs to use it.
    If you need to separate trail period payments from regular payments, handle cancellations and end-of-term IPN correctly, you will need to extend the class considerably. But it is the best starting point for this I can think of.

  7. Cook Rocks

Leave a Reply

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image