Skip to content

Commit

Permalink
Crankshaft[BU000003FZ9Q8R] Client - PHP @ 2017-02-17 18:33:38 +0000
Browse files Browse the repository at this point in the history
  • Loading branch information
Crankshaft Robot committed Feb 17, 2017
1 parent a87e13d commit d180e3c
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 46 deletions.
8 changes: 0 additions & 8 deletions lib/Resources/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* attributes
*
* @property-read $amount
* @property-read $count
* @property-read $created_at
* @property-read $currency
* @property-read $day_of_month
Expand All @@ -38,13 +37,6 @@ class Subscription extends BaseResource
*/
protected $amount;

/**
* An alternative way to set `end_date`. The total number of payments that
* should be taken by this subscription. This will set `end_date`
* automatically.
*/
protected $count;

/**
* Fixed [timestamp](#api-usage-time-zones--dates), recording when this
* resource was created.
Expand Down
5 changes: 0 additions & 5 deletions tests/Integration/SubscriptionsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function testSubscriptionsCreate()
$this->assertInstanceOf('\GoCardlessPro\Resources\Subscription', $response);

$this->assertEquals($body->amount, $response->amount);
$this->assertEquals($body->count, $response->count);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->day_of_month, $response->day_of_month);
Expand Down Expand Up @@ -68,7 +67,6 @@ public function testSubscriptionsList()
foreach (range(0, count($body) - 1) as $num) {
$record = $records[$num];
$this->assertEquals($body[$num]->amount, $record->amount);
$this->assertEquals($body[$num]->count, $record->count);
$this->assertEquals($body[$num]->created_at, $record->created_at);
$this->assertEquals($body[$num]->currency, $record->currency);
$this->assertEquals($body[$num]->day_of_month, $record->day_of_month);
Expand Down Expand Up @@ -101,7 +99,6 @@ public function testSubscriptionsGet()
$this->assertInstanceOf('\GoCardlessPro\Resources\Subscription', $response);

$this->assertEquals($body->amount, $response->amount);
$this->assertEquals($body->count, $response->count);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->day_of_month, $response->day_of_month);
Expand Down Expand Up @@ -133,7 +130,6 @@ public function testSubscriptionsUpdate()
$this->assertInstanceOf('\GoCardlessPro\Resources\Subscription', $response);

$this->assertEquals($body->amount, $response->amount);
$this->assertEquals($body->count, $response->count);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->day_of_month, $response->day_of_month);
Expand Down Expand Up @@ -165,7 +161,6 @@ public function testSubscriptionsCancel()
$this->assertInstanceOf('\GoCardlessPro\Resources\Subscription', $response);

$this->assertEquals($body->amount, $response->amount);
$this->assertEquals($body->count, $response->count);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->day_of_month, $response->day_of_month);
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/creditor_bank_accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"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":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}}
"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":null,"created_at":"2014-01-01T12:00:00.000Z","currency":null,"enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}],"meta":{"cursors":{"after":"example after 2205","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":null,"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":"GB","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":"London","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":"EC1V 7LQ","region":"example region 3237","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 4728","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 8162","region":null,"scheme":"autogiro"}]}}
"body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 456","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":"EC1V 7LQ","region":"example region 2081","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 8511","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 694","region":"Greater London","scheme":"sepa_core"}]}}
},
"list": {
"method": "GET",
"path_template": "/creditors",
"url_params": {},
"body": {"creditors":[{"address_line1":null,"address_line2":"Islington","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":"BA123","default_sek_payout_account":"BA789"},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":"example region 1528","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 3015","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 7387","region":null,"scheme":"sepa_core"}]},{"address_line1":"338-346 Goswell Road","address_line2":null,"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 3000","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 563","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 4147","region":null,"scheme":"sepa_core"}]}],"meta":{"cursors":{"after":"example after 2888","before":"example before 4538"},"limit":50}}
"body": {"creditors":[{"address_line1":null,"address_line2":"Islington","address_line3":"example address_line3 1528","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":null,"default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":"example region 9947","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 5541","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 6831","region":"Greater London","scheme":"bacs"}]},{"address_line1":"338-346 Goswell Road","address_line2":null,"address_line3":"example address_line3 3090","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":null,"default_sek_payout_account":"BA789"},"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":null,"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 2433","region":"Greater London","scheme":"bacs"}]}],"meta":{"cursors":{"after":"example after 9703","before":"example before 9355"},"limit":50}}
},
"get": {
"method": "GET",
"path_template": "/creditors/:identity",
"url_params": {"identity": "CR123"},
"body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":null,"address_line3":null,"city":"London","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":"BA789"},"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":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 7202","region":"Greater London","scheme":"sepa_core"}]}}
"body": {"creditors":{"address_line1":null,"address_line2":null,"address_line3":"example address_line3 5561","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":null,"default_sek_payout_account":null},"logo_url":null,"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 9718","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 9002","region":"Greater London","scheme":"autogiro"}]}}
},
"update": {
"method": "PUT",
"path_template": "/creditors/:identity",
"url_params": {"identity": "CR123"},
"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":null},"logo_url":null,"name":"Nude Wines","postal_code":null,"region":"example region 2546","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 8643","region":null,"scheme":"autogiro"}]}}
"body": {"creditors":{"address_line1":null,"address_line2":null,"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":"BA123","default_sek_payout_account":null},"logo_url":"https://uploads.gocardless.com/logo.png","name":"Nude Wines","postal_code":null,"region":"example region 2546","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 8623","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 59","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 440"},"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 4657"},"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 4657"},"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 3039"},"metadata":{}}],"meta":{"cursors":{"after":"example after 3162","before":"example before 4904"},"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":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 3039"},"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 9513"},"metadata":{}}],"meta":{"cursors":{"after":"example after 9371","before":"example before 4415"},"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 3430"},"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 1359"},"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":"GBP","enabled":true,"id":"BA123","links":{"customer":"example customer 1359"},"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 870"},"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":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 8247"},"metadata":{}}}
}
}

Loading

0 comments on commit d180e3c

Please sign in to comment.