diff --git a/README.md b/README.md index e4873f7d..7636d037 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Add this repository to the contents of your `composer.json`: ```javascript { "require": { - "gocardless/gocardless-pro-php": "0.1.1" + "gocardless/gocardless-pro-php": "0.2.0" } } ``` diff --git a/composer.json b/composer.json index 81e8bfb8..d562fbf0 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "squizlabs/php_codesniffer": "~2.0", "phpdocumentor/phpdocumentor": "2.*" }, - "version": "0.1.1", + "version": "0.2.0", "autoload": { "psr-4": { "GoCardlessPro\\" : "lib/GoCardlessPro" diff --git a/lib/GoCardlessPro/Core/CurlWrapper.php b/lib/GoCardlessPro/Core/CurlWrapper.php index 79c82385..f5bc65fa 100644 --- a/lib/GoCardlessPro/Core/CurlWrapper.php +++ b/lib/GoCardlessPro/Core/CurlWrapper.php @@ -70,7 +70,7 @@ private function getUserAgent() { $curlinfo = curl_version(); $uagent = array(); - $uagent[] = 'gocardless-pro-php/0.1.1'; + $uagent[] = 'gocardless-pro-php/0.2.0'; $uagent[] = 'php/' . phpversion(); $uagent[] = 'curl/' . $curlinfo['version']; $uagent[] = 'os/' . $curlinfo['host']; diff --git a/tests/GoCardlessPro/fixtures/creditor_bank_accounts.json b/tests/GoCardlessPro/fixtures/creditor_bank_accounts.json index 084c9f6d..0089eb8b 100644 --- a/tests/GoCardlessPro/fixtures/creditor_bank_accounts.json +++ b/tests/GoCardlessPro/fixtures/creditor_bank_accounts.json @@ -3,19 +3,19 @@ "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":"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":"GBP","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":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 9703","before":"example before 4538"},"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":null,"enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{}}],"meta":{"cursors":{"after":"example after 9355","before":"example before 9703"},"limit":50}} }, "get": { "method": "GET", "path_template": "/creditor_bank_accounts/:identity", "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":{}}} }, "disable": { "method": "POST", diff --git a/tests/GoCardlessPro/fixtures/creditors.json b/tests/GoCardlessPro/fixtures/creditors.json index 0bcd10b3..42fdcff1 100644 --- a/tests/GoCardlessPro/fixtures/creditors.json +++ b/tests/GoCardlessPro/fixtures/creditors.json @@ -3,25 +3,25 @@ "method": "POST", "path_template": "/creditors", "url_params": {}, - "body": {"creditors":{"address_line1":null,"address_line2":null,"address_line3":"example address_line3 2540","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"},"name":"Nude Wines","postal_code":null,"region":"example region 3300"}} + "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"},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null}} }, "list": { "method": "GET", "path_template": "/creditors", "url_params": {}, - "body": {"creditors":[{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 3274","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},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null},{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":null,"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":null},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null}],"meta":{"cursors":{"after":"example after 5541","before":"example before 408"},"limit":50}} + "body": {"creditors":[{"address_line1":"338-346 Goswell Road","address_line2":null,"address_line3":"example address_line3 3237","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"},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":"example region 495"},{"address_line1":null,"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},"name":"Nude Wines","postal_code":null,"region":"example region 9947"}],"meta":{"cursors":{"after":"example after 3300","before":"example before 694"},"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":"GB","created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":"BA456","default_gbp_payout_account":null},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null}} + "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":"BA123"},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":null}} }, "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":null,"created_at":"2014-01-01T12:00:00.000Z","id":"CR123","links":{"default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123"},"name":"Nude Wines","postal_code":null,"region":"example region 2433"}} + "body": {"creditors":{"address_line1":"338-346 Goswell Road","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":"BA456","default_gbp_payout_account":null},"name":"Nude Wines","postal_code":"EC1V 7LQ","region":"example region 1957"}} } } diff --git a/tests/GoCardlessPro/fixtures/customer_bank_accounts.json b/tests/GoCardlessPro/fixtures/customer_bank_accounts.json index ea664dfe..ccca5e05 100644 --- a/tests/GoCardlessPro/fixtures/customer_bank_accounts.json +++ b/tests/GoCardlessPro/fixtures/customer_bank_accounts.json @@ -3,25 +3,25 @@ "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 7726"},"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 5802"},"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 3981"},"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 1270"},"metadata":{}}],"meta":{"cursors":{"after":"example after 493","before":"example before 3086"},"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 1270"},"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 9819"},"metadata":{}}],"meta":{"cursors":{"after":"example after 2066","before":"example before 2079"},"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":null,"enabled":true,"id":"BA123","links":{"customer":"example customer 9819"},"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 6052"},"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 7175"},"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 4885"},"metadata":{}}} }, "disable": { "method": "POST", diff --git a/tests/GoCardlessPro/fixtures/customers.json b/tests/GoCardlessPro/fixtures/customers.json index 23c53de6..4747c0bf 100644 --- a/tests/GoCardlessPro/fixtures/customers.json +++ b/tests/GoCardlessPro/fixtures/customers.json @@ -3,25 +3,25 @@ "method": "POST", "path_template": "/customers", "url_params": {}, - "body": {"customers":{"address_line1":null,"address_line2":"Marylebone","address_line3":null,"city":"London","company_name":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":"Osborne","given_name":null,"id":"CU123","metadata":{},"postal_code":"NW1 6XE","region":null}} + "body": {"customers":{"address_line1":null,"address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":null,"given_name":"Frank","id":"CU123","metadata":{},"postal_code":"NW1 6XE","region":null}} }, "list": { "method": "GET", "path_template": "/customers", "url_params": {}, - "body": {"customers":[{"address_line1":null,"address_line2":null,"address_line3":null,"city":null,"company_name":"Hamilton Trading Ltd.","country_code":null,"created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":null,"given_name":"Frank","id":"CU123","metadata":{},"postal_code":null,"region":null},{"address_line1":null,"address_line2":"Marylebone","address_line3":"City of Westminster","city":null,"company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":null,"given_name":"Frank","id":"CU123","metadata":{},"postal_code":null,"region":"Greater London"}],"meta":{"cursors":{"after":"example after 9843","before":"example before 552"},"limit":50}} + "body": {"customers":[{"address_line1":null,"address_line2":null,"address_line3":null,"city":null,"company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":null,"given_name":"Frank","id":"CU123","metadata":{},"postal_code":null,"region":null},{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":null,"company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":null,"given_name":"Frank","id":"CU123","metadata":{},"postal_code":"NW1 6XE","region":null}],"meta":{"cursors":{"after":"example after 1577","before":"example before 5094"},"limit":50}} }, "get": { "method": "GET", "path_template": "/customers/:identity", "url_params": {"identity": "CU123"}, - "body": {"customers":{"address_line1":null,"address_line2":null,"address_line3":null,"city":null,"company_name":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","metadata":{},"postal_code":"NW1 6XE","region":"Greater London"}} + "body": {"customers":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":null,"city":"London","company_name":"Hamilton Trading Ltd.","country_code":null,"created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":"Osborne","given_name":null,"id":"CU123","metadata":{},"postal_code":null,"region":null}} }, "update": { "method": "PUT", "path_template": "/customers/:identity", "url_params": {"identity": "CU123"}, - "body": {"customers":{"address_line1":"221B Baker Street","address_line2":null,"address_line3":null,"city":null,"company_name":null,"country_code":null,"created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":"Osborne","given_name":"Frank","id":"CU123","metadata":{},"postal_code":"NW1 6XE","region":"Greater London"}} + "body": {"customers":{"address_line1":null,"address_line2":null,"address_line3":"City of Westminster","city":null,"company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","email":null,"family_name":null,"given_name":null,"id":"CU123","metadata":{},"postal_code":"NW1 6XE","region":"Greater London"}} } } diff --git a/tests/GoCardlessPro/fixtures/events.json b/tests/GoCardlessPro/fixtures/events.json index 9ee32750..142dccb8 100644 --- a/tests/GoCardlessPro/fixtures/events.json +++ b/tests/GoCardlessPro/fixtures/events.json @@ -3,7 +3,7 @@ "method": "GET", "path_template": "/events", "url_params": {}, - "body": {"events":[{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","details":{"cause":"bank_account_disabled","description":"Customer's bank account closed","origin":"bank","reason_code":"ADDACS-B","scheme":"bacs"},"id":"EV123","links":{"mandate":"MD123","new_customer_bank_account":"BA123","parent_event":"EV123","payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","subscription":"SB123"},"metadata":{},"resource_type":"mandates"},{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","details":{"cause":"bank_account_disabled","description":"Customer's bank account closed","origin":"bank","reason_code":"ADDACS-B","scheme":"bacs"},"id":"EV123","links":{"mandate":"MD123","new_customer_bank_account":"BA123","parent_event":"EV123","payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","subscription":"SB123"},"metadata":{},"resource_type":"mandates"}],"meta":{"cursors":{"after":"example after 3749","before":"example before 1387"},"limit":50}} + "body": {"events":[{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","details":{"cause":"bank_account_disabled","description":"Customer's bank account closed","origin":"bank","reason_code":"ADDACS-B","scheme":"bacs"},"id":"EV123","links":{"mandate":"MD123","new_customer_bank_account":"BA123","parent_event":"EV123","payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","subscription":"SB123"},"metadata":{},"resource_type":"mandates"},{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","details":{"cause":"bank_account_disabled","description":"Customer's bank account closed","origin":"bank","reason_code":"ADDACS-B","scheme":"bacs"},"id":"EV123","links":{"mandate":"MD123","new_customer_bank_account":"BA123","parent_event":"EV123","payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","subscription":"SB123"},"metadata":{},"resource_type":"mandates"}],"meta":{"cursors":{"after":"example after 1528","before":"example before 3749"},"limit":50}} }, "get": { "method": "GET", diff --git a/tests/GoCardlessPro/fixtures/mandates.json b/tests/GoCardlessPro/fixtures/mandates.json index beb62092..04c3212f 100644 --- a/tests/GoCardlessPro/fixtures/mandates.json +++ b/tests/GoCardlessPro/fixtures/mandates.json @@ -3,37 +3,37 @@ "method": "POST", "path_template": "/mandates", "url_params": {}, - "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":null,"scheme":"bacs","status":"pending_submission"}} + "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":null,"reference":"REF-123","scheme":"bacs","status":"pending_submission"}} }, "list": { "method": "GET", "path_template": "/mandates", "url_params": {}, - "body": {"mandates":[{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":null,"reference":null,"scheme":"bacs","status":"pending_submission"},{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":"REF-123","scheme":"bacs","status":"pending_submission"}],"meta":{"cursors":{"after":"example after 540","before":"example before 7839"},"limit":50}} + "body": {"mandates":[{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":"REF-123","scheme":null,"status":"pending_submission"},{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":"REF-123","scheme":"bacs","status":"pending_submission"}],"meta":{"cursors":{"after":"example after 5786","before":"example before 540"},"limit":50}} }, "get": { "method": "GET", "path_template": "/mandates/:identity", "url_params": {"identity": "MD123"}, - "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":null,"reference":null,"scheme":null,"status":"pending_submission"}} + "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":null,"scheme":null,"status":"pending_submission"}} }, "update": { "method": "PUT", "path_template": "/mandates/:identity", "url_params": {"identity": "MD123"}, - "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":"REF-123","scheme":null,"status":"pending_submission"}} + "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":null,"reference":null,"scheme":"bacs","status":"pending_submission"}} }, "cancel": { "method": "POST", "path_template": "/mandates/:identity/actions/cancel", "url_params": {"identity": "MD123"}, - "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":null,"reference":"REF-123","scheme":null,"status":"pending_submission"}} + "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":null,"reference":null,"scheme":"bacs","status":"pending_submission"}} }, "reinstate": { "method": "POST", "path_template": "/mandates/:identity/actions/reinstate", "url_params": {"identity": "MD123"}, - "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":null,"scheme":"bacs","status":"pending_submission"}} + "body": {"mandates":{"created_at":"2014-01-01T12:00:00.000Z","id":"MD123","links":{"creditor":"CR123","customer_bank_account":"BA123"},"metadata":{},"next_possible_charge_date":"2014-10-27","reference":"REF-123","scheme":"bacs","status":"pending_submission"}} } } diff --git a/tests/GoCardlessPro/fixtures/payments.json b/tests/GoCardlessPro/fixtures/payments.json index 2ab35a88..3521034a 100644 --- a/tests/GoCardlessPro/fixtures/payments.json +++ b/tests/GoCardlessPro/fixtures/payments.json @@ -3,19 +3,19 @@ "method": "POST", "path_template": "/payments", "url_params": {}, - "body": {"payments":{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":null,"id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":null,"status":"submitted"}} + "body": {"payments":{"amount":"1000","amount_refunded":"150","charge_date":null,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":null,"status":"submitted"}} }, "list": { "method": "GET", "path_template": "/payments", "url_params": {}, - "body": {"meta":{"cursors":{"after":"example after 1968","before":"example before 7743"},"limit":50},"payments":[{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":null,"status":"submitted"},{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}]} + "body": {"meta":{"cursors":{"after":"example after 1968","before":"example before 1166"},"limit":50},"payments":[{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":null,"id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"},{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}]} }, "get": { "method": "GET", "path_template": "/payments/:identity", "url_params": {"identity": "PM123"}, - "body": {"payments":{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":null,"id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":null,"status":"submitted"}} + "body": {"payments":{"amount":"1000","amount_refunded":"150","charge_date":null,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":null,"id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":null,"status":"submitted"}} }, "update": { "method": "PUT", @@ -33,7 +33,7 @@ "method": "POST", "path_template": "/payments/:identity/actions/retry", "url_params": {"identity": "PM123"}, - "body": {"payments":{"amount":"1000","amount_refunded":"150","charge_date":null,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}} + "body": {"payments":{"amount":"1000","amount_refunded":"150","charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","id":"PM123","links":{"creditor":"CR123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}} } } diff --git a/tests/GoCardlessPro/fixtures/payouts.json b/tests/GoCardlessPro/fixtures/payouts.json index c2bc5520..0902f64c 100644 --- a/tests/GoCardlessPro/fixtures/payouts.json +++ b/tests/GoCardlessPro/fixtures/payouts.json @@ -3,7 +3,7 @@ "method": "GET", "path_template": "/payouts", "url_params": {}, - "body": {"meta":{"cursors":{"after":"example after 9700","before":"example before 1359"},"limit":50},"payouts":[{"amount":"1000","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"reference":"ref-1","status":"pending"},{"amount":"1000","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"reference":"ref-1","status":"pending"}]} + "body": {"meta":{"cursors":{"after":"example after 6720","before":"example before 1359"},"limit":50},"payouts":[{"amount":"1000","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"reference":"ref-1","status":"pending"},{"amount":"1000","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"reference":"ref-1","status":"pending"}]} }, "get": { "method": "GET", diff --git a/tests/GoCardlessPro/fixtures/refunds.json b/tests/GoCardlessPro/fixtures/refunds.json index bdb35b5c..f600ecf4 100644 --- a/tests/GoCardlessPro/fixtures/refunds.json +++ b/tests/GoCardlessPro/fixtures/refunds.json @@ -9,7 +9,7 @@ "method": "GET", "path_template": "/refunds", "url_params": {}, - "body": {"meta":{"cursors":{"after":"example after 783","before":"example before 6720"},"limit":50},"refunds":[{"amount":"150","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"RF123","links":{"payment":"PM123"},"metadata":{}},{"amount":"150","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"RF123","links":{"payment":"PM123"},"metadata":{}}]} + "body": {"meta":{"cursors":{"after":"example after 870","before":"example before 783"},"limit":50},"refunds":[{"amount":"150","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"RF123","links":{"payment":"PM123"},"metadata":{}},{"amount":"150","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"RF123","links":{"payment":"PM123"},"metadata":{}}]} }, "get": { "method": "GET", diff --git a/tests/GoCardlessPro/fixtures/subscriptions.json b/tests/GoCardlessPro/fixtures/subscriptions.json index 3426922d..28b82dac 100644 --- a/tests/GoCardlessPro/fixtures/subscriptions.json +++ b/tests/GoCardlessPro/fixtures/subscriptions.json @@ -3,19 +3,19 @@ "method": "POST", "path_template": "/subscriptions", "url_params": {}, - "body": {"subscriptions":{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":"GOLDPLAN","start_at":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":null,"end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":"GOLDPLAN","start_at":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "list": { "method": "GET", "path_template": "/subscriptions", "url_params": {}, - "body": {"meta":{"cursors":{"after":"example after 1092","before":"example before 8831"},"limit":50},"subscriptions":[{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":null,"end_at":"2015-10-21","id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":null,"payment_reference":null,"start_at":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]},{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":null,"start_at":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}]} + "body": {"meta":{"cursors":{"after":"example after 7920","before":"example before 6829"},"limit":50},"subscriptions":[{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":null,"payment_reference":"GOLDPLAN","start_at":null,"status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]},{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":"GOLDPLAN","start_at":null,"status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}]} }, "get": { "method": "GET", "path_template": "/subscriptions/:identity", "url_params": {"identity": "SB123"}, - "body": {"subscriptions":{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":null,"end_at":"2015-10-21","id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":null,"payment_reference":"GOLDPLAN","start_at":null,"status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":"GOLDPLAN","start_at":null,"status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "update": { "method": "PUT", @@ -27,7 +27,7 @@ "method": "POST", "path_template": "/subscriptions/:identity/actions/cancel", "url_params": {"identity": "SB123"}, - "body": {"subscriptions":{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":"GOLDPLAN","start_at":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":"1000","count":"5","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":"28","end_at":null,"id":"SB123","interval":"1","interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscripton","payment_reference":null,"start_at":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} } }