Skip to content

Commit

Permalink
Changes generated by 08b5fea936a63e8abf1b716d8a458a5e9085dd65
Browse files Browse the repository at this point in the history
This commit was automatically created from gocardless/gocardless-pro-php-template@08b5fea
by the `push-files` action.

Workflow run: https://github.com/gocardless/gocardless-pro-php-template/actions/runs/11681826580
  • Loading branch information
gocardless-ci-robot[bot] committed Nov 5, 2024
1 parent 90abc89 commit 258b43d
Show file tree
Hide file tree
Showing 32 changed files with 103 additions and 81 deletions.
6 changes: 6 additions & 0 deletions lib/Resources/BillingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @property-read mixed $actions
* @property-read mixed $created_at
* @property-read mixed $fallback_enabled
* @property-read mixed $fallback_occurred
* @property-read mixed $id
* @property-read mixed $links
* @property-read mixed $mandate_request
Expand Down Expand Up @@ -50,6 +51,11 @@ class BillingRequest extends BaseResource
*/
protected $fallback_enabled;

/**
* True if the billing request was completed with direct debit.
*/
protected $fallback_occurred;

/**
* Unique identifier, beginning with "BRQ".
*/
Expand Down
16 changes: 16 additions & 0 deletions tests/Integration/BillingRequestsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function testBillingRequestsCreate()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -67,6 +68,7 @@ public function testBillingRequestsCreateWithIdempotencyConflict()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -99,6 +101,7 @@ public function testBillingRequestsCollectCustomerDetails()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -130,6 +133,7 @@ public function testBillingRequestsCollectBankAccount()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -161,6 +165,7 @@ public function testBillingRequestsConfirmPayerDetails()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -192,6 +197,7 @@ public function testBillingRequestsFulfil()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -223,6 +229,7 @@ public function testBillingRequestsCancel()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -274,6 +281,10 @@ public function testBillingRequestsList()
$this->assertEquals($body[$num]->fallback_enabled, $record->fallback_enabled);
}

if (isset($body[$num]->fallback_occurred)) {
$this->assertEquals($body[$num]->fallback_occurred, $record->fallback_occurred);
}

if (isset($body[$num]->id)) {
$this->assertEquals($body[$num]->id, $record->id);
}
Expand Down Expand Up @@ -329,6 +340,7 @@ public function testBillingRequestsGet()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -360,6 +372,7 @@ public function testBillingRequestsNotify()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -391,6 +404,7 @@ public function testBillingRequestsFallback()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -422,6 +436,7 @@ public function testBillingRequestsChooseCurrency()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down Expand Up @@ -453,6 +468,7 @@ public function testBillingRequestsSelectInstitution()
$this->assertEquals($body->actions, $response->actions);
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->fallback_enabled, $response->fallback_enabled);
$this->assertEquals($body->fallback_occurred, $response->fallback_occurred);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/bank_authorisations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"method": "POST",
"path_template": "/bank_authorisations",
"url_params": {},
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 8081","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-10-15T14:17:17.431Z","expires_at":"2024-10-15T14:17:17.431Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 8081","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-11-05T10:04:37.098Z","expires_at":"2024-11-05T10:04:37.098Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
},
"get": {
"method": "GET",
"path_template": "/bank_authorisations/:identity",
"url_params": {"identity": "BAU123"},
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 7887","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-10-15T14:17:17.431Z","expires_at":"2024-10-15T14:17:17.431Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 7887","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-11-05T10:04:37.098Z","expires_at":"2024-11-05T10:04:37.098Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
}
}

4 changes: 2 additions & 2 deletions tests/fixtures/billing_request_flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"method": "POST",
"path_template": "/billing_request_flows",
"url_params": {},
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2024-10-15T14:17:17.435Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-10-15T14:17:17.435Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":false,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":true,"show_success_redirect_button":true,"skip_success_screen":false}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-11-05T10:04:37.102Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-11-05T10:04:37.102Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":true,"lock_customer_details":true,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":false,"show_success_redirect_button":true,"skip_success_screen":true}}
},
"initialise": {
"method": "POST",
"path_template": "/billing_request_flows/:identity/actions/initialise",
"url_params": {"identity": "BRF123"},
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-10-15T14:17:17.435Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-10-15T14:17:17.435Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"lock_currency":false,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":false,"show_success_redirect_button":true,"skip_success_screen":true}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2024-11-05T10:04:37.102Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-11-05T10:04:37.102Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"lock_currency":true,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":true,"show_success_redirect_button":true,"skip_success_screen":false}}
}
}

2 changes: 1 addition & 1 deletion tests/fixtures/billing_request_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"method": "GET",
"path_template": "/billing_request_templates",
"url_params": {},
"body": {"billing_request_templates":[{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"},{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 1128","before":"example before 2409"},"limit":50}}
"body": {"billing_request_templates":[{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"},{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 4405","before":"example before 9081"},"limit":50}}
},
"get": {
"method": "GET",
Expand Down
Loading

0 comments on commit 258b43d

Please sign in to comment.