From e472e41b75b3179e8ac07ff48ea874a6f875a326 Mon Sep 17 00:00:00 2001 From: Aaron Suarez Date: Mon, 19 Nov 2018 13:40:03 -0600 Subject: [PATCH 1/4] Bump to API version 2.17 --- lib/recurly/client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/recurly/client.php b/lib/recurly/client.php index 84a8a6a4..c382bad3 100644 --- a/lib/recurly/client.php +++ b/lib/recurly/client.php @@ -27,7 +27,7 @@ class Recurly_Client /** * API Version */ - public static $apiVersion = '2.16'; + public static $apiVersion = '2.17'; /** * The path to your CA certs. Use only if needed (if you can't fix libcurl/php). From 2969d11470f7d207e71c0b1b29d98f159af3853d Mon Sep 17 00:00:00 2001 From: Aaron Suarez Date: Mon, 19 Nov 2018 13:51:09 -0600 Subject: [PATCH 2/4] Add gateway_code to subscription and invoice --- Tests/Recurly/Invoice_Test.php | 3 ++- Tests/Recurly/Subscription_Test.php | 2 +- Tests/fixtures/subscriptions/show-200-changed-notes.xml | 1 + lib/recurly/invoice.php | 4 +++- lib/recurly/subscription.php | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Tests/Recurly/Invoice_Test.php b/Tests/Recurly/Invoice_Test.php index fd2d8c9b..1da19010 100644 --- a/Tests/Recurly/Invoice_Test.php +++ b/Tests/Recurly/Invoice_Test.php @@ -189,9 +189,10 @@ public function testUpdateInvoice() { $invoice->terms_and_conditions = 'Never disclose the location of the Krabby Patty secret formula.'; $invoice->vat_reverse_charge_notes = "can't be changed when invoice was not a reverse charge"; $invoice->net_terms = '60'; + $invoice->gateway_code = 'A new gateway code'; $this->assertEquals( - "\n
SpongebobSquarepantsPatrick StarKrusty Krab124 Conch StreetPineappleBikini BottomDead Eye Gulch96970Pacific Ocean509-990-3551
Never disclose the location of the Krabby Patty secret formula.Is this the Krusty Krab?can't be changed when invoice was not a reverse charge603699
\n", + "\n
SpongebobSquarepantsPatrick StarKrusty Krab124 Conch StreetPineappleBikini BottomDead Eye Gulch96970Pacific Ocean509-990-3551
Never disclose the location of the Krabby Patty secret formula.Is this the Krusty Krab?can't be changed when invoice was not a reverse charge603699A new gateway code
\n", $invoice->xml() ); $invoice->update(); diff --git a/Tests/Recurly/Subscription_Test.php b/Tests/Recurly/Subscription_Test.php index 5ed70a96..0f0be66a 100644 --- a/Tests/Recurly/Subscription_Test.php +++ b/Tests/Recurly/Subscription_Test.php @@ -238,7 +238,7 @@ public function testUpdateNotes() { $subscription = Recurly_Subscription::get('012345678901234567890123456789ab', $this->client); - $notes = array("customer_notes" => "New Customer Notes", "terms_and_condititions" => "New Terms", "vat_reverse_charge_notes" => "New VAT Notes"); + $notes = array("customer_notes" => "New Customer Notes", "terms_and_condititions" => "New Terms", "vat_reverse_charge_notes" => "New VAT Notes", "gateway_code" => "A new gateway code"); // You can also update custom fields through this endpoint $cf = $subscription->custom_fields["shasta"]; diff --git a/Tests/fixtures/subscriptions/show-200-changed-notes.xml b/Tests/fixtures/subscriptions/show-200-changed-notes.xml index 55858331..d51ce0b3 100644 --- a/Tests/fixtures/subscriptions/show-200-changed-notes.xml +++ b/Tests/fixtures/subscriptions/show-200-changed-notes.xml @@ -27,6 +27,7 @@ Content-Type: application/xml; charset=utf-8 New Terms New Customer Notes New VAT Notes + A new gateway code IP Addresses diff --git a/lib/recurly/invoice.php b/lib/recurly/invoice.php index 06e51912..e04baa97 100644 --- a/lib/recurly/invoice.php +++ b/lib/recurly/invoice.php @@ -29,6 +29,7 @@ * @property string $terms_and_conditions * @property string $vat_reverse_charge_notes * @property string $customer_notes + * @property string $gateway_code The unique identifier of a payment gateway used to specify which payment gateway you wish to process this invoices’ payments * @property string $tax_type * @property string $tax_region * @property float $tax_rate @@ -226,7 +227,8 @@ protected function getNodeName() { protected function getWriteableAttributes() { return array( 'address', 'terms_and_conditions', 'customer_notes', 'vat_reverse_charge_notes', - 'collection_method', 'net_terms', 'po_number', 'currency', 'credit_customer_notes' + 'collection_method', 'net_terms', 'po_number', 'currency', 'credit_customer_notes', + 'gateway_code' ); } diff --git a/lib/recurly/subscription.php b/lib/recurly/subscription.php index 76187d2e..095aef93 100644 --- a/lib/recurly/subscription.php +++ b/lib/recurly/subscription.php @@ -42,6 +42,7 @@ * @property Recurly_CustomFieldList $custom_fields Optional custom fields for the subscription. * @property string $uuid Subscription's unique identifier. * @property string $timeframe now for immediate, renewal to perform when the subscription renews. Defaults to now. + * @property string $gateway_code The unique identifier of a payment gateway used to specify which payment gateway you wish to process this subscriptions’ payments */ class Recurly_Subscription extends Recurly_Resource { @@ -266,7 +267,7 @@ protected function getWriteableAttributes() { 'bank_account_authorized_at', 'revenue_schedule_type', 'gift_card', 'shipping_address', 'shipping_address_id', 'imported_trial', 'remaining_pause_cycles', 'custom_fields', 'auto_renew', - 'renewal_billing_cycles' + 'renewal_billing_cycles', 'gateway_code' ); } } From 60f3ad1c08fea4892b5fb0dce86b7ff01f12b59f Mon Sep 17 00:00:00 2001 From: Aaron Suarez Date: Wed, 21 Nov 2018 12:43:26 -0600 Subject: [PATCH 3/4] Add exemption certificate attribute to Account --- Tests/Recurly/Account_Test.php | 4 +++- Tests/fixtures/accounts/show-200.xml | 1 + lib/recurly/account.php | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Tests/Recurly/Account_Test.php b/Tests/Recurly/Account_Test.php index be8f31f8..bbdf02f0 100644 --- a/Tests/Recurly/Account_Test.php +++ b/Tests/Recurly/Account_Test.php @@ -27,6 +27,7 @@ public function testGetAccount() { $this->assertEquals($account->created_at->getTimestamp(), 1304164800); $this->assertEquals($account->getHref(),'https://api.recurly.com/v2/accounts/abcdef1234567890'); $this->assertTrue($account->tax_exempt); + $this->assertEquals($account->exemption_certificate, 'Some Certificate'); $this->assertEquals($account->entity_use_code, 'I'); $this->assertEquals($account->vat_location_valid, true); $this->assertEquals($account->cc_emails, 'cheryl.hines@example.com,richard.lewis@example.com'); @@ -99,6 +100,7 @@ public function testXml() { $account->first_name = 'Verena'; $account->address->address1 = "123 Main St."; $account->tax_exempt = false; + $account->exemption_certificate = 'Some Certificate'; $account->entity_use_code = 'I'; $account->preferred_locale = 'en-US'; @@ -143,7 +145,7 @@ public function testXml() { $account->custom_fields[] = new Recurly_CustomField("serial_number", "4567-8900-1234"); $this->assertEquals( - "\nact123Verena
123 Main St.
falseI123 Main St.San FranciscoCA94110US555-555-5555verena@example.comWorkVerenaExampleRecurly Inc.123 Dolores St.San FranciscoCA94110US555-555-5555verena@example.comHomeVerenaExampleen-USserial_number4567-8900-1234599USDmarketing_contentpickle sticks blog postmailchimp67a904de95.0914d8f4b4
\n", + "\nact123Verena
123 Main St.
falseI123 Main St.San FranciscoCA94110US555-555-5555verena@example.comWorkVerenaExampleRecurly Inc.123 Dolores St.San FranciscoCA94110US555-555-5555verena@example.comHomeVerenaExampleen-USserial_number4567-8900-1234599USDmarketing_contentpickle sticks blog postmailchimp67a904de95.0914d8f4b4Some Certificate
\n", $account->xml() ); } diff --git a/Tests/fixtures/accounts/show-200.xml b/Tests/fixtures/accounts/show-200.xml index 0c40fc94..c1afeda4 100644 --- a/Tests/fixtures/accounts/show-200.xml +++ b/Tests/fixtures/accounts/show-200.xml @@ -18,6 +18,7 @@ Content-Type: application/xml; charset=utf-8 ST-1937 I true + Some Certificate en-US
123 Main St. diff --git a/lib/recurly/account.php b/lib/recurly/account.php index 4e030174..0763b283 100644 --- a/lib/recurly/account.php +++ b/lib/recurly/account.php @@ -19,6 +19,7 @@ * @property string $company_name The company name of the account. * @property string $vat_number The VAT number of the account (to avoid having the VAT applied). * @property boolean $tax_exempt The tax status of the account. true exempts tax on the account, false applies tax on the account. + * @property string $exemption_certificate Optional field for merchants taxing through Vertex. A string representing the exemption certificate. 1-30 characters in length. * @property Recurly_Address $address The nested address information of the account: address1, address2, city, state, zip, country, phone. * @property string $accept_language The ISO 639-1 language code from the user's browser, indicating their preferred language and locale. * @property string $hosted_login_token The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: https://:subdomain.recurly.com/account/:hosted_login_token. @@ -105,7 +106,7 @@ protected function getWriteableAttributes() { 'account_code', 'username', 'first_name', 'last_name', 'vat_number', 'email', 'company_name', 'accept_language', 'billing_info', 'address', 'tax_exempt', 'entity_use_code', 'cc_emails', 'shipping_addresses', - 'preferred_locale', 'custom_fields', 'account_acquisition' + 'preferred_locale', 'custom_fields', 'account_acquisition', 'exemption_certificate' ); } protected function getRequiredAttributes() { From 0e059275c9a2c1ec2070b49542ab930571dcc220 Mon Sep 17 00:00:00 2001 From: Aaron Suarez Date: Tue, 11 Dec 2018 14:32:54 -0600 Subject: [PATCH 4/4] Bump version 2.11.0 with changelog and readme --- CHANGELOG.md | 15 ++++++++++----- README.md | 6 +++--- lib/recurly/client.php | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b395cb99..a09f5bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,17 @@ # Recurly PHP Client Library CHANGELOG -## Unreleased -* Remove Recurly.js v2 code +## Version 2.11.0 (December 11th, 2018) -### Upgrade Notes +This release will upgrade us to API version 2.17. + +* Add `gateway_code` to Subscription and Invoice objects [PR](https://github.com/recurly/recurly-client-php/pull/380) +* Add `exemption_certificate` to Account object [PR](https://github.com/recurly/recurly-client-php/pull/381) +* Remove deprecated JS module [PR](https://github.com/recurly/recurly-client-php/pull/382) +* Add `getHeaders()` method [PR](https://github.com/recurly/recurly-client-php/pull/383) +* Add OpenSSL version to user agent [PR](https://github.com/recurly/recurly-client-php/pull/384) -This release contains the following breaking changes: -- Older Recurly.js token signing is not longer supported. You should upgrade to version 4 of Recurly.js: https://dev.recurly.com/docs/recurlyjs +### Upgrade Notes +This release contains one breaking change. Older Recurly.js token signing is not longer supported. You should upgrade to version 4 of Recurly.js: https://dev.recurly.com/docs/recurlyjs ## Version 2.10.6 (October 30th, 2018) diff --git a/README.md b/README.md index 3cba9300..71deff67 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ section, there's a line that says something like: libcurl/7.19.5 OpenSSL/1.0.1g zlib/1.2.3.3 libidn/1.15 ``` -Please ensure that your OpenSSL version supports TLS v1.1 or higher. At a minimum use v1.0.1g, however we recommend v1.1.0 and up. +Please ensure that your OpenSSL version supports TLS v1.2 or higher. ### Timezone You will need to specify your server's timezone before using the Recurly PHP client. This is necessary for the library to properly handle datetime conversions. You can do this in your `php.ini` file: @@ -43,12 +43,12 @@ date_default_timezone_set('America/Los_Angeles'); If you're using [Composer](http://getcomposer.org/), you can simply add a dependency on `recurly/recurly-client` to your project's `composer.json` file. -Here's an example of a dependency on 2.10: +Here's an example of a dependency on 2.11: ```json { "require": { - "recurly/recurly-client": "2.10.*" + "recurly/recurly-client": "2.11.*" } } ``` diff --git a/lib/recurly/client.php b/lib/recurly/client.php index c382bad3..0c292da4 100644 --- a/lib/recurly/client.php +++ b/lib/recurly/client.php @@ -44,7 +44,7 @@ class Recurly_Client */ private $_acceptLanguage = 'en-US'; - const API_CLIENT_VERSION = '2.10.6'; + const API_CLIENT_VERSION = '2.11.0'; const DEFAULT_ENCODING = 'UTF-8'; const GET = 'GET';