Skip to content

Commit

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

Workflow run: https://github.com/gocardless/gocardless-pro-php-template/actions/runs/7450418565
  • Loading branch information
gocardless-ci-robot[bot] committed Jan 8, 2024
1 parent 370a262 commit d1d219d
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 62 deletions.
10 changes: 10 additions & 0 deletions lib/Resources/Mandate.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @property-read $links
* @property-read $metadata
* @property-read $next_possible_charge_date
* @property-read $next_possible_standard_ach_charge_date
* @property-read $payments_require_approval
* @property-read $reference
* @property-read $scheme
Expand Down Expand Up @@ -89,6 +90,15 @@ class Mandate extends BaseResource
*/
protected $next_possible_charge_date;

/**
* If this is an an ACH mandate, the earliest date that can be used as a
* `charge_date` on any newly created payment to be charged through standard
* ACH, rather than Faster ACH. This value will change over time.
*
* It is only present in the API response for ACH mandates.
*/
protected $next_possible_standard_ach_charge_date;

/**
* Boolean value showing whether payments and subscriptions under this
* mandate require approval via an automated email before being processed.
Expand Down
9 changes: 9 additions & 0 deletions lib/Resources/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* @property-read $created_at
* @property-read $currency
* @property-read $description
* @property-read $faster_ach
* @property-read $fx
* @property-read $id
* @property-read $links
Expand Down Expand Up @@ -71,6 +72,14 @@ class Payment extends BaseResource
*/
protected $description;

/**
* This field indicates whether the ACH payment is processed through Faster
* ACH or standard ACH.
*
* It is only present in the API response for ACH payments.
*/
protected $faster_ach;

/**
*
*/
Expand Down
10 changes: 10 additions & 0 deletions tests/Integration/MandatesIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function testMandatesCreate()
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->next_possible_charge_date, $response->next_possible_charge_date);
$this->assertEquals($body->next_possible_standard_ach_charge_date, $response->next_possible_standard_ach_charge_date);
$this->assertEquals($body->payments_require_approval, $response->payments_require_approval);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->scheme, $response->scheme);
Expand Down Expand Up @@ -74,6 +75,7 @@ public function testMandatesCreateWithIdempotencyConflict()
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->next_possible_charge_date, $response->next_possible_charge_date);
$this->assertEquals($body->next_possible_standard_ach_charge_date, $response->next_possible_standard_ach_charge_date);
$this->assertEquals($body->payments_require_approval, $response->payments_require_approval);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->scheme, $response->scheme);
Expand Down Expand Up @@ -143,6 +145,10 @@ public function testMandatesList()
$this->assertEquals($body[$num]->next_possible_charge_date, $record->next_possible_charge_date);
}

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

if (isset($body[$num]->payments_require_approval)) {
$this->assertEquals($body[$num]->payments_require_approval, $record->payments_require_approval);
}
Expand Down Expand Up @@ -191,6 +197,7 @@ public function testMandatesGet()
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->next_possible_charge_date, $response->next_possible_charge_date);
$this->assertEquals($body->next_possible_standard_ach_charge_date, $response->next_possible_standard_ach_charge_date);
$this->assertEquals($body->payments_require_approval, $response->payments_require_approval);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->scheme, $response->scheme);
Expand Down Expand Up @@ -224,6 +231,7 @@ public function testMandatesUpdate()
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->next_possible_charge_date, $response->next_possible_charge_date);
$this->assertEquals($body->next_possible_standard_ach_charge_date, $response->next_possible_standard_ach_charge_date);
$this->assertEquals($body->payments_require_approval, $response->payments_require_approval);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->scheme, $response->scheme);
Expand Down Expand Up @@ -257,6 +265,7 @@ public function testMandatesCancel()
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->next_possible_charge_date, $response->next_possible_charge_date);
$this->assertEquals($body->next_possible_standard_ach_charge_date, $response->next_possible_standard_ach_charge_date);
$this->assertEquals($body->payments_require_approval, $response->payments_require_approval);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->scheme, $response->scheme);
Expand Down Expand Up @@ -290,6 +299,7 @@ public function testMandatesReinstate()
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->next_possible_charge_date, $response->next_possible_charge_date);
$this->assertEquals($body->next_possible_standard_ach_charge_date, $response->next_possible_standard_ach_charge_date);
$this->assertEquals($body->payments_require_approval, $response->payments_require_approval);
$this->assertEquals($body->reference, $response->reference);
$this->assertEquals($body->scheme, $response->scheme);
Expand Down
10 changes: 10 additions & 0 deletions tests/Integration/PaymentsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function testPaymentsCreate()
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->description, $response->description);
$this->assertEquals($body->faster_ach, $response->faster_ach);
$this->assertEquals($body->fx, $response->fx);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
Expand Down Expand Up @@ -72,6 +73,7 @@ public function testPaymentsCreateWithIdempotencyConflict()
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->description, $response->description);
$this->assertEquals($body->faster_ach, $response->faster_ach);
$this->assertEquals($body->fx, $response->fx);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
Expand Down Expand Up @@ -135,6 +137,10 @@ public function testPaymentsList()
$this->assertEquals($body[$num]->description, $record->description);
}

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

if (isset($body[$num]->fx)) {
$this->assertEquals($body[$num]->fx, $record->fx);
}
Expand Down Expand Up @@ -189,6 +195,7 @@ public function testPaymentsGet()
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->description, $response->description);
$this->assertEquals($body->faster_ach, $response->faster_ach);
$this->assertEquals($body->fx, $response->fx);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
Expand Down Expand Up @@ -222,6 +229,7 @@ public function testPaymentsUpdate()
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->description, $response->description);
$this->assertEquals($body->faster_ach, $response->faster_ach);
$this->assertEquals($body->fx, $response->fx);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
Expand Down Expand Up @@ -255,6 +263,7 @@ public function testPaymentsCancel()
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->description, $response->description);
$this->assertEquals($body->faster_ach, $response->faster_ach);
$this->assertEquals($body->fx, $response->fx);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
Expand Down Expand Up @@ -288,6 +297,7 @@ public function testPaymentsRetry()
$this->assertEquals($body->created_at, $response->created_at);
$this->assertEquals($body->currency, $response->currency);
$this->assertEquals($body->description, $response->description);
$this->assertEquals($body->faster_ach, $response->faster_ach);
$this->assertEquals($body->fx, $response->fx);
$this->assertEquals($body->id, $response->id);
$this->assertEquals($body->links, $response->links);
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-01-08T10:29:03.568Z","expires_at":"2024-01-08T10:29:03.568Z","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-01-08T16:39:11.932Z","expires_at":"2024-01-08T16:39:11.932Z","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-01-08T10:29:03.568Z","expires_at":"2024-01-08T10:29:03.568Z","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-01-08T16:39:11.932Z","expires_at":"2024-01-08T16:39:11.932Z","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":false,"created_at":"2024-01-08T10:29:03.573Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-01-08T10:29:03.573Z","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":false,"show_success_redirect_button":false}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-01-08T16:39:11.935Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-01-08T16:39:11.935Z","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":false,"show_success_redirect_button":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":true,"created_at":"2024-01-08T10:29:03.573Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-01-08T10:29:03.573Z","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":false}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-01-08T16:39:11.935Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-01-08T16:39:11.935Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"lock_currency":false,"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":true,"show_success_redirect_button":true}}
}
}

Loading

0 comments on commit d1d219d

Please sign in to comment.