Skip to content
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

Add retry method to subscription #155

Merged
merged 2 commits into from
May 12, 2017
Merged

Add retry method to subscription #155

merged 2 commits into from
May 12, 2017

Conversation

wsmoak
Copy link
Contributor

@wsmoak wsmoak commented May 12, 2017

Adds the ability to retry a past-due subscription as shown in https://reference.chargify.com/v1/subscriptions/retry-subscription

As suggested by @gotchahn in #145

A remote test for this is problematic because there is no way to programmatically put a subscription into the past_due state. It must go through an assessment and fail before it will transition to past_due.

@wsmoak
Copy link
Contributor Author

wsmoak commented May 12, 2017

Tested locally:

sub = Chargify::Subscription.find 17735426
sub.retry
puts sub.errors.messages

=> {:base=>["No credit card was on file for the $10.00 balance"]}

(which is correct for this subscription.)

@mwhagedorn
Copy link
Contributor

:shipit:

@wsmoak wsmoak merged commit 20adb4d into master May 12, 2017
@wsmoak wsmoak deleted the retry branch May 12, 2017 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants