Skip to content

Commit

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

Workflow run: https://github.com/gocardless/gocardless-pro-php-template/actions/runs/12123374862
  • Loading branch information
gocardless-ci-robot[bot] committed Dec 2, 2024
1 parent 704a815 commit 613994b
Show file tree
Hide file tree
Showing 32 changed files with 128 additions and 84 deletions.
12 changes: 12 additions & 0 deletions lib/Resources/BillingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
* @property-read mixed $fallback_enabled
* @property-read mixed $fallback_occurred
* @property-read mixed $id
* @property-read mixed $instalment_schedule_request
* @property-read mixed $links
* @property-read mixed $mandate_request
* @property-read mixed $metadata
* @property-read mixed $payment_request
* @property-read mixed $purpose_code
* @property-read mixed $resources
* @property-read mixed $status
* @property-read mixed $subscription_request
*/
class BillingRequest extends BaseResource
{
Expand Down Expand Up @@ -61,6 +63,11 @@ class BillingRequest extends BaseResource
*/
protected $id;

/**
* Request for an instalment schedule
*/
protected $instalment_schedule_request;

/**
*
*/
Expand Down Expand Up @@ -111,4 +118,9 @@ class BillingRequest extends BaseResource
*/
protected $status;

/**
* Request for a subscription
*/
protected $subscription_request;

}
32 changes: 32 additions & 0 deletions tests/Integration/BillingRequestsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ public function testBillingRequestsCreate()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand Down Expand Up @@ -70,13 +72,15 @@ public function testBillingRequestsCreateWithIdempotencyConflict()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -103,13 +107,15 @@ public function testBillingRequestsCollectCustomerDetails()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -135,13 +141,15 @@ public function testBillingRequestsCollectBankAccount()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -167,13 +175,15 @@ public function testBillingRequestsConfirmPayerDetails()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -199,13 +209,15 @@ public function testBillingRequestsFulfil()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -231,13 +243,15 @@ public function testBillingRequestsCancel()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand Down Expand Up @@ -289,6 +303,10 @@ public function testBillingRequestsList()
$this->assertEquals($body[$num]->id, $record->id);
}

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

if (isset($body[$num]->links)) {
$this->assertEquals($body[$num]->links, $record->links);
}
Expand Down Expand Up @@ -317,6 +335,10 @@ public function testBillingRequestsList()
$this->assertEquals($body[$num]->status, $record->status);
}

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

}

$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -342,13 +364,15 @@ public function testBillingRequestsGet()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -374,13 +398,15 @@ public function testBillingRequestsNotify()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -406,13 +432,15 @@ public function testBillingRequestsFallback()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -438,13 +466,15 @@ public function testBillingRequestsChooseCurrency()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
Expand All @@ -470,13 +500,15 @@ public function testBillingRequestsSelectInstitution()
$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->instalment_schedule_request, $response->instalment_schedule_request);
$this->assertEquals($body->links, $response->links);
$this->assertEquals($body->mandate_request, $response->mandate_request);
$this->assertEquals($body->metadata, $response->metadata);
$this->assertEquals($body->payment_request, $response->payment_request);
$this->assertEquals($body->purpose_code, $response->purpose_code);
$this->assertEquals($body->resources, $response->resources);
$this->assertEquals($body->status, $response->status);
$this->assertEquals($body->subscription_request, $response->subscription_request);


$expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
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-11-27T16:13:30.374Z","expires_at":"2024-11-27T16:13:30.374Z","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-12-02T16:14:21.647Z","expires_at":"2024-12-02T16:14:21.647Z","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-11-27T16:13:30.374Z","expires_at":"2024-11-27T16:13:30.374Z","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-12-02T16:14:21.647Z","expires_at":"2024-12-02T16:14:21.647Z","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"}}
}
}

Loading

0 comments on commit 613994b

Please sign in to comment.