-
Notifications
You must be signed in to change notification settings - Fork 93
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
API Version 2.10 #339
API Version 2.10 #339
Conversation
lib/recurly/adjustment.php
Outdated
@@ -25,6 +25,7 @@ | |||
* @property mixed[] $tax_details The nested address information of the adjustment: name, type, tax_rate, tax_in_cents. | |||
* @property string $tax_code Optional field for EU VAT merchants and Avalara AvaTax Pro merchants. If you are using Recurly's EU VAT feature, you can use values of unknown, physical, or digital. If you have your own AvaTax account configured, you can use Avalara tax codes to assign custom tax rules. | |||
* @property string $product_code Merchant defined product code | |||
* @property string $credit_reason_code Can be set on POST if adjustment is a credit (unit_amount_in_cents < 0). Allowed values: [general, service, promotional, refund, gift_card, write_off]. Defaults to "general". |
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.
Nit but: Should we mention POST here? Seems like this should refer to create? Although I think all we allow is create so maybe just "Can be set if adjustment is a credit..."
</transactions> | ||
</charge_invoice> | ||
<credit_invoices type="array"> | ||
<invoice> |
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.
The XML we're returning is actually <credit_invoice href="">
@@ -198,7 +198,11 @@ public function getLinks() { | |||
'billing_info' => 'Recurly_BillingInfo', | |||
'coupon' => 'Recurly_Coupon', | |||
'unique_coupon_codes' => 'Recurly_UniqueCouponCodeList', | |||
'charge_invoice' => 'Recurly_Invoice', |
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.
Also need to have:
'credit_invoice' => 'Recurly_Invoice',
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.
Looked good locally.
API 2.10 changes.
Upgrade Notes
There are several breaking changes to support the new credit memos feature.
1. InvoiceCollection
When creating invoices or using
markFailed()
, we now return anRecurly_InvoiceCollection
object rather than anRecurly_Invoice
. If you wish to upgrade your application without changing functionality, we recommend that you use thecharge_invoice
on theRecurly_InvoiceCollection
. Example:Calls that now return
InvoiceCollection
instead ofInvoice
:Recurly_Purchase::invoice()
Recurly_Purchase::preview()
Recurly_Purchase::authorize()
Recurly_Invoice::invoicePendingCharges()
Recurly_Invoice::previewPendingCharges()
Furthermore,
Recurly_Invoice->markFailed()
no longer updates the invoice but rather returns a newRecurly_InvoiceCollection
object:2. Recurly_Invoice->original_invoice removed
Recurly_Invoice->original_invoice
was removed in favor ofRecurly_Invoice->original_invoices
. If you want to maintain functionality, change your code grab the first invoice from that endpoint:3. Invoice
subtotal_*
changesWe have renamed two of the invoice subtotal fields to more clearly reflect their values:
subtotal_in_cents
tosubtotal_before_discount_in_cents
subtotal_after_discount_in_cents
tosubtotal_in_cents
4. Invoice Refund --
refund_apply_order
changed torefund_method
If you were using
Recurly_Invoice->refund
orRecurly_Invoice->refundAmount
and explicitly setting the secondrefund_apply_order
parameter, then you may need to change value to fit the newrefund_method
format. The values for this have changed from (credit
,transaction
) to (credit_first
,transaction_first
)If you don't explicitly set the
refund_apply_order
like in these two calls, no change is needed:If you do set the second param, you'll need to change:
credit
tocredit_first
transaction
totransaction_first
Examples:
5. Invoice States
If you are checking
Recurly_Invoice->state
anywhere, you will want to check that you have the new correct values.collected
has changed topaid
andopen
has changed topending
. Example:This also affects the
Recurly_InvoiceList::getCollected()
andRecurly_InvoiceList::getOpen()
functions. Example: