Skip to content

Releases: recurly/recurly-client-php

Version 2.10.1

04 Apr 21:30
43aeb90
Compare
Choose a tag to compare

This release will upgrade us to API version 2.11. There are no breaking changes.

  • API Version 2.11 #342

Version 2.10.0

19 Mar 23:26
ef41ec4
Compare
Choose a tag to compare

This release will upgrade us to API version 2.10.

  • API Version 2.10 #339
  • Add missing writeable fields to AddOn #338
  • Removes links to singular subscription (thanks to @phpdave) #340

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 an Recurly_InvoiceCollection object rather than an Recurly_Invoice. If you wish to upgrade your application without changing functionality, we recommend that you use the charge_invoice on the Recurly_InvoiceCollection. Example:

# Change This:
$invoice = Recurly_Invoice::invoicePendingCharges('my_account_code');

# To this
$invoiceCollection = Recurly_Invoice::invoicePendingCharges('my_account_code');
$invoice = $invoiceCollection->charge_invoice;

Calls that now return InvoiceCollection instead of Invoice:

  • 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 new Recurly_InvoiceCollection object:

# Change This:
$invoice->markFailed();

# To this
$invoiceCollection = $invoice->markFailed();
$failedInvoice = $invoiceCollection->charge_invoice;

2. Recurly_Invoice->original_invoice removed

Recurly_Invoice->original_invoice was removed in favor of Recurly_Invoice->original_invoices. If you want to maintain functionality, change your code grab the first invoice from that endpoint:

# Change this
$originalInvoice = $invoice->original_invoice->get();

# To this
$originalInvoice = $invoice->original_invoices->get()->current(); # current is first item

3. Invoice subtotal_* changes

We have renamed two of the invoice subtotal fields to more clearly reflect their values:

  • Renamed subtotal_in_cents to subtotal_before_discount_in_cents
  • Renamed subtotal_after_discount_in_cents to subtotal_in_cents

4. Invoice Refund -- refund_apply_order changed to refund_method

If you were using Recurly_Invoice->refund or Recurly_Invoice->refundAmount and explicitly setting the second refund_apply_order parameter, then you may need to change value to fit the new refund_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:

$invoice->refund($line_items);
$invoice->refundAmount(1000);

If you do set the second param, you'll need to change:

  • credit to credit_first
  • transaction to transaction_first

Examples:

# Change `credit`:
$invoice->refund($line_items, 'credit');
$invoice->refundAmount(1000, 'credit');

# To `credit_first`
$invoice->refund($line_items, 'credit_first');
$invoice->refundAmount(1000, 'credit_first');

# Change `transaction`
$invoice->refund($line_items, 'transaction');
$invoice->refundAmount(1000, 'transaction');

# To `transaction_first`
$invoice->refund($line_items, 'transaction_first');
$invoice->refundAmount(1000, 'transaction_first');

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 to paid and open has changed to pending. Example:

# Change this
if ($invoice->state == 'collected')
# To this
if ($invoice->state == 'paid')
# Change this
if ($invoice->state == 'open')
# To this
if ($invoice->state == 'pending')

This also affects the Recurly_InvoiceList::getCollected() and Recurly_InvoiceList::getOpen() functions. Example:

# Change this
Recurly_InvoiceList::getCollected()
# To this
Recurly_InvoiceList::getPaid()
# Change this
Recurly_InvoiceList::getOpen()
# To this
Recurly_InvoiceList::getPending()

6. Deprecated Recurly_Invoice->subscription and Recurly_Transaction->subscription removed

If you are using Recurly_Invoice->subscription or Recurly_Transaction->subscription anywhere, you will now need to call subscriptions instead and take the first one.

# Change this
$subscription = $invoice->subscription->get();
# To this
$subscription = $invoice->subscriptions->get()->current();

# Or this
$subscription = $transaction->subscription->get();
# To this
$subscription = $transaction->subscriptions->get()->current();

Version 2.9.0

06 Oct 17:37
Compare
Choose a tag to compare

This release will upgrade us to API version 2.8.

  • Added custom invoice notes to Purchase #332
  • Added imported_trial boolean field to Subscription #331

Upgrade Notes

There are two breaking changes in this API version you must consider.

Country Codes

All country fields must now contain valid 2 letter ISO 3166 country codes. If your country code fails validation, you will receive a validation error. This affects any endpoint where an address is collected.

Purchase Currency

The purchases endpoint can create and invoice multiple adjustments at once but our invoices can only contain items in one currency. To make this explicit the currency can no longer be provided on an adjustment, it must be set once for the entire purchase:

$purchase = new Recurly_Purchase();
# The purchase object is the only place you can set the currency:
$purchase->currency = 'USD';
$purchase->account = new Recurly_Account();
$purchase->account->account_code = 'someone';

$adjustment = new Recurly_Adjustment();
# You can no longer set a currency on an adjustment, so this should be removed:
$adjustment->currency = 'USD';
$adjustment->unit_amount_in_cents = 1000;
$purchase->adjustments[] = $adjustment;

Version 2.8.2

21 Jul 20:15
Compare
Choose a tag to compare
  • Fixes a bug creating subscriptions for existing accounts (thanks to @g30rg) #326

Version 2.8.1

14 Jul 17:10
Compare
Choose a tag to compare

This bumps us to API v2.7 but does not contain any breaking changes.

  • Bump API v2.7 (purchase endpoint updates) #319
  • Enhancement: Enable IntelliSense (IDE friendly) for class properties (Part 2) Invoice and Subscription (thanks to @phpdave) #279

Version 2.8.0

07 Jun 20:23
Compare
Choose a tag to compare

This is the official release of 2.8.0. This will bring us to version 2.6 of the Recurly API.

  • Remove 5.3 Support and upgrade Travis to support HHVM #316
  • Purchases endpoint #315
  • Remove X-Records header #314
  • Add trial requires billing info field and no billing info reason field #312

Upgrade Notes

If you are upgrading from 2.8.0.rc1, there are no changes. If you are upgrading from <= 2.7.X, there are a few breaking changes this release:

  1. PHP 5.3 is no longer officially supported and we no longer run tests against it.
  2. To speed up your listing requests we're no longer automatically computing the record counts for each request's X-Records header. For our larger sites this could halve the response time. If you still need a count it will be computed with a separate request.
    From now on, when you call Recurly_Pager::count(), it will send a HEAD request to the server. Ensure you aren't calling that method in places where you expect the value
    to be cached for you. For more information on how this may affect you, see PR #314
  3. For POST /v2/subscriptions Sending null for total_billing_cycles attribute will now override plan total_billing_cycles setting and will make subscription renew forever.
    Omitting the attribute will cause the setting to default to the value of plan total_billing_cycles.

Version 2.8.0.rc1

02 Jun 22:51
Compare
Choose a tag to compare
Version 2.8.0.rc1 Pre-release
Pre-release

This is a release candidate for 2.8.0. Because of the breaking changes, we have decided to release this slowly. This will bring us to version 2.6 of the Recurly API.

  • Remove 5.3 Support and upgrade Travis to support HHVM #316
  • Purchases endpoint #315
  • Remove X-Records header #314
  • Add trial requires billing info field and no billing info reason field #312

Upgrade Notes

There are a few breaking changes this release.

  1. PHP 5.3 is no longer officially supported and we no longer run tests against it.
  2. To speed up your listing requests we're no longer automatically computing the record counts for each request's X-Records header. For our larger sites this could halve the response time. If you still need a count it will be computed with a separate request.
    From now on, when you call Recurly_Pager::count(), it will send a HEAD request to the server. Ensure you aren't calling that method in places where you expect the value
    to be cached for you. For more information on how this may affect you, see PR #314
  3. For POST /v2/subscriptions Sending null for total_billing_cycles attribute will now override plan total_billing_cycles setting and will make subscription renew forever.
    Omitting the attribute will cause the setting to default to the value of plan total_billing_cycles.

Version 2.7.2

21 Mar 18:47
Compare
Choose a tag to compare
  • Require export files #296
  • Writeable and updatable coupon description #297
  • Adds a getType method to all Resources #299
  • The Pager should implement the Countable interface (thanks to naderman) #282
  • Parse incorrectly shaped validation errors #298
  • Adds external payments to invoices #309
  • GiftCard: deliver_at goes on the Delivery object #307
  • Changes for API v2.5 #310

Version 2.7.1

09 Jan 23:03
Compare
Choose a tag to compare
  • Added property documentation to several classes (thanks to phpdave) #278
  • Added company attribute to billing info #280
  • Fixed add-on creation bug #286
  • Create shipping addresses on existing accounts and allow updates #289
  • Adding ability to get Recurly error code from Recurly_Error Exception #291

Version 2.7.0

15 Sep 18:37
Compare
Choose a tag to compare
  • Upgraded to API V2.4: https://dev.recurly.com/v2.4/docs
  • Fix for client not being passed from Recurly_Pager to its items (thanks to cyruscollier) #265
  • Adding missing require for account_balance #273
  • Allow credit adjustments (Recurly_Adjustment) to specify an origin of external_gift_card #263
  • Added Recurly_AccountAcquisition #259
  • Added support for automated exports #260
  • Added support for shipping addresses #269
  • Added filters to Recurly_Stub allowing $account->invoices->get(array('state' => 'past_due')) (thanks to developer-devPHP) #270