stripe-payments

Stripe checkout: handling subscription payment failure


Say an user's monthly subscription is renewed, at which point the 'customer.subscription_updated' event fires off. As it is, I extend the user's subscription by one month. Though, if the event 'invoice.payment_failed' comes after a few days, I update a boolean in the database named 'subscriptionNotPaid' to true and the subscription's benefits are disabled in the app. After that, how should I activate it again? What event should dictate that it is now safe to re-enable the subscription's benefits in the app?

Thanks in advance for any help.


Solution

  • You'd react to the invoice.paid event to reactivate the subscription.

    https://docs.stripe.com/billing/subscriptions/webhooks#active-subscriptions