Skip to content

Commit

Permalink
[BU000003QQC68W] v0.11.0
Browse files Browse the repository at this point in the history
- Add `payout_type` to `Payout` resource
- Update documentation'
  • Loading branch information
Crankshaft Robot authored and Jacob Pargin committed Mar 27, 2017
1 parent 6d56cc4 commit 2975ff7
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 44 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

A PHP client for interacting with the GoCardless Pro API.

[![PHP version](https://badge.fury.io/ph/gocardless%2Fgocardless-pro.svg)](https://badge.fury.io/ph/gocardless%2Fgocardless-pro)
[![CircleCI](https://circleci.com/gh/gocardless/gocardless-pro-php.svg?style=shield)](https://circleci.com/gh/gocardless/gocardless-pro-php)


- ["Getting started" guide](https://developer.gocardless.com/getting-started/api/introduction/?lang=php) with copy and paste PHP code samples
- [API Reference](https://developer.gocardless.com/api-reference)
- [Composer Package](https://packagist.org/packages/gocardless/gocardless-pro)
Expand Down Expand Up @@ -123,7 +127,7 @@ $client->customers()->update($customer_id, [
If you wish to take advantage of [idempotency](https://developer.gocardless.com/pro/2015-07-06/#making-requests-idempotency-keys)
in your requests, you can do so by passing an idempotency header. For example:

```
```php
$client->customers()->create([
'params' => ["given_name" => "Pete", "family_name" => "Hamilton"]
"headers" => ["Idempotency-Key" => "ABC123"]
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gocardless/gocardless-pro",
"description": "GoCardless Pro PHP Client Library",
"version": "0.10.1",
"version": "0.11.0",
"keywords": [
"gocardless",
"direct debit",
Expand Down
2 changes: 1 addition & 1 deletion lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private function getUserAgent()
{
$curlinfo = curl_version();
$uagent = array();
$uagent[] = 'gocardless-pro/0.10.1';
$uagent[] = 'gocardless-pro/0.11.0';
$uagent[] = 'schema-version/2015-07-06';
$uagent[] = 'GuzzleHttp/' . \GuzzleHttp\Client::VERSION;
$uagent[] = 'php/' . phpversion();
Expand Down
4 changes: 2 additions & 2 deletions lib/Resources/CreditorBankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class CreditorBankAccount extends BaseResource
/**
* Name of the account holder, as known by the bank. Usually this is the
* same as the name stored with the linked
* [creditor](#whitelabel-partner-endpoints-creditors). This field will be
* transliterated, upcased and truncated to 18 characters.
* [creditor](#core-endpoints-creditors). This field will be transliterated,
* upcased and truncated to 18 characters.
*/
protected $account_holder_name;

Expand Down
6 changes: 6 additions & 0 deletions lib/Resources/Payout.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @property-read $deducted_fees
* @property-read $id
* @property-read $links
* @property-read $payout_type
* @property-read $reference
* @property-read $status
*/
Expand Down Expand Up @@ -82,6 +83,11 @@ class Payout extends BaseResource
*/
protected $links;

/**
* Whether a payout contains merchant revenue or partner fees.
*/
protected $payout_type;

/**
* Reference which appears on the creditor's bank statement.
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/PayoutsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function testPayoutsList()
$this->assertEquals($body[$num]->deducted_fees, $record->deducted_fees);
$this->assertEquals($body[$num]->id, $record->id);
$this->assertEquals($body[$num]->links, $record->links);
$this->assertEquals($body[$num]->payout_type, $record->payout_type);
$this->assertEquals($body[$num]->reference, $record->reference);
$this->assertEquals($body[$num]->status, $record->status);

Expand All @@ -67,6 +68,7 @@ public function testPayoutsGet()
$this->assertEquals($body->deducted_fees, $response->deducted_fees);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->payout_type, $response->payout_type);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->status, $response->status);

Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/creditor_bank_accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"method": "POST",
"path_template": "/creditor_bank_accounts",
"url_params": {},
"body": {"creditor_bank_accounts":{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":null,"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}}
"body": {"creditor_bank_accounts":{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}}
},
"list": {
"method": "GET",
"path_template": "/creditor_bank_accounts",
"url_params": {},
"body": {"creditor_bank_accounts":[{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}},{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}],"meta":{"cursors":{"after":"example after 1515","before":"example before 1351"},"limit":50}}
"body": {"creditor_bank_accounts":[{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":null,"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}},{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}],"meta":{"cursors":{"after":"example after 7425","before":"example before 1598"},"limit":50}}
},
"get": {
"method": "GET",
Expand All @@ -21,7 +21,7 @@
"method": "POST",
"path_template": "/creditor_bank_accounts/:identity/actions/disable",
"url_params": {"identity": "BA123"},
"body": {"creditor_bank_accounts":{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}}
"body": {"creditor_bank_accounts":{"account_holder_name":"Nude Wines","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":null,"created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}}
}
}

8 changes: 4 additions & 4 deletions tests/fixtures/creditors.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"method": "POST",
"path_template": "/creditors",
"url_params": {},
"body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":null,"city":null,"country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":"example region 2081","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":null,"can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 4728","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 1211","region":"Greater London","scheme":"autogiro"}]}}
"body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 2081","city":null,"country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":null,"default_gbp_payout_account":"BA123","default_sek_payout_account":null},"logo_url":null,"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null,"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 3274","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 1445","region":"Greater London","scheme":"bacs"}]}}
},
"list": {
"method": "GET",
"path_template": "/creditors",
"url_params": {},
"body": {"creditors":[{"address_line1":null,"address_line2":"Islington","address_line3":"example address_line3 6831","city":null,"country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":null,"default_gbp_payout_account":null,"default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":"example region 8287","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 1485","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 631","region":"Greater London","scheme":"bacs"}]},{"address_line1":"338-346 Goswell Road","address_line2":null,"address_line3":"example address_line3 2888","city":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":null,"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 4324","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 1957","region":null,"scheme":"sepa_core"}]}],"meta":{"cursors":{"after":"example after 5466","before":"example before 495"},"limit":50}}
"body": {"creditors":[{"address_line1":null,"address_line2":"Islington","address_line3":"example address_line3 5466","city":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":null,"default_gbp_payout_account":"BA123","default_sek_payout_account":"BA789"},"logo_url":null,"name":"Nude Wines","postal_code":null,"region":"example region 6831","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":null,"address_line3":null,"can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 8047","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 2790","region":"Greater London","scheme":"sepa_core"}]},{"address_line1":null,"address_line2":null,"address_line3":"example address_line3 2888","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":"BA456","default_gbp_payout_account":null,"default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":"EC1V 7LQ","region":null,"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":null,"address_line3":null,"can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 1353","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 4324","region":"Greater London","scheme":"sepa_core"}]}],"meta":{"cursors":{"after":"example after 9703","before":"example before 4538"},"limit":50}}
},
"get": {
"method": "GET",
"path_template": "/creditors/:identity",
"url_params": {"identity": "CR123"},
"body": {"creditors":{"address_line1":null,"address_line2":null,"address_line3":"example address_line3 9002","city":"London","country_code":null,"created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":null,"default_gbp_payout_account":"BA123","default_sek_payout_account":null},"logo_url":null,"name":"Nude Wines","postal_code":null,"region":"example region 2451","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":null,"address_line3":null,"can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 2605","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 8266","region":null,"scheme":"autogiro"}]}}
"body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":null,"city":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":"BA456","default_gbp_payout_account":null,"default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":null,"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":null,"can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 5746","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 4783","region":null,"scheme":"bacs"}]}}
},
"update": {
"method": "PUT",
"path_template": "/creditors/:identity",
"url_params": {"identity": "CR123"},
"body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":null,"city":null,"country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":null,"default_gbp_payout_account":"BA123","default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":null,"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":null,"address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 953","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 6420","region":null,"scheme":"sepa_core"}]}}
"body": {"creditors":{"address_line1":null,"address_line2":null,"address_line3":null,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":null,"default_gbp_payout_account":null,"default_sek_payout_account":"BA789"},"logo_url":null,"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null,"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":null,"address_line3":null,"can_specify_mandate_reference":false,"city":"London","country_code":"GB","currency":"GBP","email":"[email protected]","minimum_advance_notice":3,"name":"example name 59","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 9241","region":"Greater London","scheme":"sepa_core"}]}}
}
}

10 changes: 5 additions & 5 deletions tests/fixtures/customer_bank_accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
"method": "POST",
"path_template": "/customer_bank_accounts",
"url_params": {},
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 3162"},"metadata":{}}}
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 4535"},"metadata":{}}}
},
"list": {
"method": "GET",
"path_template": "/customer_bank_accounts",
"url_params": {},
"body": {"customer_bank_accounts":[{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 9371"},"metadata":{}},{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 3430"},"metadata":{}}],"meta":{"cursors":{"after":"example after 4415","before":"example before 4657"},"limit":50}}
"body": {"customer_bank_accounts":[{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 4904"},"metadata":{}},{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 4415"},"metadata":{}}],"meta":{"cursors":{"after":"example after 3039","before":"example before 9371"},"limit":50}}
},
"get": {
"method": "GET",
"path_template": "/customer_bank_accounts/:identity",
"url_params": {"identity": "BA123"},
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 9700"},"metadata":{}}}
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 9513"},"metadata":{}}}
},
"update": {
"method": "PUT",
"path_template": "/customer_bank_accounts/:identity",
"url_params": {"identity": "BA123"},
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 783"},"metadata":{}}}
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 9700"},"metadata":{}}}
},
"disable": {
"method": "POST",
"path_template": "/customer_bank_accounts/:identity/actions/disable",
"url_params": {"identity": "BA123"},
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 870"},"metadata":{}}}
"body": {"customer_bank_accounts":{"account_holder_name":"Billy Jean","account_number_ending":"11","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 783"},"metadata":{}}}
}
}

Loading

0 comments on commit 2975ff7

Please sign in to comment.