-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow cancellation at end of billing period #141
base: master
Are you sure you want to change the base?
Conversation
LGTM |
+1 @andrewculver - Is this ready to be merged? |
@@ -48,7 +48,7 @@ def processing! | |||
self.current_price = nil | |||
|
|||
# delete the subscription. | |||
customer.cancel_subscription | |||
customer.cancel_subscription(cancel_at_period_end ? {at_period_end: true} : {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to have spaces inside the brackets { at_period_end: true }
.
@mediavrog Hey, sorry for the delay getting back to you on this! I see the plumbing for actually setting the flag on Stripe, but how were you keeping track of the "still active" status of the subscription in the app? Off the top of my head, even if you send this flag to Stripe, the Rails app will still see the subscription as being canceled. Am I missing something? |
Per https://stripe.com/docs/billing/subscriptions/cancel#events. This PR looks safe to me since it will go through |
see https://stripe.com/docs/subscriptions#canceling-a-customers-subscriptions
usage example:
subscription.rb