From 26c7da606e1ae66ba4b9f1256fdc163e6e4caf29 Mon Sep 17 00:00:00 2001 From: Joanna Sese Date: Fri, 17 Jul 2020 18:20:28 -0500 Subject: [PATCH 1/3] Bump to api client version 2.12.15, api version 2.28 --- lib/recurly/client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/recurly/client.php b/lib/recurly/client.php index a79edfc5..63fdca74 100644 --- a/lib/recurly/client.php +++ b/lib/recurly/client.php @@ -24,7 +24,7 @@ class Recurly_Client /** * API Version */ - public static $apiVersion = '2.27'; + public static $apiVersion = '2.28'; /** * The path to your CA certs. Use only if needed (if you can't fix libcurl/php). @@ -52,7 +52,7 @@ class Recurly_Client private static $apiUrl = 'https://%s.recurly.com/v2'; - const API_CLIENT_VERSION = '2.12.14'; + const API_CLIENT_VERSION = '2.12.15'; const DEFAULT_ENCODING = 'UTF-8'; const GET = 'GET'; From 5a9a66bacba0067113ebfff7ea300a06944d4467 Mon Sep 17 00:00:00 2001 From: Joanna Sese Date: Tue, 14 Jul 2020 18:23:18 -0500 Subject: [PATCH 2/3] Add BECS support --- Tests/Recurly/Billing_Info_Test.php | 8 ++++++++ Tests/fixtures/billing_info/show-becs-200.xml | 18 ++++++++++++++++++ lib/recurly/billing_info.php | 5 +++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Tests/fixtures/billing_info/show-becs-200.xml diff --git a/Tests/Recurly/Billing_Info_Test.php b/Tests/Recurly/Billing_Info_Test.php index 5696660b..f9f78f1a 100644 --- a/Tests/Recurly/Billing_Info_Test.php +++ b/Tests/Recurly/Billing_Info_Test.php @@ -11,6 +11,7 @@ function defaultResponses() { array('GET', '/accounts/bankaccount1234567890/billing_info', 'billing_info/show-bank-account-200.xml'), array('GET', '/accounts/sepa1234567890/billing_info', 'billing_info/show-sepa-200.xml'), array('GET', '/accounts/bacs1234567890/billing_info', 'billing_info/show-bacs-200.xml'), + array('GET', '/accounts/becs1234567890/billing_info', 'billing_info/show-becs-200.xml'), array('PUT', '/accounts/abcdef1234567890/billing_info', 'billing_info/show-200.xml'), array('DELETE', '/accounts/abcdef1234567890/billing_info', 'billing_info/destroy-204.xml'), array('DELETE', 'https://api.recurly.com/v2/accounts/abcdef1234567890/billing_info', 'billing_info/destroy-204.xml'), @@ -91,6 +92,13 @@ public function testGetBacsBillingInfo() { $this->assertEquals($billing_info->name_on_account, 'BACS'); } + public function testGetBecsBillingInfo() { + $billing_info = Recurly_BillingInfo::get('becs1234567890', $this->client); + $this->assertInstanceOf('Recurly_BillingInfo', $billing_info); + $this->assertEquals($billing_info->bsb_code, '082-082'); + $this->assertEquals($billing_info->name_on_account, 'BECS'); + } + public function testDelete() { $billing_info = Recurly_BillingInfo::get('abcdef1234567890', $this->client); diff --git a/Tests/fixtures/billing_info/show-becs-200.xml b/Tests/fixtures/billing_info/show-becs-200.xml new file mode 100644 index 00000000..6ec6eb4c --- /dev/null +++ b/Tests/fixtures/billing_info/show-becs-200.xml @@ -0,0 +1,18 @@ +HTTP/1.1 200 OK +Content-Type: application/xml; charset=utf-8 + + + + + + 123 Fake St. + + Adelaide + + 123456 + AU + + 082-082 + 78 + BECS + diff --git a/lib/recurly/billing_info.php b/lib/recurly/billing_info.php index b1bf6903..124d96a7 100644 --- a/lib/recurly/billing_info.php +++ b/lib/recurly/billing_info.php @@ -39,8 +39,9 @@ * @property string $card_type Visa, MasterCard, American Express, Discover, JCB, etc * @property-write string $three_d_secure_action_result_token_id An id returned by Recurly.js referencing the result of the 3DS authentication for PSD2 * @property string $iban International bank account number developed to identify an overseas bank account - * @property string $type The payment method type for a non-credit card based billing info. The value of `bacs` is the only accepted value (Bacs only) + * @property string $type The payment method type for a non-credit card based billing info. `bacs` and `becs` are the only accepted values * @property string $sort_code Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only) + * @property string $bsb_code Bank identifier code for AU based banks. Required for Becs based billing infos. */ class Recurly_BillingInfo extends Recurly_Resource { @@ -109,7 +110,7 @@ protected function getWriteableAttributes() { 'paypal_billing_agreement_id', 'amazon_billing_agreement_id', 'currency', 'token_id', 'external_hpp_type', 'gateway_token', 'gateway_code', 'braintree_payment_nonce', 'roku_billing_agreement_id', - 'three_d_secure_action_result_token_id', 'transaction_type', 'iban', 'sort_code', 'type' + 'three_d_secure_action_result_token_id', 'transaction_type', 'iban', 'sort_code', 'bsb_code', 'type' ); } } From 22b18a1f8a7d54135fceaed34eb0bedda7deed25 Mon Sep 17 00:00:00 2001 From: Joanna Sese Date: Wed, 22 Jul 2020 15:04:18 -0500 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 994e1045..b9308381 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Recurly PHP Client Library CHANGELOG +## Version 2.12.15 (July 22, 2020) + +This brings us up to API version 2.28. There are no breaking changes + +* BECS support [PR](https://github.com/recurly/recurly-client-php/pull/520) + ## Version 2.12.14 (June 30, 2020) This brings us up to API version 2.27. There are no breaking changes