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

Updates to credit memos feature #360

Merged
merged 1 commit into from
Feb 20, 2018
Merged

Updates to credit memos feature #360

merged 1 commit into from
Feb 20, 2018

Conversation

bhelx
Copy link
Contributor

@bhelx bhelx commented Feb 16, 2018

This contains 2 breaking changes:

1. Invoice#mark_failed now returns InvoiceCollection

mark_failed no longer reloads the invoice with the response returning true or false, it returns either an InvoiceCollection if failable and request is successful, it returns false if invoice cannot be marked failed. To keep functionality, take the charge_invoice of the returned collection:

invoice = Recurly::Invoice.find('1001')

failed_collection = invoice.mark_failed
if failed_collection
  invoice = failed_collection.charge_invoice
end

2. Subscription previews and InvoiceCollection

Subscription previews and preview changes now return InvoiceCollections rather than Invoice. Utilize the charge_invoice to keep functionality the same:

subscription.preview

# Change
invoice = subscription.invoice
# To
invoice = subscription.invoice_collection.charge_invoice

@bhelx bhelx requested a review from csmb February 16, 2018 19:06
Copy link
Contributor

@csmb csmb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@csmb csmb merged commit 6fd61da into master Feb 20, 2018
@csmb csmb deleted the credit_memos_updates branch February 20, 2018 19:25
@bhelx bhelx mentioned this pull request Feb 20, 2018
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants