Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Subscription Override Endpoint #162

Open
blakeprudhomme opened this issue Nov 15, 2017 · 2 comments
Open

Subscription Override Endpoint #162

blakeprudhomme opened this issue Nov 15, 2017 · 2 comments

Comments

@blakeprudhomme
Copy link
Contributor

API Reference
https://reference.chargify.com/v1/subscriptions-override

Preferably with a method on the subscription object:

subscription.override(
  canceled_at: "2000-12-31",
  cancellation_message: "Original cancellation in 2000",
)
@denisahearn
Copy link
Contributor

@blakeprudhomme I needed this too, and was able to achieve it by using built-in behavior in Rails ActiveResource. Just add the following code to your Chargify initializer.

# config/initializers/chargify.rb
module Chargify
  class Subscription < Base
    def override(fields)
      put(:override, subscription: fields)
    end
  end
end

Then you can use this new override method as you intended:

subscription = Chargify::Subscription.find('1234567')
subscription.override(activated_at: '2018-05-25')

Denis

@blakeprudhomme
Copy link
Contributor Author

@denisahearn Thanks for this work around!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants