PayPal recurring payment cancelled with remaining days

When we implemented subscription services on our own website, we basically handle the events like this:

  • subscription confirmation - we mark the user's subscription on our server as "automatic renewal"
  • money received - we move the user's subscription expiry date based on the agreed term (monthly or yearly); using trial periods, this event only gets sent when the trial period finishes
  • subscription cancelation - we mark the user's subscription on our server as "manual renewal"
  • money refunded - we move the user's subscription expiry date back based on the agreed term.

Upon user sign in, we check whether the subscription has expired (which is easy if you store that in your db).

Basically, subscription events are separate from payment events. A subscription can be cancelled but that doesn't mean the payment gets refunded; that would be a separate event.

Btw, payment and subscription events can come in different order (e.g. payment can come first, followed by subscription notification); it's important to cater for that.


When user subscribes, paypal will create a recurring payment profile, which means the user will have to pay monthly (yearly, daily depending on the profile) the sum, on the day he subscribed (ex. 1st May, 1st June, 1st July). When the user cancels, he cancels the payment profile, not the payment itself. So after that paypal will not ask for any other payment. If you want to give the user the days, which were left you have to store the information about the subscription.

You can store in a db the day he subscribed and the day he cancelled.From there you can tell how many days the user still has. Paypal sends IPN messages both on the creation of the recurring payment profile, on the payment itself and on the cancel as well.

You can find information on the IPN messages here: https://cms.paypal.com/cms_content/US/en_US/files/developer/IPNGuide.pdf