From 92b19cc76d669f4facec7f973c01bb0f4199e577 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 18:05:37 +0000 Subject: [PATCH 01/13] Update generated code for v517 --- OPENAPI_VERSION | 2 +- lib/ErrorObject.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2597d2c77..66b84c6f8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v515 \ No newline at end of file +v517 \ No newline at end of file diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php index 4e549d77b..88e95f5c1 100644 --- a/lib/ErrorObject.php +++ b/lib/ErrorObject.php @@ -190,6 +190,7 @@ class ErrorObject extends StripeObject const CODE_SKU_INACTIVE = 'sku_inactive'; const CODE_STATE_UNSUPPORTED = 'state_unsupported'; const CODE_STATUS_TRANSITION_INVALID = 'status_transition_invalid'; + const CODE_STRIPE_TAX_INACTIVE = 'stripe_tax_inactive'; const CODE_TAX_ID_INVALID = 'tax_id_invalid'; const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed'; const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported'; From addc44d2f609153852057bd268cc12926c5e0b45 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 19:24:25 +0000 Subject: [PATCH 02/13] Update generated code for v518 --- OPENAPI_VERSION | 2 +- lib/Event.php | 2 ++ lib/Issuing/CardBundle.php | 1 + lib/Issuing/CardDesign.php | 4 ++++ lib/Service/Issuing/CardDesignService.php | 15 +++++++++++++++ .../TestHelpers/Issuing/CardDesignService.php | 17 +++++++++++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 66b84c6f8..850194444 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v517 \ No newline at end of file +v518 \ No newline at end of file diff --git a/lib/Event.php b/lib/Event.php index a70abcc1b..b0d2cfd37 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -166,6 +166,7 @@ class Event extends ApiResource const ISSUING_CARD_CREATED = 'issuing_card.created'; const ISSUING_CARD_DESIGN_ACTIVATED = 'issuing_card_design.activated'; const ISSUING_CARD_DESIGN_DEACTIVATED = 'issuing_card_design.deactivated'; + const ISSUING_CARD_DESIGN_REJECTED = 'issuing_card_design.rejected'; const ISSUING_CARD_DESIGN_UPDATED = 'issuing_card_design.updated'; const ISSUING_CARD_UPDATED = 'issuing_card.updated'; const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; @@ -415,6 +416,7 @@ class Event extends ApiResource const TYPE_ISSUING_CARD_CREATED = 'issuing_card.created'; const TYPE_ISSUING_CARD_DESIGN_ACTIVATED = 'issuing_card_design.activated'; const TYPE_ISSUING_CARD_DESIGN_DEACTIVATED = 'issuing_card_design.deactivated'; + const TYPE_ISSUING_CARD_DESIGN_REJECTED = 'issuing_card_design.rejected'; const TYPE_ISSUING_CARD_DESIGN_UPDATED = 'issuing_card_design.updated'; const TYPE_ISSUING_CARD_UPDATED = 'issuing_card.updated'; const TYPE_ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; diff --git a/lib/Issuing/CardBundle.php b/lib/Issuing/CardBundle.php index 93b464041..f8ad63765 100644 --- a/lib/Issuing/CardBundle.php +++ b/lib/Issuing/CardBundle.php @@ -9,6 +9,7 @@ * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $features * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $name Friendly display name. * @property string $status Whether this card bundle can be used to create cards. diff --git a/lib/Issuing/CardDesign.php b/lib/Issuing/CardDesign.php index 75fecbc22..656eb276c 100644 --- a/lib/Issuing/CardDesign.php +++ b/lib/Issuing/CardDesign.php @@ -10,10 +10,13 @@ * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string|\Stripe\Issuing\CardBundle $card_bundle The card bundle object belonging to this card design. + * @property null|string|\Stripe\File $card_logo The file for the card logo, for use with card bundles that support card logos. + * @property null|\Stripe\StripeObject $carrier_text Hash containing carrier text, for use with card bundles that support carrier text. * @property null|string $lookup_key A lookup key used to retrieve card designs dynamically from a static string. This may be up to 200 characters. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Friendly display name. * @property string $preference Whether this card design is used to create cards when one is not specified. + * @property \Stripe\StripeObject $rejection_reasons * @property string $status Whether this card design can be used to create cards. */ class CardDesign extends \Stripe\ApiResource @@ -21,6 +24,7 @@ class CardDesign extends \Stripe\ApiResource const OBJECT_NAME = 'issuing.card_design'; use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; use \Stripe\ApiOperations\Retrieve; use \Stripe\ApiOperations\Update; diff --git a/lib/Service/Issuing/CardDesignService.php b/lib/Service/Issuing/CardDesignService.php index eca9bde30..d75649d03 100644 --- a/lib/Service/Issuing/CardDesignService.php +++ b/lib/Service/Issuing/CardDesignService.php @@ -22,6 +22,21 @@ public function all($params = null, $opts = null) return $this->requestCollection('get', '/v1/issuing/card_designs', $params, $opts); } + /** + * Creates a card design object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CardDesign + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/card_designs', $params, $opts); + } + /** * Retrieves a card design object. * diff --git a/lib/Service/TestHelpers/Issuing/CardDesignService.php b/lib/Service/TestHelpers/Issuing/CardDesignService.php index 88fff843b..d533fb627 100644 --- a/lib/Service/TestHelpers/Issuing/CardDesignService.php +++ b/lib/Service/TestHelpers/Issuing/CardDesignService.php @@ -39,4 +39,21 @@ public function deactivateTestmode($id, $params = null, $opts = null) { return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/card_designs/%s/status/deactivate', $id), $params, $opts); } + + /** + * Updates the status of the specified testmode card design object to + * rejected. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CardDesign + */ + public function rejectTestmode($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/card_designs/%s/status/reject', $id), $params, $opts); + } } From 057abf24d62d8864339dd3a754f71a5b071d0b1e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:50:15 +0000 Subject: [PATCH 03/13] Update generated code for v519 --- OPENAPI_VERSION | 2 +- init.php | 2 + .../Issuing/AuthorizationService.php | 87 +++++++++++++++++++ .../Issuing/IssuingServiceFactory.php | 4 + .../Issuing/TransactionService.php | 54 ++++++++++++ 5 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 lib/Service/TestHelpers/Issuing/AuthorizationService.php create mode 100644 lib/Service/TestHelpers/Issuing/TransactionService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 850194444..8c7e87b6a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v518 \ No newline at end of file +v519 \ No newline at end of file diff --git a/init.php b/init.php index 4a44e5589..648fa776f 100644 --- a/init.php +++ b/init.php @@ -262,9 +262,11 @@ require __DIR__ . '/lib/Service/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/Terminal/TerminalServiceFactory.php'; require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php'; +require __DIR__ . '/lib/Service/TestHelpers/Issuing/AuthorizationService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardDesignService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php'; +require __DIR__ . '/lib/Service/TestHelpers/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/TestHelpers/RefundService.php'; require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php'; diff --git a/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/lib/Service/TestHelpers/Issuing/AuthorizationService.php new file mode 100644 index 000000000..73de27cb9 --- /dev/null +++ b/lib/Service/TestHelpers/Issuing/AuthorizationService.php @@ -0,0 +1,87 @@ +request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/capture', $id), $params, $opts); + } + + /** + * Create a test-mode authorization. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/test_helpers/issuing/authorizations', $params, $opts); + } + + /** + * Expire a test-mode Authorization. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function expire($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/expire', $id), $params, $opts); + } + + /** + * Increment a test-mode Authorization. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function increment($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/increment', $id), $params, $opts); + } + + /** + * Reverse a test-mode Authorization. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function reverse($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/reverse', $id), $params, $opts); + } +} diff --git a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php index 1b3a24ef6..61d7a15c7 100644 --- a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php +++ b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php @@ -7,8 +7,10 @@ /** * Service factory class for API resources in the Issuing namespace. * + * @property AuthorizationService $authorizations * @property CardDesignService $cardDesigns * @property CardService $cards + * @property TransactionService $transactions */ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory { @@ -16,8 +18,10 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'authorizations' => AuthorizationService::class, 'cardDesigns' => CardDesignService::class, 'cards' => CardService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/Issuing/TransactionService.php b/lib/Service/TestHelpers/Issuing/TransactionService.php new file mode 100644 index 000000000..5fb2965db --- /dev/null +++ b/lib/Service/TestHelpers/Issuing/TransactionService.php @@ -0,0 +1,54 @@ +request('post', '/v1/test_helpers/issuing/transactions/create_force_capture', $params, $opts); + } + + /** + * Allows the user to refund an arbitrary amount, also known as a unlinked refund. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function createUnlinkedRefund($params = null, $opts = null) + { + return $this->request('post', '/v1/test_helpers/issuing/transactions/create_unlinked_refund', $params, $opts); + } + + /** + * Refund a test-mode Transaction. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function refund($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/transactions/%s/refund', $id), $params, $opts); + } +} From 824ca9b7a5815a3c6a62569e28f4db266cf032d9 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 17:52:13 +0000 Subject: [PATCH 04/13] Update generated code for v522 --- OPENAPI_VERSION | 2 +- lib/Balance.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8c7e87b6a..30cf21dac 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v519 \ No newline at end of file +v522 \ No newline at end of file diff --git a/lib/Balance.php b/lib/Balance.php index 05a94ccfa..8243f9a9f 100644 --- a/lib/Balance.php +++ b/lib/Balance.php @@ -18,12 +18,12 @@ * Related guide: Understanding Connect account balances * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. - * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. - * @property null|\Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. + * @property \Stripe\StripeObject[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the Transfers API or Payouts API. You can find the available balance for each currency and payment type in the source_types property. + * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the source_types property. + * @property null|\Stripe\StripeObject[] $instant_available Funds that you can pay out using Instant Payouts. * @property null|\Stripe\StripeObject $issuing * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance. The pending balance for each currency, and for each payment type, can be found in the source_types property. + * @property \Stripe\StripeObject[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the source_types property. */ class Balance extends SingletonApiResource { From ae26cc6d57c330c30c6530f2f83383f7c578b2b5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:35:45 +0000 Subject: [PATCH 05/13] Update generated code for v522 --- tests/Stripe/GeneratedExamplesTest.php | 269 ++++++++++++++++++++----- 1 file changed, 214 insertions(+), 55 deletions(-) diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index a271346ac..00468c69b 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -101,8 +101,14 @@ public function testExpireSession() public function testListLineItemsSession() { - $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); - $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); + $this->expectsRequest( + 'get', + '/v1/checkout/sessions/sess_xyz/line_items' + ); + $result = $this->client->checkout->sessions->allLineItems( + 'sess_xyz', + [] + ); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); } @@ -126,7 +132,10 @@ public function testUpdateCashBalance() public function testCreateFundingInstructionsCustomer() { - $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); + $this->expectsRequest( + 'post', + '/v1/customers/cus_123/funding_instructions' + ); $result = $this->client->customers->createFundingInstructions( 'cus_123', [ @@ -151,7 +160,10 @@ public function testListAccount() public function testRetrieveAccount() { - $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xyz' + ); $result = $this->client->financialConnections->accounts->retrieve( 'fca_xyz', [] @@ -367,7 +379,10 @@ public function testDeleteConfiguration() public function testRetrieveConfiguration() { $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->retrieve('uc_123', []); + $result = $this->client->terminal->configurations->retrieve( + 'uc_123', + [] + ); static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); } @@ -476,15 +491,24 @@ public function testCreateTestClock() public function testDeleteTestClock() { - $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); + $this->expectsRequest( + 'delete', + '/v1/test_helpers/test_clocks/clock_xyz' + ); + $result = $this->client->testHelpers->testClocks->delete( + 'clock_xyz', + [] + ); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } public function testRetrieveTestClock() { $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); + $result = $this->client->testHelpers->testClocks->retrieve( + 'clock_xyz', + [] + ); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } @@ -581,7 +605,10 @@ public function testReturnOutboundTransferOutboundTransfer() public function testCreateReceivedCredit() { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/received_credits' + ); $result = $this->client->testHelpers->treasury->receivedCredits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -593,7 +620,10 @@ public function testCreateReceivedCredit() public function testCreateReceivedDebit() { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/received_debits' + ); $result = $this->client->testHelpers->treasury->receivedDebits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -754,7 +784,10 @@ public function testListPerson() public function testCreatePerson() { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons' + ); $result = $this->client->accounts->createPerson( 'acct_xxxxxxxxxxxxx', [ @@ -818,7 +851,10 @@ public function testListApplicationFee() public function testRetrieveApplicationFee() { $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); - $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); + $result = $this->client->applicationFees->retrieve( + 'fee_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); } @@ -909,7 +945,10 @@ public function testListBalanceTransaction() public function testRetrieveBalanceTransaction() { - $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/balance_transactions/txn_xxxxxxxxxxxxx' + ); $result = $this->client->balanceTransactions->retrieve( 'txn_xxxxxxxxxxxxx', [] @@ -920,7 +959,9 @@ public function testRetrieveBalanceTransaction() public function testListConfiguration2() { $this->expectsRequest('get', '/v1/billing_portal/configurations'); - $result = $this->client->billingPortal->configurations->all(['limit' => 3]); + $result = $this->client->billingPortal->configurations->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); } @@ -1046,7 +1087,10 @@ public function testCreateSession4() public function testRetrieveSession2() { - $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx' + ); $result = $this->client->checkout->sessions->retrieve( 'cs_test_xxxxxxxxxxxxx', [] @@ -1306,7 +1350,10 @@ public function testListTaxId() public function testCreateTaxId() { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids' + ); $result = $this->client->customers->createTaxId( 'cus_xxxxxxxxxxxxx', [ @@ -1544,7 +1591,9 @@ public function testRetrieveSession3() public function testListVerificationReport() { $this->expectsRequest('get', '/v1/identity/verification_reports'); - $result = $this->client->identity->verificationReports->all(['limit' => 3]); + $result = $this->client->identity->verificationReports->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); } @@ -1729,7 +1778,10 @@ public function testUpdateInvoice() public function testFinalizeInvoiceInvoice() { $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); - $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); + $result = $this->client->invoices->finalizeInvoice( + 'in_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Invoice::class, $result); } @@ -1868,7 +1920,10 @@ public function testCreateCardholder() public function testRetrieveCardholder() { - $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->cardholders->retrieve( 'ich_xxxxxxxxxxxxx', [] @@ -1878,7 +1933,10 @@ public function testRetrieveCardholder() public function testUpdateCardholder() { - $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->cardholders->update( 'ich_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1908,7 +1966,10 @@ public function testCreateCard() public function testRetrieveCard() { $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); + $result = $this->client->issuing->cards->retrieve( + 'ic_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); } @@ -1959,7 +2020,10 @@ public function testSubmitDispute() 'post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' ); - $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); + $result = $this->client->issuing->disputes->submit( + 'idp_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); } @@ -1973,7 +2037,10 @@ public function testListTransaction() public function testRetrieveTransaction() { - $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->transactions->retrieve( 'ipi_xxxxxxxxxxxxx', [] @@ -1983,7 +2050,10 @@ public function testRetrieveTransaction() public function testUpdateTransaction() { - $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->transactions->update( 'ipi_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1994,7 +2064,10 @@ public function testUpdateTransaction() public function testRetrieveMandate() { $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); - $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); + $result = $this->client->mandates->retrieve( + 'mandate_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Mandate::class, $result); } @@ -2020,7 +2093,10 @@ public function testCreatePaymentIntent2() public function testRetrievePaymentIntent() { $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); + $result = $this->client->paymentIntents->retrieve( + 'pi_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2063,7 +2139,10 @@ public function testCapturePaymentIntent() 'post', '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' ); - $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); + $result = $this->client->paymentIntents->capture( + 'pi_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2141,7 +2220,10 @@ public function testCreatePaymentLink2() public function testRetrievePaymentLink2() { $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); + $result = $this->client->paymentLinks->retrieve( + 'plink_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentLink::class, $result); } @@ -2184,7 +2266,10 @@ public function testCreatePaymentMethod() public function testRetrievePaymentMethod() { $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); + $result = $this->client->paymentMethods->retrieve( + 'pm_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); } @@ -2433,7 +2518,9 @@ public function testListPromotionCode() public function testCreatePromotionCode() { $this->expectsRequest('post', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); + $result = $this->client->promotionCodes->create([ + 'coupon' => 'Z4OV52SU', + ]); static::assertInstanceOf(\Stripe\PromotionCode::class, $result); } @@ -2449,7 +2536,10 @@ public function testRetrievePromotionCode() public function testUpdatePromotionCode() { - $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/promotion_codes/promo_xxxxxxxxxxxxx' + ); $result = $this->client->promotionCodes->update( 'promo_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -2607,8 +2697,14 @@ public function testCreateValueList() public function testDeleteValueList() { - $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueLists->delete( + 'rsl_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); } @@ -2624,7 +2720,10 @@ public function testRetrieveValueList() public function testUpdateValueList() { - $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' + ); $result = $this->client->radar->valueLists->update( 'rsl_xxxxxxxxxxxxx', ['name' => 'Updated IP Block List'] @@ -2643,7 +2742,9 @@ public function testListRefund() public function testCreateRefund() { $this->expectsRequest('post', '/v1/refunds'); - $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); + $result = $this->client->refunds->create([ + 'charge' => 'ch_xxxxxxxxxxxxx', + ]); static::assertInstanceOf(\Stripe\Refund::class, $result); } @@ -2694,7 +2795,10 @@ public function testCreateReportRun() public function testRetrieveReportRun() { - $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx' + ); $result = $this->client->reporting->reportRuns->retrieve( 'frr_xxxxxxxxxxxxx', [] @@ -2765,7 +2869,10 @@ public function testCreateSetupIntent() public function testRetrieveSetupIntent() { $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); + $result = $this->client->setupIntents->retrieve( + 'seti_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\SetupIntent::class, $result); } @@ -2840,7 +2947,10 @@ public function testCreateShippingRate2() public function testRetrieveShippingRate() { $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); + $result = $this->client->shippingRates->retrieve( + 'shr_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\ShippingRate::class, $result); } @@ -2922,8 +3032,14 @@ public function testCreateSubscriptionItem() public function testDeleteSubscriptionItem() { - $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/subscription_items/si_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionItems->delete( + 'si_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); } @@ -2939,7 +3055,10 @@ public function testRetrieveSubscriptionItem() public function testUpdateSubscriptionItem() { - $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/subscription_items/si_xxxxxxxxxxxxx' + ); $result = $this->client->subscriptionItems->update( 'si_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -3087,7 +3206,10 @@ public function testCancelSubscription() public function testRetrieveSubscription() { $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); + $result = $this->client->subscriptions->retrieve( + 'sub_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Subscription::class, $result); } @@ -3244,7 +3366,10 @@ public function testCreateLocation() public function testDeleteLocation() { - $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'delete', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->delete( 'tml_xxxxxxxxxxxxx', [] @@ -3254,7 +3379,10 @@ public function testDeleteLocation() public function testRetrieveLocation() { - $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->retrieve( 'tml_xxxxxxxxxxxxx', [] @@ -3264,7 +3392,10 @@ public function testRetrieveLocation() public function testUpdateLocation() { - $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->update( 'tml_xxxxxxxxxxxxx', ['display_name' => 'My First Store'] @@ -3293,8 +3424,14 @@ public function testCreateReader() public function testDeleteReader() { - $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->readers->delete( + 'tmr_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); } @@ -3472,7 +3609,9 @@ public function testCreateToken5() public function testCreateToken6() { $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); + $result = $this->client->tokens->create([ + 'cvc_update' => ['cvc' => '123'], + ]); static::assertInstanceOf(\Stripe\Token::class, $result); } @@ -3566,7 +3705,10 @@ public function testUpdateTransfer() public function testListTransferReversal() { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $this->expectsRequest( + 'get', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' + ); $result = $this->client->transfers->allReversals( 'tr_xxxxxxxxxxxxx', ['limit' => 3] @@ -3577,7 +3719,10 @@ public function testListTransferReversal() public function testCreateTransferReversal() { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $this->expectsRequest( + 'post', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' + ); $result = $this->client->transfers->createReversal( 'tr_xxxxxxxxxxxxx', ['amount' => 100] @@ -3682,7 +3827,9 @@ public function testRetrieveDebitReversal() public function testListFinancialAccount() { $this->expectsRequest('get', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); + $result = $this->client->treasury->financialAccounts->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); } @@ -3993,15 +4140,24 @@ public function testListWebhookEndpoint() public function testDeleteWebhookEndpoint() { - $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/webhook_endpoints/we_xxxxxxxxxxxxx' + ); + $result = $this->client->webhookEndpoints->delete( + 'we_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } public function testRetrieveWebhookEndpoint() { $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); + $result = $this->client->webhookEndpoints->retrieve( + 'we_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } @@ -4122,7 +4278,10 @@ function () {}, public function testPdfForm() { - $this->expectsRequestStream('get', '/v1/tax/forms/form_xxxxxxxxxxxxx/pdf'); + $this->expectsRequestStream( + 'get', + '/v1/tax/forms/form_xxxxxxxxxxxxx/pdf' + ); $result = $this->client->tax->forms->pdf( 'form_xxxxxxxxxxxxx', function () {}, From 67c32aa1bb102175003e3b784256c0bdfff4bcbe Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 22:09:23 +0000 Subject: [PATCH 06/13] Update generated code for v524 --- OPENAPI_VERSION | 2 +- lib/Service/CustomerService.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 30cf21dac..9bba68fc5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v522 \ No newline at end of file +v524 \ No newline at end of file diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php index 3c13d008c..34346a1eb 100644 --- a/lib/Service/CustomerService.php +++ b/lib/Service/CustomerService.php @@ -179,7 +179,7 @@ public function createSource($parentId, $params = null, $opts = null) } /** - * Creates a new TaxID object for a customer. + * Creates a new tax_id object for a customer. * * @param string $parentId * @param null|array $params @@ -245,7 +245,7 @@ public function deleteSource($parentId, $id, $params = null, $opts = null) } /** - * Deletes an existing TaxID object. + * Deletes an existing tax_id object. * * @param string $parentId * @param string $id @@ -364,7 +364,7 @@ public function retrieveSource($parentId, $id, $params = null, $opts = null) } /** - * Retrieves the TaxID object with the given identifier. + * Retrieves the tax_id object with the given identifier. * * @param string $parentId * @param string $id From 899762f7aacf6030f19d569c0b70e5ccd4918db3 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:42:53 +0000 Subject: [PATCH 07/13] Update generated code for v525 --- OPENAPI_VERSION | 2 +- tests/Stripe/GeneratedExamplesTest.php | 269 +++++-------------------- 2 files changed, 56 insertions(+), 215 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9bba68fc5..ca2b1285d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v524 \ No newline at end of file +v525 \ No newline at end of file diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 00468c69b..a271346ac 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -101,14 +101,8 @@ public function testExpireSession() public function testListLineItemsSession() { - $this->expectsRequest( - 'get', - '/v1/checkout/sessions/sess_xyz/line_items' - ); - $result = $this->client->checkout->sessions->allLineItems( - 'sess_xyz', - [] - ); + $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); + $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); } @@ -132,10 +126,7 @@ public function testUpdateCashBalance() public function testCreateFundingInstructionsCustomer() { - $this->expectsRequest( - 'post', - '/v1/customers/cus_123/funding_instructions' - ); + $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); $result = $this->client->customers->createFundingInstructions( 'cus_123', [ @@ -160,10 +151,7 @@ public function testListAccount() public function testRetrieveAccount() { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xyz' - ); + $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); $result = $this->client->financialConnections->accounts->retrieve( 'fca_xyz', [] @@ -379,10 +367,7 @@ public function testDeleteConfiguration() public function testRetrieveConfiguration() { $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->retrieve( - 'uc_123', - [] - ); + $result = $this->client->terminal->configurations->retrieve('uc_123', []); static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); } @@ -491,24 +476,15 @@ public function testCreateTestClock() public function testDeleteTestClock() { - $this->expectsRequest( - 'delete', - '/v1/test_helpers/test_clocks/clock_xyz' - ); - $result = $this->client->testHelpers->testClocks->delete( - 'clock_xyz', - [] - ); + $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); + $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } public function testRetrieveTestClock() { $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->retrieve( - 'clock_xyz', - [] - ); + $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } @@ -605,10 +581,7 @@ public function testReturnOutboundTransferOutboundTransfer() public function testCreateReceivedCredit() { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/received_credits' - ); + $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); $result = $this->client->testHelpers->treasury->receivedCredits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -620,10 +593,7 @@ public function testCreateReceivedCredit() public function testCreateReceivedDebit() { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/received_debits' - ); + $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); $result = $this->client->testHelpers->treasury->receivedDebits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -784,10 +754,7 @@ public function testListPerson() public function testCreatePerson() { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons' - ); + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); $result = $this->client->accounts->createPerson( 'acct_xxxxxxxxxxxxx', [ @@ -851,10 +818,7 @@ public function testListApplicationFee() public function testRetrieveApplicationFee() { $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); - $result = $this->client->applicationFees->retrieve( - 'fee_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); } @@ -945,10 +909,7 @@ public function testListBalanceTransaction() public function testRetrieveBalanceTransaction() { - $this->expectsRequest( - 'get', - '/v1/balance_transactions/txn_xxxxxxxxxxxxx' - ); + $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); $result = $this->client->balanceTransactions->retrieve( 'txn_xxxxxxxxxxxxx', [] @@ -959,9 +920,7 @@ public function testRetrieveBalanceTransaction() public function testListConfiguration2() { $this->expectsRequest('get', '/v1/billing_portal/configurations'); - $result = $this->client->billingPortal->configurations->all([ - 'limit' => 3, - ]); + $result = $this->client->billingPortal->configurations->all(['limit' => 3]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); } @@ -1087,10 +1046,7 @@ public function testCreateSession4() public function testRetrieveSession2() { - $this->expectsRequest( - 'get', - '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx' - ); + $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); $result = $this->client->checkout->sessions->retrieve( 'cs_test_xxxxxxxxxxxxx', [] @@ -1350,10 +1306,7 @@ public function testListTaxId() public function testCreateTaxId() { - $this->expectsRequest( - 'post', - '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids' - ); + $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); $result = $this->client->customers->createTaxId( 'cus_xxxxxxxxxxxxx', [ @@ -1591,9 +1544,7 @@ public function testRetrieveSession3() public function testListVerificationReport() { $this->expectsRequest('get', '/v1/identity/verification_reports'); - $result = $this->client->identity->verificationReports->all([ - 'limit' => 3, - ]); + $result = $this->client->identity->verificationReports->all(['limit' => 3]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); } @@ -1778,10 +1729,7 @@ public function testUpdateInvoice() public function testFinalizeInvoiceInvoice() { $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); - $result = $this->client->invoices->finalizeInvoice( - 'in_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Invoice::class, $result); } @@ -1920,10 +1868,7 @@ public function testCreateCardholder() public function testRetrieveCardholder() { - $this->expectsRequest( - 'get', - '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' - ); + $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); $result = $this->client->issuing->cardholders->retrieve( 'ich_xxxxxxxxxxxxx', [] @@ -1933,10 +1878,7 @@ public function testRetrieveCardholder() public function testUpdateCardholder() { - $this->expectsRequest( - 'post', - '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' - ); + $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); $result = $this->client->issuing->cardholders->update( 'ich_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1966,10 +1908,7 @@ public function testCreateCard() public function testRetrieveCard() { $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->retrieve( - 'ic_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); } @@ -2020,10 +1959,7 @@ public function testSubmitDispute() 'post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' ); - $result = $this->client->issuing->disputes->submit( - 'idp_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); } @@ -2037,10 +1973,7 @@ public function testListTransaction() public function testRetrieveTransaction() { - $this->expectsRequest( - 'get', - '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' - ); + $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); $result = $this->client->issuing->transactions->retrieve( 'ipi_xxxxxxxxxxxxx', [] @@ -2050,10 +1983,7 @@ public function testRetrieveTransaction() public function testUpdateTransaction() { - $this->expectsRequest( - 'post', - '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' - ); + $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); $result = $this->client->issuing->transactions->update( 'ipi_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -2064,10 +1994,7 @@ public function testUpdateTransaction() public function testRetrieveMandate() { $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); - $result = $this->client->mandates->retrieve( - 'mandate_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Mandate::class, $result); } @@ -2093,10 +2020,7 @@ public function testCreatePaymentIntent2() public function testRetrievePaymentIntent() { $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->retrieve( - 'pi_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2139,10 +2063,7 @@ public function testCapturePaymentIntent() 'post', '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' ); - $result = $this->client->paymentIntents->capture( - 'pi_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2220,10 +2141,7 @@ public function testCreatePaymentLink2() public function testRetrievePaymentLink2() { $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->retrieve( - 'plink_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\PaymentLink::class, $result); } @@ -2266,10 +2184,7 @@ public function testCreatePaymentMethod() public function testRetrievePaymentMethod() { $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->retrieve( - 'pm_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); } @@ -2518,9 +2433,7 @@ public function testListPromotionCode() public function testCreatePromotionCode() { $this->expectsRequest('post', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->create([ - 'coupon' => 'Z4OV52SU', - ]); + $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); static::assertInstanceOf(\Stripe\PromotionCode::class, $result); } @@ -2536,10 +2449,7 @@ public function testRetrievePromotionCode() public function testUpdatePromotionCode() { - $this->expectsRequest( - 'post', - '/v1/promotion_codes/promo_xxxxxxxxxxxxx' - ); + $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); $result = $this->client->promotionCodes->update( 'promo_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -2697,14 +2607,8 @@ public function testCreateValueList() public function testDeleteValueList() { - $this->expectsRequest( - 'delete', - '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->valueLists->delete( - 'rsl_xxxxxxxxxxxxx', - [] - ); + $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); } @@ -2720,10 +2624,7 @@ public function testRetrieveValueList() public function testUpdateValueList() { - $this->expectsRequest( - 'post', - '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' - ); + $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); $result = $this->client->radar->valueLists->update( 'rsl_xxxxxxxxxxxxx', ['name' => 'Updated IP Block List'] @@ -2742,9 +2643,7 @@ public function testListRefund() public function testCreateRefund() { $this->expectsRequest('post', '/v1/refunds'); - $result = $this->client->refunds->create([ - 'charge' => 'ch_xxxxxxxxxxxxx', - ]); + $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); static::assertInstanceOf(\Stripe\Refund::class, $result); } @@ -2795,10 +2694,7 @@ public function testCreateReportRun() public function testRetrieveReportRun() { - $this->expectsRequest( - 'get', - '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx' - ); + $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); $result = $this->client->reporting->reportRuns->retrieve( 'frr_xxxxxxxxxxxxx', [] @@ -2869,10 +2765,7 @@ public function testCreateSetupIntent() public function testRetrieveSetupIntent() { $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->retrieve( - 'seti_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\SetupIntent::class, $result); } @@ -2947,10 +2840,7 @@ public function testCreateShippingRate2() public function testRetrieveShippingRate() { $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->retrieve( - 'shr_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\ShippingRate::class, $result); } @@ -3032,14 +2922,8 @@ public function testCreateSubscriptionItem() public function testDeleteSubscriptionItem() { - $this->expectsRequest( - 'delete', - '/v1/subscription_items/si_xxxxxxxxxxxxx' - ); - $result = $this->client->subscriptionItems->delete( - 'si_xxxxxxxxxxxxx', - [] - ); + $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); } @@ -3055,10 +2939,7 @@ public function testRetrieveSubscriptionItem() public function testUpdateSubscriptionItem() { - $this->expectsRequest( - 'post', - '/v1/subscription_items/si_xxxxxxxxxxxxx' - ); + $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); $result = $this->client->subscriptionItems->update( 'si_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -3206,10 +3087,7 @@ public function testCancelSubscription() public function testRetrieveSubscription() { $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->retrieve( - 'sub_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Subscription::class, $result); } @@ -3366,10 +3244,7 @@ public function testCreateLocation() public function testDeleteLocation() { - $this->expectsRequest( - 'delete', - '/v1/terminal/locations/tml_xxxxxxxxxxxxx' - ); + $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); $result = $this->client->terminal->locations->delete( 'tml_xxxxxxxxxxxxx', [] @@ -3379,10 +3254,7 @@ public function testDeleteLocation() public function testRetrieveLocation() { - $this->expectsRequest( - 'get', - '/v1/terminal/locations/tml_xxxxxxxxxxxxx' - ); + $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); $result = $this->client->terminal->locations->retrieve( 'tml_xxxxxxxxxxxxx', [] @@ -3392,10 +3264,7 @@ public function testRetrieveLocation() public function testUpdateLocation() { - $this->expectsRequest( - 'post', - '/v1/terminal/locations/tml_xxxxxxxxxxxxx' - ); + $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); $result = $this->client->terminal->locations->update( 'tml_xxxxxxxxxxxxx', ['display_name' => 'My First Store'] @@ -3424,14 +3293,8 @@ public function testCreateReader() public function testDeleteReader() { - $this->expectsRequest( - 'delete', - '/v1/terminal/readers/tmr_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->readers->delete( - 'tmr_xxxxxxxxxxxxx', - [] - ); + $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); } @@ -3609,9 +3472,7 @@ public function testCreateToken5() public function testCreateToken6() { $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create([ - 'cvc_update' => ['cvc' => '123'], - ]); + $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); static::assertInstanceOf(\Stripe\Token::class, $result); } @@ -3705,10 +3566,7 @@ public function testUpdateTransfer() public function testListTransferReversal() { - $this->expectsRequest( - 'get', - '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' - ); + $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); $result = $this->client->transfers->allReversals( 'tr_xxxxxxxxxxxxx', ['limit' => 3] @@ -3719,10 +3577,7 @@ public function testListTransferReversal() public function testCreateTransferReversal() { - $this->expectsRequest( - 'post', - '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' - ); + $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); $result = $this->client->transfers->createReversal( 'tr_xxxxxxxxxxxxx', ['amount' => 100] @@ -3827,9 +3682,7 @@ public function testRetrieveDebitReversal() public function testListFinancialAccount() { $this->expectsRequest('get', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->all([ - 'limit' => 3, - ]); + $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); } @@ -4140,24 +3993,15 @@ public function testListWebhookEndpoint() public function testDeleteWebhookEndpoint() { - $this->expectsRequest( - 'delete', - '/v1/webhook_endpoints/we_xxxxxxxxxxxxx' - ); - $result = $this->client->webhookEndpoints->delete( - 'we_xxxxxxxxxxxxx', - [] - ); + $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } public function testRetrieveWebhookEndpoint() { $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->retrieve( - 'we_xxxxxxxxxxxxx', - [] - ); + $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } @@ -4278,10 +4122,7 @@ function () {}, public function testPdfForm() { - $this->expectsRequestStream( - 'get', - '/v1/tax/forms/form_xxxxxxxxxxxxx/pdf' - ); + $this->expectsRequestStream('get', '/v1/tax/forms/form_xxxxxxxxxxxxx/pdf'); $result = $this->client->tax->forms->pdf( 'form_xxxxxxxxxxxxx', function () {}, From 87e9a078f17ac443bc86051f2011037012227b9f Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:46:25 +0000 Subject: [PATCH 08/13] Update generated code for v525 --- tests/Stripe/GeneratedExamplesTest.php | 269 ++++++++++++++++++++----- 1 file changed, 214 insertions(+), 55 deletions(-) diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index a271346ac..00468c69b 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -101,8 +101,14 @@ public function testExpireSession() public function testListLineItemsSession() { - $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); - $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); + $this->expectsRequest( + 'get', + '/v1/checkout/sessions/sess_xyz/line_items' + ); + $result = $this->client->checkout->sessions->allLineItems( + 'sess_xyz', + [] + ); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); } @@ -126,7 +132,10 @@ public function testUpdateCashBalance() public function testCreateFundingInstructionsCustomer() { - $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); + $this->expectsRequest( + 'post', + '/v1/customers/cus_123/funding_instructions' + ); $result = $this->client->customers->createFundingInstructions( 'cus_123', [ @@ -151,7 +160,10 @@ public function testListAccount() public function testRetrieveAccount() { - $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xyz' + ); $result = $this->client->financialConnections->accounts->retrieve( 'fca_xyz', [] @@ -367,7 +379,10 @@ public function testDeleteConfiguration() public function testRetrieveConfiguration() { $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->retrieve('uc_123', []); + $result = $this->client->terminal->configurations->retrieve( + 'uc_123', + [] + ); static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); } @@ -476,15 +491,24 @@ public function testCreateTestClock() public function testDeleteTestClock() { - $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); + $this->expectsRequest( + 'delete', + '/v1/test_helpers/test_clocks/clock_xyz' + ); + $result = $this->client->testHelpers->testClocks->delete( + 'clock_xyz', + [] + ); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } public function testRetrieveTestClock() { $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); + $result = $this->client->testHelpers->testClocks->retrieve( + 'clock_xyz', + [] + ); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } @@ -581,7 +605,10 @@ public function testReturnOutboundTransferOutboundTransfer() public function testCreateReceivedCredit() { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/received_credits' + ); $result = $this->client->testHelpers->treasury->receivedCredits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -593,7 +620,10 @@ public function testCreateReceivedCredit() public function testCreateReceivedDebit() { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/received_debits' + ); $result = $this->client->testHelpers->treasury->receivedDebits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -754,7 +784,10 @@ public function testListPerson() public function testCreatePerson() { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons' + ); $result = $this->client->accounts->createPerson( 'acct_xxxxxxxxxxxxx', [ @@ -818,7 +851,10 @@ public function testListApplicationFee() public function testRetrieveApplicationFee() { $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); - $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); + $result = $this->client->applicationFees->retrieve( + 'fee_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); } @@ -909,7 +945,10 @@ public function testListBalanceTransaction() public function testRetrieveBalanceTransaction() { - $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/balance_transactions/txn_xxxxxxxxxxxxx' + ); $result = $this->client->balanceTransactions->retrieve( 'txn_xxxxxxxxxxxxx', [] @@ -920,7 +959,9 @@ public function testRetrieveBalanceTransaction() public function testListConfiguration2() { $this->expectsRequest('get', '/v1/billing_portal/configurations'); - $result = $this->client->billingPortal->configurations->all(['limit' => 3]); + $result = $this->client->billingPortal->configurations->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); } @@ -1046,7 +1087,10 @@ public function testCreateSession4() public function testRetrieveSession2() { - $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx' + ); $result = $this->client->checkout->sessions->retrieve( 'cs_test_xxxxxxxxxxxxx', [] @@ -1306,7 +1350,10 @@ public function testListTaxId() public function testCreateTaxId() { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids' + ); $result = $this->client->customers->createTaxId( 'cus_xxxxxxxxxxxxx', [ @@ -1544,7 +1591,9 @@ public function testRetrieveSession3() public function testListVerificationReport() { $this->expectsRequest('get', '/v1/identity/verification_reports'); - $result = $this->client->identity->verificationReports->all(['limit' => 3]); + $result = $this->client->identity->verificationReports->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); } @@ -1729,7 +1778,10 @@ public function testUpdateInvoice() public function testFinalizeInvoiceInvoice() { $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); - $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); + $result = $this->client->invoices->finalizeInvoice( + 'in_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Invoice::class, $result); } @@ -1868,7 +1920,10 @@ public function testCreateCardholder() public function testRetrieveCardholder() { - $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->cardholders->retrieve( 'ich_xxxxxxxxxxxxx', [] @@ -1878,7 +1933,10 @@ public function testRetrieveCardholder() public function testUpdateCardholder() { - $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->cardholders->update( 'ich_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1908,7 +1966,10 @@ public function testCreateCard() public function testRetrieveCard() { $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); + $result = $this->client->issuing->cards->retrieve( + 'ic_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); } @@ -1959,7 +2020,10 @@ public function testSubmitDispute() 'post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' ); - $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); + $result = $this->client->issuing->disputes->submit( + 'idp_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); } @@ -1973,7 +2037,10 @@ public function testListTransaction() public function testRetrieveTransaction() { - $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->transactions->retrieve( 'ipi_xxxxxxxxxxxxx', [] @@ -1983,7 +2050,10 @@ public function testRetrieveTransaction() public function testUpdateTransaction() { - $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->transactions->update( 'ipi_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1994,7 +2064,10 @@ public function testUpdateTransaction() public function testRetrieveMandate() { $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); - $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); + $result = $this->client->mandates->retrieve( + 'mandate_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Mandate::class, $result); } @@ -2020,7 +2093,10 @@ public function testCreatePaymentIntent2() public function testRetrievePaymentIntent() { $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); + $result = $this->client->paymentIntents->retrieve( + 'pi_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2063,7 +2139,10 @@ public function testCapturePaymentIntent() 'post', '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' ); - $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); + $result = $this->client->paymentIntents->capture( + 'pi_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2141,7 +2220,10 @@ public function testCreatePaymentLink2() public function testRetrievePaymentLink2() { $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); + $result = $this->client->paymentLinks->retrieve( + 'plink_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentLink::class, $result); } @@ -2184,7 +2266,10 @@ public function testCreatePaymentMethod() public function testRetrievePaymentMethod() { $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); + $result = $this->client->paymentMethods->retrieve( + 'pm_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); } @@ -2433,7 +2518,9 @@ public function testListPromotionCode() public function testCreatePromotionCode() { $this->expectsRequest('post', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); + $result = $this->client->promotionCodes->create([ + 'coupon' => 'Z4OV52SU', + ]); static::assertInstanceOf(\Stripe\PromotionCode::class, $result); } @@ -2449,7 +2536,10 @@ public function testRetrievePromotionCode() public function testUpdatePromotionCode() { - $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/promotion_codes/promo_xxxxxxxxxxxxx' + ); $result = $this->client->promotionCodes->update( 'promo_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -2607,8 +2697,14 @@ public function testCreateValueList() public function testDeleteValueList() { - $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueLists->delete( + 'rsl_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); } @@ -2624,7 +2720,10 @@ public function testRetrieveValueList() public function testUpdateValueList() { - $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' + ); $result = $this->client->radar->valueLists->update( 'rsl_xxxxxxxxxxxxx', ['name' => 'Updated IP Block List'] @@ -2643,7 +2742,9 @@ public function testListRefund() public function testCreateRefund() { $this->expectsRequest('post', '/v1/refunds'); - $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); + $result = $this->client->refunds->create([ + 'charge' => 'ch_xxxxxxxxxxxxx', + ]); static::assertInstanceOf(\Stripe\Refund::class, $result); } @@ -2694,7 +2795,10 @@ public function testCreateReportRun() public function testRetrieveReportRun() { - $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx' + ); $result = $this->client->reporting->reportRuns->retrieve( 'frr_xxxxxxxxxxxxx', [] @@ -2765,7 +2869,10 @@ public function testCreateSetupIntent() public function testRetrieveSetupIntent() { $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); + $result = $this->client->setupIntents->retrieve( + 'seti_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\SetupIntent::class, $result); } @@ -2840,7 +2947,10 @@ public function testCreateShippingRate2() public function testRetrieveShippingRate() { $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); + $result = $this->client->shippingRates->retrieve( + 'shr_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\ShippingRate::class, $result); } @@ -2922,8 +3032,14 @@ public function testCreateSubscriptionItem() public function testDeleteSubscriptionItem() { - $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/subscription_items/si_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionItems->delete( + 'si_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); } @@ -2939,7 +3055,10 @@ public function testRetrieveSubscriptionItem() public function testUpdateSubscriptionItem() { - $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/subscription_items/si_xxxxxxxxxxxxx' + ); $result = $this->client->subscriptionItems->update( 'si_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -3087,7 +3206,10 @@ public function testCancelSubscription() public function testRetrieveSubscription() { $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); + $result = $this->client->subscriptions->retrieve( + 'sub_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Subscription::class, $result); } @@ -3244,7 +3366,10 @@ public function testCreateLocation() public function testDeleteLocation() { - $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'delete', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->delete( 'tml_xxxxxxxxxxxxx', [] @@ -3254,7 +3379,10 @@ public function testDeleteLocation() public function testRetrieveLocation() { - $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->retrieve( 'tml_xxxxxxxxxxxxx', [] @@ -3264,7 +3392,10 @@ public function testRetrieveLocation() public function testUpdateLocation() { - $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->update( 'tml_xxxxxxxxxxxxx', ['display_name' => 'My First Store'] @@ -3293,8 +3424,14 @@ public function testCreateReader() public function testDeleteReader() { - $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->readers->delete( + 'tmr_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); } @@ -3472,7 +3609,9 @@ public function testCreateToken5() public function testCreateToken6() { $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); + $result = $this->client->tokens->create([ + 'cvc_update' => ['cvc' => '123'], + ]); static::assertInstanceOf(\Stripe\Token::class, $result); } @@ -3566,7 +3705,10 @@ public function testUpdateTransfer() public function testListTransferReversal() { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $this->expectsRequest( + 'get', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' + ); $result = $this->client->transfers->allReversals( 'tr_xxxxxxxxxxxxx', ['limit' => 3] @@ -3577,7 +3719,10 @@ public function testListTransferReversal() public function testCreateTransferReversal() { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $this->expectsRequest( + 'post', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' + ); $result = $this->client->transfers->createReversal( 'tr_xxxxxxxxxxxxx', ['amount' => 100] @@ -3682,7 +3827,9 @@ public function testRetrieveDebitReversal() public function testListFinancialAccount() { $this->expectsRequest('get', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); + $result = $this->client->treasury->financialAccounts->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); } @@ -3993,15 +4140,24 @@ public function testListWebhookEndpoint() public function testDeleteWebhookEndpoint() { - $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/webhook_endpoints/we_xxxxxxxxxxxxx' + ); + $result = $this->client->webhookEndpoints->delete( + 'we_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } public function testRetrieveWebhookEndpoint() { $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); + $result = $this->client->webhookEndpoints->retrieve( + 'we_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } @@ -4122,7 +4278,10 @@ function () {}, public function testPdfForm() { - $this->expectsRequestStream('get', '/v1/tax/forms/form_xxxxxxxxxxxxx/pdf'); + $this->expectsRequestStream( + 'get', + '/v1/tax/forms/form_xxxxxxxxxxxxx/pdf' + ); $result = $this->client->tax->forms->pdf( 'form_xxxxxxxxxxxxx', function () {}, From 63c6922bcf95d81e7e2aff9720368ad96f784f6d Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 20:36:26 +0000 Subject: [PATCH 09/13] Update generated code for v526 --- OPENAPI_VERSION | 2 +- init.php | 2 ++ lib/ConfirmationToken.php | 35 ++++++++++++++++++++++++ lib/Service/ConfirmationTokenService.php | 24 ++++++++++++++++ lib/Service/CoreServiceFactory.php | 2 ++ lib/StripeClient.php | 1 + lib/Util/ObjectTypes.php | 1 + 7 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 lib/ConfirmationToken.php create mode 100644 lib/Service/ConfirmationTokenService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ca2b1285d..8fc461e62 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v525 \ No newline at end of file +v526 \ No newline at end of file diff --git a/init.php b/init.php index 648fa776f..d67b7d407 100644 --- a/init.php +++ b/init.php @@ -99,6 +99,7 @@ require __DIR__ . '/lib/Charge.php'; require __DIR__ . '/lib/Checkout/Session.php'; require __DIR__ . '/lib/Collection.php'; +require __DIR__ . '/lib/ConfirmationToken.php'; require __DIR__ . '/lib/CountrySpec.php'; require __DIR__ . '/lib/Coupon.php'; require __DIR__ . '/lib/CreditNote.php'; @@ -184,6 +185,7 @@ require __DIR__ . '/lib/Service/ChargeService.php'; require __DIR__ . '/lib/Service/Checkout/CheckoutServiceFactory.php'; require __DIR__ . '/lib/Service/Checkout/SessionService.php'; +require __DIR__ . '/lib/Service/ConfirmationTokenService.php'; require __DIR__ . '/lib/Service/CoreServiceFactory.php'; require __DIR__ . '/lib/Service/CountrySpecService.php'; require __DIR__ . '/lib/Service/CouponService.php'; diff --git a/lib/ConfirmationToken.php b/lib/ConfirmationToken.php new file mode 100644 index 000000000..5d6a43b91 --- /dev/null +++ b/lib/ConfirmationToken.php @@ -0,0 +1,35 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $mandate_data Data used for generating a Mandate. + * @property null|string $payment_intent ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of an existing PaymentMethod. + * @property null|\Stripe\StripeObject $payment_method_preview Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + * @property null|string $return_url Return URL used to confirm the Intent. + * @property null|string $setup_future_usage

Indicates that you intend to make future payments with this ConfirmationToken's payment method.

The presence of this property will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.

+ * @property null|string $setup_intent ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + * @property null|\Stripe\StripeObject $shipping Shipping information collected on this ConfirmationToken. + */ +class ConfirmationToken extends ApiResource +{ + const OBJECT_NAME = 'confirmation_token'; + + use ApiOperations\Retrieve; + + const SETUP_FUTURE_USAGE_OFF_SESSION = 'off_session'; + const SETUP_FUTURE_USAGE_ON_SESSION = 'on_session'; +} diff --git a/lib/Service/ConfirmationTokenService.php b/lib/Service/ConfirmationTokenService.php new file mode 100644 index 000000000..2f40acc71 --- /dev/null +++ b/lib/Service/ConfirmationTokenService.php @@ -0,0 +1,24 @@ +request('get', $this->buildPath('/v1/confirmation_tokens/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index 277d56537..ca21a5463 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -19,6 +19,7 @@ * @property Capital\CapitalServiceFactory $capital * @property ChargeService $charges * @property Checkout\CheckoutServiceFactory $checkout + * @property ConfirmationTokenService $confirmationTokens * @property CountrySpecService $countrySpecs * @property CouponService $coupons * @property CreditNoteService $creditNotes @@ -92,6 +93,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'capital' => Capital\CapitalServiceFactory::class, 'charges' => ChargeService::class, 'checkout' => Checkout\CheckoutServiceFactory::class, + 'confirmationTokens' => ConfirmationTokenService::class, 'countrySpecs' => CountrySpecService::class, 'coupons' => CouponService::class, 'creditNotes' => CreditNoteService::class, diff --git a/lib/StripeClient.php b/lib/StripeClient.php index 1d408d843..fee8bd0d8 100644 --- a/lib/StripeClient.php +++ b/lib/StripeClient.php @@ -19,6 +19,7 @@ * @property \Stripe\Service\Capital\CapitalServiceFactory $capital * @property \Stripe\Service\ChargeService $charges * @property \Stripe\Service\Checkout\CheckoutServiceFactory $checkout + * @property \Stripe\Service\ConfirmationTokenService $confirmationTokens * @property \Stripe\Service\CountrySpecService $countrySpecs * @property \Stripe\Service\CouponService $coupons * @property \Stripe\Service\CreditNoteService $creditNotes diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 6657a61ce..6eca475a3 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -31,6 +31,7 @@ class ObjectTypes \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, + \Stripe\ConfirmationToken::OBJECT_NAME => \Stripe\ConfirmationToken::class, \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, From 67c1edcc88789879f56c8da8592103afd80c9703 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:30:48 -0700 Subject: [PATCH 10/13] Update generated code (#1573) * Update generated code for v515 * Update generated code for v517 * Update generated code for v519 * Update generated code for v522 * Update generated code for v522 * Update generated code for v524 * Update generated code for v525 * Update generated code for v525 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- init.php | 2 + lib/Balance.php | 8 +- lib/ErrorObject.php | 1 + lib/Service/CustomerService.php | 6 +- lib/Service/PaymentIntentService.php | 10 +- .../Issuing/AuthorizationService.php | 87 ++++++ .../Issuing/IssuingServiceFactory.php | 4 + .../Issuing/TransactionService.php | 54 ++++ tests/Stripe/GeneratedExamplesTest.php | 264 ++++++++++++++---- 10 files changed, 371 insertions(+), 67 deletions(-) create mode 100644 lib/Service/TestHelpers/Issuing/AuthorizationService.php create mode 100644 lib/Service/TestHelpers/Issuing/TransactionService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 811498793..ca2b1285d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v510 \ No newline at end of file +v525 \ No newline at end of file diff --git a/init.php b/init.php index 2fc416939..dbe93336b 100644 --- a/init.php +++ b/init.php @@ -229,8 +229,10 @@ require __DIR__ . '/lib/Service/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/Terminal/TerminalServiceFactory.php'; require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php'; +require __DIR__ . '/lib/Service/TestHelpers/Issuing/AuthorizationService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php'; +require __DIR__ . '/lib/Service/TestHelpers/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/TestHelpers/RefundService.php'; require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php'; diff --git a/lib/Balance.php b/lib/Balance.php index 05a94ccfa..8243f9a9f 100644 --- a/lib/Balance.php +++ b/lib/Balance.php @@ -18,12 +18,12 @@ * Related guide: Understanding Connect account balances * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. - * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. - * @property null|\Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. + * @property \Stripe\StripeObject[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the Transfers API or Payouts API. You can find the available balance for each currency and payment type in the source_types property. + * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the source_types property. + * @property null|\Stripe\StripeObject[] $instant_available Funds that you can pay out using Instant Payouts. * @property null|\Stripe\StripeObject $issuing * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance. The pending balance for each currency, and for each payment type, can be found in the source_types property. + * @property \Stripe\StripeObject[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the source_types property. */ class Balance extends SingletonApiResource { diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php index c5a8cfa68..ec0ed4317 100644 --- a/lib/ErrorObject.php +++ b/lib/ErrorObject.php @@ -186,6 +186,7 @@ class ErrorObject extends StripeObject const CODE_SKU_INACTIVE = 'sku_inactive'; const CODE_STATE_UNSUPPORTED = 'state_unsupported'; const CODE_STATUS_TRANSITION_INVALID = 'status_transition_invalid'; + const CODE_STRIPE_TAX_INACTIVE = 'stripe_tax_inactive'; const CODE_TAX_ID_INVALID = 'tax_id_invalid'; const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed'; const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported'; diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php index 3c13d008c..34346a1eb 100644 --- a/lib/Service/CustomerService.php +++ b/lib/Service/CustomerService.php @@ -179,7 +179,7 @@ public function createSource($parentId, $params = null, $opts = null) } /** - * Creates a new TaxID object for a customer. + * Creates a new tax_id object for a customer. * * @param string $parentId * @param null|array $params @@ -245,7 +245,7 @@ public function deleteSource($parentId, $id, $params = null, $opts = null) } /** - * Deletes an existing TaxID object. + * Deletes an existing tax_id object. * * @param string $parentId * @param string $id @@ -364,7 +364,7 @@ public function retrieveSource($parentId, $id, $params = null, $opts = null) } /** - * Retrieves the TaxID object with the given identifier. + * Retrieves the tax_id object with the given identifier. * * @param string $parentId * @param string $id diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php index a27651957..a3fd8d133 100644 --- a/lib/Service/PaymentIntentService.php +++ b/lib/Service/PaymentIntentService.php @@ -196,12 +196,12 @@ public function incrementAuthorization($id, $params = null, $opts = null) /** * Retrieves the details of a PaymentIntent that has previously been created. * - * Client-side retrieval using a publishable key is allowed when the - * client_secret is provided in the query string. + * You can retrieve a PaymentIntent client-side using a publishable key when the + * client_secret is in the query string. * - * When retrieved with a publishable key, only a subset of properties will be - * returned. Please refer to the payment - * intent object reference for more details. + * If you retrieve a PaymentIntent with a publishable key, it only returns a subset + * of properties. Refer to the payment intent + * object reference for more details. * * @param string $id * @param null|array $params diff --git a/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/lib/Service/TestHelpers/Issuing/AuthorizationService.php new file mode 100644 index 000000000..73de27cb9 --- /dev/null +++ b/lib/Service/TestHelpers/Issuing/AuthorizationService.php @@ -0,0 +1,87 @@ +request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/capture', $id), $params, $opts); + } + + /** + * Create a test-mode authorization. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/test_helpers/issuing/authorizations', $params, $opts); + } + + /** + * Expire a test-mode Authorization. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function expire($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/expire', $id), $params, $opts); + } + + /** + * Increment a test-mode Authorization. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function increment($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/increment', $id), $params, $opts); + } + + /** + * Reverse a test-mode Authorization. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function reverse($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/reverse', $id), $params, $opts); + } +} diff --git a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php index a202ec33f..e15a7c87c 100644 --- a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php +++ b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php @@ -7,7 +7,9 @@ /** * Service factory class for API resources in the Issuing namespace. * + * @property AuthorizationService $authorizations * @property CardService $cards + * @property TransactionService $transactions */ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory { @@ -15,7 +17,9 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'authorizations' => AuthorizationService::class, 'cards' => CardService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/Issuing/TransactionService.php b/lib/Service/TestHelpers/Issuing/TransactionService.php new file mode 100644 index 000000000..5fb2965db --- /dev/null +++ b/lib/Service/TestHelpers/Issuing/TransactionService.php @@ -0,0 +1,54 @@ +request('post', '/v1/test_helpers/issuing/transactions/create_force_capture', $params, $opts); + } + + /** + * Allows the user to refund an arbitrary amount, also known as a unlinked refund. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function createUnlinkedRefund($params = null, $opts = null) + { + return $this->request('post', '/v1/test_helpers/issuing/transactions/create_unlinked_refund', $params, $opts); + } + + /** + * Refund a test-mode Transaction. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function refund($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/transactions/%s/refund', $id), $params, $opts); + } +} diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index ef5f49425..ea37f68a6 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -101,8 +101,14 @@ public function testExpireSession() public function testListLineItemsSession() { - $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); - $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); + $this->expectsRequest( + 'get', + '/v1/checkout/sessions/sess_xyz/line_items' + ); + $result = $this->client->checkout->sessions->allLineItems( + 'sess_xyz', + [] + ); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); } @@ -126,7 +132,10 @@ public function testUpdateCashBalance() public function testCreateFundingInstructionsCustomer() { - $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); + $this->expectsRequest( + 'post', + '/v1/customers/cus_123/funding_instructions' + ); $result = $this->client->customers->createFundingInstructions( 'cus_123', [ @@ -151,7 +160,10 @@ public function testListAccount() public function testRetrieveAccount() { - $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xyz' + ); $result = $this->client->financialConnections->accounts->retrieve( 'fca_xyz', [] @@ -367,7 +379,10 @@ public function testDeleteConfiguration() public function testRetrieveConfiguration() { $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->retrieve('uc_123', []); + $result = $this->client->terminal->configurations->retrieve( + 'uc_123', + [] + ); static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); } @@ -476,15 +491,24 @@ public function testCreateTestClock() public function testDeleteTestClock() { - $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); + $this->expectsRequest( + 'delete', + '/v1/test_helpers/test_clocks/clock_xyz' + ); + $result = $this->client->testHelpers->testClocks->delete( + 'clock_xyz', + [] + ); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } public function testRetrieveTestClock() { $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); + $result = $this->client->testHelpers->testClocks->retrieve( + 'clock_xyz', + [] + ); static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); } @@ -581,7 +605,10 @@ public function testReturnOutboundTransferOutboundTransfer() public function testCreateReceivedCredit() { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/received_credits' + ); $result = $this->client->testHelpers->treasury->receivedCredits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -593,7 +620,10 @@ public function testCreateReceivedCredit() public function testCreateReceivedDebit() { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/received_debits' + ); $result = $this->client->testHelpers->treasury->receivedDebits->create([ 'financial_account' => 'fa_123', 'network' => 'ach', @@ -754,7 +784,10 @@ public function testListPerson() public function testCreatePerson() { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons' + ); $result = $this->client->accounts->createPerson( 'acct_xxxxxxxxxxxxx', [ @@ -818,7 +851,10 @@ public function testListApplicationFee() public function testRetrieveApplicationFee() { $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); - $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); + $result = $this->client->applicationFees->retrieve( + 'fee_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); } @@ -909,7 +945,10 @@ public function testListBalanceTransaction() public function testRetrieveBalanceTransaction() { - $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/balance_transactions/txn_xxxxxxxxxxxxx' + ); $result = $this->client->balanceTransactions->retrieve( 'txn_xxxxxxxxxxxxx', [] @@ -920,7 +959,9 @@ public function testRetrieveBalanceTransaction() public function testListConfiguration2() { $this->expectsRequest('get', '/v1/billing_portal/configurations'); - $result = $this->client->billingPortal->configurations->all(['limit' => 3]); + $result = $this->client->billingPortal->configurations->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); } @@ -1046,7 +1087,10 @@ public function testCreateSession4() public function testRetrieveSession2() { - $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx' + ); $result = $this->client->checkout->sessions->retrieve( 'cs_test_xxxxxxxxxxxxx', [] @@ -1306,7 +1350,10 @@ public function testListTaxId() public function testCreateTaxId() { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids' + ); $result = $this->client->customers->createTaxId( 'cus_xxxxxxxxxxxxx', [ @@ -1544,7 +1591,9 @@ public function testRetrieveSession3() public function testListVerificationReport() { $this->expectsRequest('get', '/v1/identity/verification_reports'); - $result = $this->client->identity->verificationReports->all(['limit' => 3]); + $result = $this->client->identity->verificationReports->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); } @@ -1729,7 +1778,10 @@ public function testUpdateInvoice() public function testFinalizeInvoiceInvoice() { $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); - $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); + $result = $this->client->invoices->finalizeInvoice( + 'in_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Invoice::class, $result); } @@ -1868,7 +1920,10 @@ public function testCreateCardholder() public function testRetrieveCardholder() { - $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->cardholders->retrieve( 'ich_xxxxxxxxxxxxx', [] @@ -1878,7 +1933,10 @@ public function testRetrieveCardholder() public function testUpdateCardholder() { - $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->cardholders->update( 'ich_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1908,7 +1966,10 @@ public function testCreateCard() public function testRetrieveCard() { $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); + $result = $this->client->issuing->cards->retrieve( + 'ic_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); } @@ -1959,7 +2020,10 @@ public function testSubmitDispute() 'post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' ); - $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); + $result = $this->client->issuing->disputes->submit( + 'idp_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); } @@ -1973,7 +2037,10 @@ public function testListTransaction() public function testRetrieveTransaction() { - $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->transactions->retrieve( 'ipi_xxxxxxxxxxxxx', [] @@ -1983,7 +2050,10 @@ public function testRetrieveTransaction() public function testUpdateTransaction() { - $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx' + ); $result = $this->client->issuing->transactions->update( 'ipi_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -1994,7 +2064,10 @@ public function testUpdateTransaction() public function testRetrieveMandate() { $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); - $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); + $result = $this->client->mandates->retrieve( + 'mandate_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Mandate::class, $result); } @@ -2020,7 +2093,10 @@ public function testCreatePaymentIntent2() public function testRetrievePaymentIntent() { $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); + $result = $this->client->paymentIntents->retrieve( + 'pi_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2063,7 +2139,10 @@ public function testCapturePaymentIntent() 'post', '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' ); - $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); + $result = $this->client->paymentIntents->capture( + 'pi_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); } @@ -2141,7 +2220,10 @@ public function testCreatePaymentLink2() public function testRetrievePaymentLink2() { $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); + $result = $this->client->paymentLinks->retrieve( + 'plink_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentLink::class, $result); } @@ -2184,7 +2266,10 @@ public function testCreatePaymentMethod() public function testRetrievePaymentMethod() { $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); + $result = $this->client->paymentMethods->retrieve( + 'pm_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); } @@ -2433,7 +2518,9 @@ public function testListPromotionCode() public function testCreatePromotionCode() { $this->expectsRequest('post', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); + $result = $this->client->promotionCodes->create([ + 'coupon' => 'Z4OV52SU', + ]); static::assertInstanceOf(\Stripe\PromotionCode::class, $result); } @@ -2449,7 +2536,10 @@ public function testRetrievePromotionCode() public function testUpdatePromotionCode() { - $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/promotion_codes/promo_xxxxxxxxxxxxx' + ); $result = $this->client->promotionCodes->update( 'promo_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -2607,8 +2697,14 @@ public function testCreateValueList() public function testDeleteValueList() { - $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueLists->delete( + 'rsl_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); } @@ -2624,7 +2720,10 @@ public function testRetrieveValueList() public function testUpdateValueList() { - $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx' + ); $result = $this->client->radar->valueLists->update( 'rsl_xxxxxxxxxxxxx', ['name' => 'Updated IP Block List'] @@ -2643,7 +2742,9 @@ public function testListRefund() public function testCreateRefund() { $this->expectsRequest('post', '/v1/refunds'); - $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); + $result = $this->client->refunds->create([ + 'charge' => 'ch_xxxxxxxxxxxxx', + ]); static::assertInstanceOf(\Stripe\Refund::class, $result); } @@ -2694,7 +2795,10 @@ public function testCreateReportRun() public function testRetrieveReportRun() { - $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx' + ); $result = $this->client->reporting->reportRuns->retrieve( 'frr_xxxxxxxxxxxxx', [] @@ -2765,7 +2869,10 @@ public function testCreateSetupIntent() public function testRetrieveSetupIntent() { $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); + $result = $this->client->setupIntents->retrieve( + 'seti_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\SetupIntent::class, $result); } @@ -2840,7 +2947,10 @@ public function testCreateShippingRate2() public function testRetrieveShippingRate() { $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); + $result = $this->client->shippingRates->retrieve( + 'shr_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\ShippingRate::class, $result); } @@ -2922,8 +3032,14 @@ public function testCreateSubscriptionItem() public function testDeleteSubscriptionItem() { - $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/subscription_items/si_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionItems->delete( + 'si_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); } @@ -2939,7 +3055,10 @@ public function testRetrieveSubscriptionItem() public function testUpdateSubscriptionItem() { - $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/subscription_items/si_xxxxxxxxxxxxx' + ); $result = $this->client->subscriptionItems->update( 'si_xxxxxxxxxxxxx', ['metadata' => ['order_id' => '6735']] @@ -3087,7 +3206,10 @@ public function testCancelSubscription() public function testRetrieveSubscription() { $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); + $result = $this->client->subscriptions->retrieve( + 'sub_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Subscription::class, $result); } @@ -3244,7 +3366,10 @@ public function testCreateLocation() public function testDeleteLocation() { - $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'delete', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->delete( 'tml_xxxxxxxxxxxxx', [] @@ -3254,7 +3379,10 @@ public function testDeleteLocation() public function testRetrieveLocation() { - $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'get', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->retrieve( 'tml_xxxxxxxxxxxxx', [] @@ -3264,7 +3392,10 @@ public function testRetrieveLocation() public function testUpdateLocation() { - $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $this->expectsRequest( + 'post', + '/v1/terminal/locations/tml_xxxxxxxxxxxxx' + ); $result = $this->client->terminal->locations->update( 'tml_xxxxxxxxxxxxx', ['display_name' => 'My First Store'] @@ -3293,8 +3424,14 @@ public function testCreateReader() public function testDeleteReader() { - $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->readers->delete( + 'tmr_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); } @@ -3472,7 +3609,9 @@ public function testCreateToken5() public function testCreateToken6() { $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); + $result = $this->client->tokens->create([ + 'cvc_update' => ['cvc' => '123'], + ]); static::assertInstanceOf(\Stripe\Token::class, $result); } @@ -3566,7 +3705,10 @@ public function testUpdateTransfer() public function testListTransferReversal() { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $this->expectsRequest( + 'get', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' + ); $result = $this->client->transfers->allReversals( 'tr_xxxxxxxxxxxxx', ['limit' => 3] @@ -3577,7 +3719,10 @@ public function testListTransferReversal() public function testCreateTransferReversal() { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $this->expectsRequest( + 'post', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals' + ); $result = $this->client->transfers->createReversal( 'tr_xxxxxxxxxxxxx', ['amount' => 100] @@ -3682,7 +3827,9 @@ public function testRetrieveDebitReversal() public function testListFinancialAccount() { $this->expectsRequest('get', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); + $result = $this->client->treasury->financialAccounts->all([ + 'limit' => 3, + ]); static::assertInstanceOf(\Stripe\Collection::class, $result); static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); } @@ -3993,15 +4140,24 @@ public function testListWebhookEndpoint() public function testDeleteWebhookEndpoint() { - $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); + $this->expectsRequest( + 'delete', + '/v1/webhook_endpoints/we_xxxxxxxxxxxxx' + ); + $result = $this->client->webhookEndpoints->delete( + 'we_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } public function testRetrieveWebhookEndpoint() { $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); + $result = $this->client->webhookEndpoints->retrieve( + 'we_xxxxxxxxxxxxx', + [] + ); static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); } From ab0aa4b4f7137879ae100e8d0b10b434c2d1b796 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:11:34 +0000 Subject: [PATCH 11/13] Update generated code for v530 --- OPENAPI_VERSION | 2 +- tests/Stripe/GeneratedExamplesTest.php | 308 +++++++++++++++++++++++++ 2 files changed, 309 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 827a991b1..c4c820059 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v528 \ No newline at end of file +v530 \ No newline at end of file diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 00468c69b..71cfaaa38 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -4289,4 +4289,312 @@ function () {}, ); // TODO: assert proper instance, {"shape":"file"} } + + public function testListPaymentMethodConfiguration() + { + $this->expectsRequest('get', '/v1/payment_method_configurations'); + $result = $this->client->paymentMethodConfigurations->all([ + 'application' => 'foo', + ]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result->data[0]); + } + + public function testCreatePaymentMethodConfiguration() + { + $this->expectsRequest('post', '/v1/payment_method_configurations'); + $result = $this->client->paymentMethodConfigurations->create([ + 'acss_debit' => ['display_preference' => ['preference' => 'none']], + 'affirm' => ['display_preference' => ['preference' => 'none']], + ]); + static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result); + } + + public function testRetrievePaymentMethodConfiguration() + { + $this->expectsRequest('get', '/v1/payment_method_configurations/foo'); + $result = $this->client->paymentMethodConfigurations->retrieve( + 'foo', + [] + ); + static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result); + } + + public function testUpdatePaymentMethodConfiguration() + { + $this->expectsRequest('post', '/v1/payment_method_configurations/foo'); + $result = $this->client->paymentMethodConfigurations->update( + 'foo', + ['acss_debit' => ['display_preference' => ['preference' => 'on']]] + ); + static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result); + } + + public function testCreateAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/authorizations' + ); + $result = $this->client->testHelpers->issuing->authorizations->create([ + 'amount' => 100, + 'amount_details' => [ + 'atm_fee' => 10, + 'cashback_amount' => 5, + ], + 'authorization_method' => 'chip', + 'card' => 'foo', + 'currency' => 'bar', + 'is_amount_controllable' => true, + 'merchant_data' => [ + 'category' => 'ac_refrigeration_repair', + 'city' => 'foo', + 'country' => 'bar', + 'name' => 'foo', + 'network_id' => 'bar', + 'postal_code' => 'foo', + 'state' => 'bar', + 'terminal_id' => 'foo', + ], + 'network_data' => ['acquiring_institution_id' => 'foo'], + 'verification_data' => [ + 'address_line1_check' => 'mismatch', + 'address_postal_code_check' => 'match', + 'cvc_check' => 'match', + 'expiry_check' => 'mismatch', + ], + 'wallet' => 'apple_pay', + ]); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testCaptureAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/authorizations/example_authorization/capture' + ); + $result = $this->client->testHelpers->issuing->authorizations->capture( + 'example_authorization', + [ + 'capture_amount' => 100, + 'close_authorization' => true, + 'purchase_details' => [ + 'flight' => [ + 'departure_at' => 1633651200, + 'passenger_name' => 'John Doe', + 'refundable' => true, + 'segments' => [ + [ + 'arrival_airport_code' => 'SFO', + 'carrier' => 'Delta', + 'departure_airport_code' => 'LAX', + 'flight_number' => 'DL100', + 'service_class' => 'Economy', + 'stopover_allowed' => true, + ], + ], + 'travel_agency' => 'Orbitz', + ], + 'fuel' => [ + 'type' => 'diesel', + 'unit' => 'liter', + 'unit_cost_decimal' => '3.5', + 'volume_decimal' => '10', + ], + 'lodging' => [ + 'check_in_at' => 1633651200, + 'nights' => 2, + ], + 'receipt' => [ + [ + 'description' => 'Room charge', + 'quantity' => '1', + 'total' => 200, + 'unit_cost' => 200, + ], + ], + 'reference' => 'foo', + ], + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testExpireAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/authorizations/example_authorization/expire' + ); + $result = $this->client->testHelpers->issuing->authorizations->expire( + 'example_authorization', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testIncrementAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/authorizations/example_authorization/increment' + ); + $result = $this->client->testHelpers->issuing->authorizations->increment( + 'example_authorization', + [ + 'increment_amount' => 50, + 'is_amount_controllable' => true, + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testReverseAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/authorizations/example_authorization/reverse' + ); + $result = $this->client->testHelpers->issuing->authorizations->reverse( + 'example_authorization', + ['reverse_amount' => 20] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testCreateForceCaptureTransaction() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/transactions/create_force_capture' + ); + $result = $this->client->testHelpers->issuing->transactions->createForceCapture([ + 'amount' => 100, + 'card' => 'foo', + 'currency' => 'bar', + 'merchant_data' => [ + 'category' => 'ac_refrigeration_repair', + 'city' => 'foo', + 'country' => 'US', + 'name' => 'foo', + 'network_id' => 'bar', + 'postal_code' => '10001', + 'state' => 'NY', + 'terminal_id' => 'foo', + ], + 'purchase_details' => [ + 'flight' => [ + 'departure_at' => 1633651200, + 'passenger_name' => 'John Doe', + 'refundable' => true, + 'segments' => [ + [ + 'arrival_airport_code' => 'SFO', + 'carrier' => 'Delta', + 'departure_airport_code' => 'LAX', + 'flight_number' => 'DL100', + 'service_class' => 'Economy', + 'stopover_allowed' => true, + ], + ], + 'travel_agency' => 'Orbitz', + ], + 'fuel' => [ + 'type' => 'diesel', + 'unit' => 'liter', + 'unit_cost_decimal' => '3.5', + 'volume_decimal' => '10', + ], + 'lodging' => [ + 'check_in_at' => 1533651200, + 'nights' => 2, + ], + 'receipt' => [ + [ + 'description' => 'Room charge', + 'quantity' => '1', + 'total' => 200, + 'unit_cost' => 200, + ], + ], + 'reference' => 'foo', + ], + ]); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } + + public function testCreateUnlinkedRefundTransaction() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/transactions/create_unlinked_refund' + ); + $result = $this->client->testHelpers->issuing->transactions->createUnlinkedRefund([ + 'amount' => 100, + 'card' => 'foo', + 'currency' => 'bar', + 'merchant_data' => [ + 'category' => 'ac_refrigeration_repair', + 'city' => 'foo', + 'country' => 'bar', + 'name' => 'foo', + 'network_id' => 'bar', + 'postal_code' => 'foo', + 'state' => 'bar', + 'terminal_id' => 'foo', + ], + 'purchase_details' => [ + 'flight' => [ + 'departure_at' => 1533651200, + 'passenger_name' => 'John Doe', + 'refundable' => true, + 'segments' => [ + [ + 'arrival_airport_code' => 'SFO', + 'carrier' => 'Delta', + 'departure_airport_code' => 'LAX', + 'flight_number' => 'DL100', + 'service_class' => 'Economy', + 'stopover_allowed' => true, + ], + ], + 'travel_agency' => 'Orbitz', + ], + 'fuel' => [ + 'type' => 'diesel', + 'unit' => 'liter', + 'unit_cost_decimal' => '3.5', + 'volume_decimal' => '10', + ], + 'lodging' => [ + 'check_in_at' => 1533651200, + 'nights' => 2, + ], + 'receipt' => [ + [ + 'description' => 'Room charge', + 'quantity' => '1', + 'total' => 200, + 'unit_cost' => 200, + ], + ], + 'reference' => 'foo', + ], + ]); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } + + public function testRefundTransaction() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/transactions/example_transaction/refund' + ); + $result = $this->client->testHelpers->issuing->transactions->refund( + 'example_transaction', + ['refund_amount' => 50] + ); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } } From d33019b4ba0a7bd27753c09598b8b8caaaf7b69b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:11:12 +0000 Subject: [PATCH 12/13] Update generated code for v531 --- OPENAPI_VERSION | 2 +- lib/BalanceTransaction.php | 18 ++++++++-------- lib/Customer.php | 18 ++++++++-------- lib/Dispute.php | 16 +++++++------- lib/Event.php | 43 +++++++++++++++++++------------------- 5 files changed, 48 insertions(+), 49 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c4c820059..7ed2f6254 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v530 \ No newline at end of file +v531 \ No newline at end of file diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index 6115899e5..da8158f5a 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -6,25 +6,25 @@ /** * Balance transactions represent funds moving through your Stripe account. - * They're created for every type of transaction that comes into or flows out of your Stripe account balance. + * Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. * * Related guide: Balance transaction types * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Gross amount of the transaction, in cents (or local equivalent). - * @property int $available_on The date the transaction's net funds will become available in the Stripe balance. + * @property int $amount Gross amount of the transaction (in cents (or local equivalent)). + * @property int $available_on The date that the transaction's net funds become available in the Stripe balance. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|float $exchange_rate The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the amount in currency A, times exchange_rate, would be the amount in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount would be 1000 and currency would be eur. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount would be 1234, currency would be usd, and exchange_rate would be 1.234. + * @property null|float $exchange_rate If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the amount in currency A, multipled by the exchange_rate, equals the amount in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's amount is 1000 and currency is eur. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's amount is 1234, its currency is usd, and the exchange_rate is 1.234. * @property int $fee Fees (in cents (or local equivalent)) paid for this transaction. * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. - * @property int $net Net amount of the transaction, in cents (or local equivalent). - * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. - * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related. - * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either available or pending. - * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_inbound, obligation_outbound, obligation_reversal_inbound, obligation_reversal_outbound, obligation_payout, obligation_payout_failure, payment, payment_failure_refund, payment_refund, payment_reversal, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category instead. + * @property int $net Net amount of the transaction (in cents (or local equivalent)). + * @property string $reporting_category Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + * @property null|string|\Stripe\StripeObject $source This transaction relates to the Stripe object. + * @property string $status The transaction's net funds status in the Stripe balance, which are either available or pending. + * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_inbound, obligation_outbound, obligation_reversal_inbound, obligation_reversal_outbound, obligation_payout, obligation_payout_failure, payment, payment_failure_refund, payment_refund, payment_reversal, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. */ class BalanceTransaction extends ApiResource { diff --git a/lib/Customer.php b/lib/Customer.php index 7d3f8983c..3e2855906 100644 --- a/lib/Customer.php +++ b/lib/Customer.php @@ -5,38 +5,38 @@ namespace Stripe; /** - * This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer. + * This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. * * Related guide: Save a card during payment * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|\Stripe\StripeObject $address The customer's address. - * @property null|int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. - * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance". The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically. + * @property null|int $balance The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. + * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The settings[reconciliation_mode] field describes if these funds apply to these payment intents manually or automatically. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. - * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

- * @property null|bool $delinquent

When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

+ * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

If you use payment methods created through the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

+ * @property null|bool $delinquent

If Stripe bills the customer's latest invoice by automatically charging and the latest charge fails, it sets delinquent`` to true. If Stripe bills the invoice by sending it, and the invoice isn't paid by the due date, it also sets `delinquent to true.

If an invoice becomes uncollectible by dunning, delinquent doesn't reset to false.

* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. * @property null|string $email The customer's email address. - * @property null|\Stripe\StripeObject $invoice_credit_balance The current multi-currency balances, if any, being stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that will be added to their next invoice denominated in that currency. These balances do not refer to any unpaid invoices. They solely track amounts that have yet to be successfully applied to any invoice. A balance in a particular currency is only applied to any invoice as an invoice in that currency is finalized. + * @property null|\Stripe\StripeObject $invoice_credit_balance The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. * @property null|\Stripe\StripeObject $invoice_settings * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The customer's full name or business name. - * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. + * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001). * @property null|string $phone The customer's phone number. * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. * @property null|\Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any. * @property null|\Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any. * @property null|\Stripe\StripeObject $tax - * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". + * @property null|string $tax_exempt Describes the customer's tax exemption status, which is none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the following text: "Reverse charge". * @property null|\Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this customer belongs to. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock that this customer belongs to. */ class Customer extends ApiResource { diff --git a/lib/Dispute.php b/lib/Dispute.php index 62c99c15a..55cc06a5a 100644 --- a/lib/Dispute.php +++ b/lib/Dispute.php @@ -6,29 +6,27 @@ /** * A dispute occurs when a customer questions your charge with their card issuer. - * When this happens, you're given the opportunity to respond to the dispute with - * evidence that shows that the charge is legitimate. You can find more - * information about the dispute process in our Disputes and - * Fraud documentation. + * When this happens, you have the opportunity to respond to the dispute with + * evidence that shows that the charge is legitimate. * * Related guide: Disputes and fraud * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). + * @property int $amount Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. - * @property string|\Stripe\Charge $charge ID of the charge that was disputed. + * @property string|\Stripe\Charge $charge ID of the charge that's disputed. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property \Stripe\StripeObject $evidence * @property \Stripe\StripeObject $evidence_details - * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. + * @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $network_reason_code Network-dependent reason code for the dispute. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that's disputed. * @property null|\Stripe\StripeObject $payment_method_details - * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons. + * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Learn more about dispute reasons. * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, won, or lost. */ class Dispute extends ApiResource diff --git a/lib/Event.php b/lib/Event.php index b0d2cfd37..ef425eb83 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -8,46 +8,47 @@ * Events are our way of letting you know when something interesting happens in * your account. When an interesting event occurs, we create a new Event * object. For example, when a charge succeeds, we create a charge.succeeded - * event; and when an invoice payment attempt fails, we create an - * invoice.payment_failed event. Note that many API requests may cause multiple - * events to be created. For example, if you create a new subscription for a - * customer, you will receive both a customer.subscription.created event and a + * event, and when an invoice payment attempt fails, we create an + * invoice.payment_failed event. Certain API requests might create multiple + * events. For example, if you create a new subscription for a + * customer, you receive both a customer.subscription.created event and a * charge.succeeded event. * - * Events occur when the state of another API resource changes. The state of that - * resource at the time of the change is embedded in the event's data field. For - * example, a charge.succeeded event will contain a charge, and an - * invoice.payment_failed event will contain an invoice. + * Events occur when the state of another API resource changes. The event's data + * field embeds the resource's state at the time of the change. For + * example, a charge.succeeded event contains a charge, and an + * invoice.payment_failed event contains an invoice. * * As with other API resources, you can use endpoints to retrieve an * individual event or a list of events * from the API. We also have a separate * webhooks system for sending the - * Event objects directly to an endpoint on your server. Webhooks are managed - * in your - * account settings, - * and our Using Webhooks guide will help you get set up. + * Event objects directly to an endpoint on your server. You can manage + * webhooks in your + * account settings. Learn how + * to [listen for events] + * (/docs/webhooks) so that your integration can automatically trigger reactions. * - * When using Connect, you can also receive notifications of - * events that occur in connected accounts. For these events, there will be an + * When using Connect, you can also receive event notifications + * that occur in connected accounts. For these events, there's an * additional account attribute in the received Event object. * - * NOTE: Right now, access to events through the Retrieve Event API is - * guaranteed only for 30 days. + * We only guarantee access to events through the Retrieve Event API + * for 30 days. * * This class includes constants for the possible string representations of * event types. See https://stripe.com/docs/api#event_types for more details. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string $account The connected account that originated the event. - * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. + * @property null|string $account The connected account that originates the event. + * @property null|string $api_version The Stripe API version used to render data. This property is populated only for events on or after October 31, 2014. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property \Stripe\StripeObject $data * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. - * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event. - * @property string $type Description of the event (e.g., invoice.created or charge.refunded). + * @property int $pending_webhooks Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. + * @property null|\Stripe\StripeObject $request Information on the API request that triggers the event. + * @property string $type Description of the event (for example, invoice.created or charge.refunded). */ class Event extends ApiResource { From 9a7a3bc3eba88885c779fe9a7d42a4a0e7cddc6e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:46:09 +0000 Subject: [PATCH 13/13] Update generated code for v532 --- OPENAPI_VERSION | 2 +- tests/Stripe/GeneratedExamplesTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7ed2f6254..e9281bf5d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v531 \ No newline at end of file +v532 \ No newline at end of file diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 71cfaaa38..df85d1776 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -4344,7 +4344,7 @@ public function testCreateAuthorization() ], 'authorization_method' => 'chip', 'card' => 'foo', - 'currency' => 'bar', + 'currency' => 'usd', 'is_amount_controllable' => true, 'merchant_data' => [ 'category' => 'ac_refrigeration_repair', @@ -4472,7 +4472,7 @@ public function testCreateForceCaptureTransaction() $result = $this->client->testHelpers->issuing->transactions->createForceCapture([ 'amount' => 100, 'card' => 'foo', - 'currency' => 'bar', + 'currency' => 'usd', 'merchant_data' => [ 'category' => 'ac_refrigeration_repair', 'city' => 'foo', @@ -4533,7 +4533,7 @@ public function testCreateUnlinkedRefundTransaction() $result = $this->client->testHelpers->issuing->transactions->createUnlinkedRefund([ 'amount' => 100, 'card' => 'foo', - 'currency' => 'bar', + 'currency' => 'usd', 'merchant_data' => [ 'category' => 'ac_refrigeration_repair', 'city' => 'foo',