Skip to main content

Stripe - Question about canceling accounts

Rails • Asked by Adrian DeGus

I just finished following the screencasts on setting up Stripe, everything went well!

I have my app setup to cancel accounts :at_period_end so that subscribers can continue accessing content through the duration of their subscription.

Question is, how to postpone the removal of their subscription_id from the users table also :at_period_end?


I found it easiest to just listen for the webhook and remove the subscription then. This makes it simpler so your code doesn't have to add in an exception for the case of a user who canceled but is in their grace period and so on. That said, it's not really significantly different to just cancel at period end and also record that data to the user's subscription. You should have both the period end timestamp to record and the subscription could be marked as canceled too. The only adjustment is to make sure that subscriptions in the grace period are still considered active.


Thanks Chris, webhooks were indeed the answer.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.