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

Release 2.12.15 #523

Merged
merged 5 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions Tests/Recurly/Billing_Info_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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);

Expand Down
18 changes: 18 additions & 0 deletions Tests/fixtures/billing_info/show-becs-200.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="https://api.recurly.com/v2/accounts/becs1234567890/billing_info" type="becs">
<account href="https://api.recurly.com/v2/accounts/becs1234567890"/>
<company nil="nil"></company>
<address1>123 Fake St.</address1>
<address2 nil="nil"></address2>
<city>Adelaide</city>
<state></state>
<zip>123456</zip>
<country>AU</country>
<phone nil="nil"></phone>
<bsb_code>082-082</bsb_code>
<last_two>78</last_two>
<name_on_account>BECS</name_on_account>
</billing_info>
5 changes: 3 additions & 2 deletions lib/recurly/billing_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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'
);
}
}
4 changes: 2 additions & 2 deletions lib/recurly/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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';
Expand Down