Paypal webhooks and subscription expiration dates

Viewed 137

I'm listening for the BILLING.SUBSCRIPTION.ACTIVATED event and everything gets stored in my backend. This event contains a property called next_billing_time, which is all good. Then whenever a user makes a payment to that subscription ID it is shown in the PAYMENT.SALE.COMPLETED event, this event however has no next_billing_time property. My question is, how do I keep track of the new billing time after payment is made? Do I have to use the old next_billing_time and calculate that manually?

1 Answers

The simplest design is to go off PAYMENT.SALE.COMPLETED. Use it to mark a subscription good for 1 month or whatever term (maybe a day of grace time), and if you don't receive a new PAYMENT.SALE.COMPLETED soon enough, consider the subscription lapsed on your end.

Related