chargify / chargify_api_ares

A Chargify API wrapper for Ruby using ActiveResource
http://chargify.com
MIT License
161 stars 95 forks source link

No way to issue delayed cancellation #73

Closed mwalsher closed 10 years ago

mwalsher commented 10 years ago

It appears the API supports delayed cancellations (http://docs.chargify.com/api-subscriptions#api-usage-json-subscriptions-delayed-cancel), but unless I'm mistaken, there is no way to do this with the gem's cancel functionality.

This is an issue because if a customer decides to reactivate their account before the end of their last paid billing cycle, they will be charged a full payment upon reactivation even though they've already paid for that month.

mwalsher commented 10 years ago

Omit this issue – I found a way to perform a delayed cancellation.

If anyone else is wondering, you can just do this:

subscription.cancel_at_end_of_period = true
subscription.save

And to undo:

subscription.cancel_at_end_of_period = false
subscription.save