Mira chalak
Mira chalak

Reputation: 387

Stripe handling the customer.subscription.deleted

I have a code that disables the user to access my website upon receiving this event : customer.subscription.deleted . However, I want to set a specific condition before applying this code. I have two cases, in one case, if the user is subscribed to INFINITE plan, he pays 40$ each month for 5 months (cancel_at field of subscription is set after 5 months)and then when the subscription ends, his access to the website remains valid. so after 5 payments, he no longer pays, but he still have access to the website. whereas in a second case, if the website's admin manually cancels the subscription or if it is cancelled after many failed payments, I want to disable the user's access. so is there any condition I can set to differentiate between a subscription that was cancelled after being fully paid and another one that was cancelled before it is fully paid ?

Upvotes: 0

Views: 1165

Answers (1)

floatingLomas
floatingLomas

Reputation: 8747

You would have to keep track of this on your end, or using metadata on the Subscription that you kept up to date. There's no way in Stripe to make this distinction.

Upvotes: 2

Related Questions