Ask A Question

Notifications

You’re not receiving notifications from this thread.

Stripe - Question about canceling accounts

Adrian DeGus asked in Rails

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?

Reply

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.

Reply

Thanks Chris, webhooks were indeed the answer.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.