Skip to content

Commit

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

Workflow run: https://github.com/gocardless/gocardless-pro-php-template/actions/runs/9382426605
  • Loading branch information
gocardless-ci-robot[bot] committed Jun 5, 2024
1 parent 146fa89 commit 025be15
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 62 deletions.
6 changes: 6 additions & 0 deletions lib/Resources/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @property-read $metadata
* @property-read $month
* @property-read $name
* @property-read $parent_plan_paused
* @property-read $payment_reference
* @property-read $retry_if_possible
* @property-read $start_date
Expand Down Expand Up @@ -135,6 +136,11 @@ class Subscription extends BaseResource
*/
protected $name;

/**
* Whether the parent plan of this subscription is paused.
*/
protected $parent_plan_paused;

/**
* An optional payment reference. This will be set as the reference on each
* payment
Expand Down
11 changes: 11 additions & 0 deletions tests/Integration/SubscriptionsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function testSubscriptionsCreate()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
Expand Down Expand Up @@ -88,6 +89,7 @@ public function testSubscriptionsCreateWithIdempotencyConflict()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
Expand Down Expand Up @@ -185,6 +187,10 @@ public function testSubscriptionsList()
$this->assertEquals($body[$num]->name, $record->name);
}

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

if (isset($body[$num]->payment_reference)) {
$this->assertEquals($body[$num]->payment_reference, $record->payment_reference);
}
Expand Down Expand Up @@ -240,6 +246,7 @@ public function testSubscriptionsGet()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
Expand Down Expand Up @@ -280,6 +287,7 @@ public function testSubscriptionsUpdate()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
Expand Down Expand Up @@ -320,6 +328,7 @@ public function testSubscriptionsPause()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
Expand Down Expand Up @@ -360,6 +369,7 @@ public function testSubscriptionsResume()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
Expand Down Expand Up @@ -400,6 +410,7 @@ public function testSubscriptionsCancel()
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->month, $response->month);
$this->assertEquals($body->name, $response->name);
$this->assertEquals($body->parent_plan_paused, $response->parent_plan_paused);
$this->assertEquals($body->payment_reference, $response->payment_reference);
$this->assertEquals($body->retry_if_possible, $response->retry_if_possible);
$this->assertEquals($body->start_date, $response->start_date);
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-05-30T15:39:10.993Z","expires_at":"2024-05-30T15:39:10.993Z","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-06-05T10:25:30.570Z","expires_at":"2024-06-05T10:25:30.570Z","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-05-30T15:39:10.993Z","expires_at":"2024-05-30T15:39:10.993Z","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-06-05T10:25:30.570Z","expires_at":"2024-06-05T10:25:30.570Z","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-05-30T15:39:10.997Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-05-30T15:39:10.997Z","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}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2024-06-05T10:25:30.574Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-06-05T10:25:30.574Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"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":false}}
},
"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-05-30T15:39:10.997Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-05-30T15:39:10.997Z","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":true,"show_success_redirect_button":false}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2024-06-05T10:25:30.574Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-06-05T10:25:30.574Z","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}}
}
}

Loading

0 comments on commit 025be15

Please sign in to comment.