From 12a022dd04b5126b3dd161605592e4f838949e6b Mon Sep 17 00:00:00 2001 From: Gerd Date: Thu, 1 Jun 2023 22:40:13 +0200 Subject: [PATCH 01/11] Webhook: improves validation and simplifies code (#1508) * simplifies code * improves validation * fix `stripe-mock` install the install method has changed * reverts updated WebhookTest.php * reverts updated WebhookSignature.php --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e85892ecd..a8da1e82e 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ background terminal ([stripe-mock's README][stripe-mock] also contains instructions for installing via Homebrew and other methods): ```bash -go get -u github.com/stripe/stripe-mock +go install github.com/stripe/stripe-mock@latest stripe-mock ``` From 3cd634e6e0278087cb606a19e7446e0c33040a78 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 20:08:02 +0000 Subject: [PATCH 02/11] Update generated code for v372 --- OPENAPI_VERSION | 2 +- lib/Service/Terminal/ReaderService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 42509e330..a3ce293d4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v370 \ No newline at end of file +v372 \ No newline at end of file diff --git a/lib/Service/Terminal/ReaderService.php b/lib/Service/Terminal/ReaderService.php index e5f8987e6..752068ce4 100644 --- a/lib/Service/Terminal/ReaderService.php +++ b/lib/Service/Terminal/ReaderService.php @@ -71,7 +71,7 @@ public function collectPaymentMethod($id, $params = null, $opts = null) } /** - * Finializes a payment on a Reader. + * Finalizes a payment on a Reader. * * @param string $id * @param null|array $params From 6d1f6cbd6645893dcaf904eef7435929836f0478 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 19:30:18 +0000 Subject: [PATCH 03/11] Update generated code for v376 --- OPENAPI_VERSION | 2 +- lib/LoginLink.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a3ce293d4..7dc295934 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v372 \ No newline at end of file +v376 \ No newline at end of file diff --git a/lib/LoginLink.php b/lib/LoginLink.php index 3351356b8..e06930c71 100644 --- a/lib/LoginLink.php +++ b/lib/LoginLink.php @@ -5,6 +5,8 @@ namespace Stripe; /** + * Login Links are single-use login link for an Express account to access their Stripe dashboard. + * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $url The URL for the login link. From 9d0f5679ab6c27093d66c7114456f40597a3c66a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:19:33 +0000 Subject: [PATCH 04/11] Update generated code for v377 --- OPENAPI_VERSION | 2 +- init.php | 2 ++ lib/AcceptedFinancing.php | 30 ++++++++++++++++++++++++ lib/Service/AcceptedFinancingService.php | 23 ++++++++++++++++++ lib/Service/CoreServiceFactory.php | 2 ++ lib/StripeClient.php | 1 + lib/Util/ObjectTypes.php | 1 + 7 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 lib/AcceptedFinancing.php create mode 100644 lib/Service/AcceptedFinancingService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7dc295934..7da2c7372 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v376 \ No newline at end of file +v377 \ No newline at end of file diff --git a/init.php b/init.php index 784f5b08a..f33c18db9 100644 --- a/init.php +++ b/init.php @@ -79,6 +79,7 @@ require __DIR__ . '/lib/StripeClient.php'; // Stripe API Resources +require __DIR__ . '/lib/AcceptedFinancing.php'; require __DIR__ . '/lib/Account.php'; require __DIR__ . '/lib/AccountLink.php'; require __DIR__ . '/lib/AccountSession.php'; @@ -204,6 +205,7 @@ require __DIR__ . '/lib/WebhookEndpoint.php'; // Services +require __DIR__ . '/lib/Service/AcceptedFinancingService.php'; require __DIR__ . '/lib/Service/AccountService.php'; require __DIR__ . '/lib/Service/AccountLinkService.php'; require __DIR__ . '/lib/Service/AccountSessionService.php'; diff --git a/lib/AcceptedFinancing.php b/lib/AcceptedFinancing.php new file mode 100644 index 000000000..3050af0c5 --- /dev/null +++ b/lib/AcceptedFinancing.php @@ -0,0 +1,30 @@ + + */ + public function retrieve($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/capital/financing/accepted', $params, $opts); + } +} diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index bed255a11..89af406b8 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -7,6 +7,7 @@ /** * Service factory class for API resources in the root namespace. * + * @property AcceptedFinancingService $acceptedFinancing * @property AccountLinkService $accountLinks * @property AccountService $accounts * @property AccountSessionService $accountSessions @@ -77,6 +78,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'acceptedFinancing' => AcceptedFinancingService::class, 'accountLinks' => AccountLinkService::class, 'accounts' => AccountService::class, 'accountSessions' => AccountSessionService::class, diff --git a/lib/StripeClient.php b/lib/StripeClient.php index 1647ea175..1699ada9e 100644 --- a/lib/StripeClient.php +++ b/lib/StripeClient.php @@ -7,6 +7,7 @@ /** * Client used to send requests to Stripe's API. * + * @property \Stripe\Service\AcceptedFinancingService $acceptedFinancing * @property \Stripe\Service\AccountLinkService $accountLinks * @property \Stripe\Service\AccountSessionService $accountSessions * @property \Stripe\Service\AccountService $accounts diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index c3beb853f..9fe5de20f 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -10,6 +10,7 @@ class ObjectTypes * @var array Mapping from object types to resource classes */ const mapping = [ + \Stripe\AcceptedFinancing::OBJECT_NAME => \Stripe\AcceptedFinancing::class, \Stripe\Account::OBJECT_NAME => \Stripe\Account::class, \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::class, From ae5778e8d6e52f2c17fdc967fe1f2d867818e300 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:28:14 +0000 Subject: [PATCH 05/11] Update generated code (#1506) * Update generated code for v358 * Update generated code for v364 * Update generated code for v376 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/Charge.php | 9 ++++----- lib/Issuing/Cardholder.php | 1 + lib/LoginLink.php | 2 ++ lib/Service/ChargeService.php | 22 +++++++++++----------- lib/Token.php | 2 -- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d747c48c3..7dc295934 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v354 \ No newline at end of file +v376 \ No newline at end of file diff --git a/lib/Charge.php b/lib/Charge.php index 0b5097af8..f4aee6804 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -5,11 +5,10 @@ namespace Stripe; /** - * To charge a credit or a debit card, you create a Charge object. You can - * retrieve and refund individual charges as well as list all charges. Charges - * are identified by a unique, random ID. - * - * Related guide: Accept a payment with the Charges API + * The Charge object represents a single attempt to move money into your Stripe account. + * PaymentIntent confirmation is the most common way to create Charges, but transferring + * money to a different Stripe account through Connect also creates Charges. + * Some legacy payment flows create Charges directly, which is not recommended for new integrations. * * @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. diff --git a/lib/Issuing/Cardholder.php b/lib/Issuing/Cardholder.php index 31e55bc64..aac314a30 100644 --- a/lib/Issuing/Cardholder.php +++ b/lib/Issuing/Cardholder.php @@ -20,6 +20,7 @@ * @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 string $name The cardholder's name. This will be printed on cards issued to them. * @property null|string $phone_number The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the 3D Secure documentation for more details. + * @property null|string[] $preferred_locales The cardholder’s preferred locales (languages), ordered by preference. Locales can be de, en, es, fr, or it. This changes the language of the 3D Secure flow and one-time password messages sent to the cardholder. * @property \Stripe\StripeObject $requirements * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. * @property string $status Specifies whether to permit authorizations on this cardholder's cards. diff --git a/lib/LoginLink.php b/lib/LoginLink.php index 3351356b8..e06930c71 100644 --- a/lib/LoginLink.php +++ b/lib/LoginLink.php @@ -5,6 +5,8 @@ namespace Stripe; /** + * Login Links are single-use login link for an Express account to access their Stripe dashboard. + * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $url The URL for the login link. diff --git a/lib/Service/ChargeService.php b/lib/Service/ChargeService.php index 0bde02792..4f6490289 100644 --- a/lib/Service/ChargeService.php +++ b/lib/Service/ChargeService.php @@ -23,14 +23,15 @@ public function all($params = null, $opts = null) } /** - * Capture the payment of an existing, uncaptured, charge. This is the second half - * of the two-step payment flow, where first you created a - * charge with the capture option set to false. + * Capture the payment of an existing, uncaptured charge that was created with the + * capture option set to false. * * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not captured - * by that point in time, they will be marked as refunded and will no longer be - * capturable. + * href="/docs/charges/placing-a-hold">7 by default), after which they are + * marked as refunded and capture attempts will fail. + * + * Don’t use this method to capture a PaymentIntent-initiated charge. Use Capture a PaymentIntent. * * @param string $id * @param null|array $params @@ -46,11 +47,10 @@ public function capture($id, $params = null, $opts = null) } /** - * To charge a credit card or other payment source, you create a - * Charge object. If your API key is in test mode, the supplied - * payment source (e.g., card) won’t actually be charged, although everything else - * will occur as if in live mode. (Stripe assumes that the charge would have - * completed successfully). + * Use the Payment Intents API to initiate + * a new payment instead of using this method. Confirmation of the PaymentIntent + * creates the Charge object used to request payment, so this method + * is limited to legacy integrations. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts diff --git a/lib/Token.php b/lib/Token.php index afc142369..2a2621d64 100644 --- a/lib/Token.php +++ b/lib/Token.php @@ -26,8 +26,6 @@ * Radar, our integrated solution for automatic fraud protection, * performs best with integrations that use client-side tokenization. * - * Related guide: Accept a payment with Charges and Tokens - * * @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\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank debits and transfers

From 050d5070eec136063076f1c31945583aa8f01251 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 8 Jun 2023 21:05:50 +0000 Subject: [PATCH 06/11] Update generated code for v379 --- OPENAPI_VERSION | 2 +- lib/Invoice.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4c6b15bb2..e55c97220 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v378 \ No newline at end of file +v379 \ No newline at end of file diff --git a/lib/Invoice.php b/lib/Invoice.php index d0e5218d4..23c9380b0 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -14,7 +14,7 @@ * If your invoice is configured to be billed through automatic charges, * Stripe automatically finalizes your invoice and attempts payment. Note * that finalizing the invoice, - * when automatic, does + * when automatic, does * not happen immediately as the invoice is created. Stripe waits * until one hour after the last webhook was successfully sent (or the last * webhook timed out after failing). If you (and the platforms you may have @@ -52,7 +52,7 @@ * @property null|\Stripe\StripeObject $applies_to * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. - * @property null|bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. + * @property null|bool $auto_advance Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action. * @property \Stripe\StripeObject $automatic_tax * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. From a63d68669b435d238ade21a589b3471e5eda5b79 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 8 Jun 2023 21:29:33 +0000 Subject: [PATCH 07/11] Update generated code for v380 --- OPENAPI_VERSION | 2 +- lib/Service/PaymentIntentService.php | 5 +++-- lib/Service/SetupIntentService.php | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e55c97220..288efc7fa 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v379 \ No newline at end of file +v380 \ No newline at end of file diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php index 787a873f5..a27651957 100644 --- a/lib/Service/PaymentIntentService.php +++ b/lib/Service/PaymentIntentService.php @@ -94,8 +94,9 @@ public function capture($id, $params = null, $opts = null) * If the selected payment method requires additional authentication steps, the * PaymentIntent will transition to the requires_action status and * suggest additional actions via next_action. If payment fails, the - * PaymentIntent will transition to the requires_payment_method - * status. If payment succeeds, the PaymentIntent will transition to the + * PaymentIntent transitions to the requires_payment_method status or + * the canceled status if the confirmation limit is reached. If + * payment succeeds, the PaymentIntent will transition to the * succeeded status (or requires_capture, if * capture_method is set to manual). If the * confirmation_method is automatic, payment may be diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php index 3dea24cbc..e41f4a0ae 100644 --- a/lib/Service/SetupIntentService.php +++ b/lib/Service/SetupIntentService.php @@ -52,7 +52,8 @@ public function cancel($id, $params = null, $opts = null) * * Otherwise, it will transition to the requires_action status and * suggest additional actions via next_action. If setup fails, the - * SetupIntent will transition to the requires_payment_method status. + * SetupIntent will transition to the requires_payment_method status + * or the canceled status if the confirmation limit is reached. * * @param string $id * @param null|array $params From d0e48cc85e1aa54cbff3644d1979a4a4c3fdd7bf Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 8 Jun 2023 14:47:46 -0700 Subject: [PATCH 08/11] Bump version to 10.15.0 --- CHANGELOG.md | 4 ++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e08f526e9..d267f91ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 10.15.0 - 2023-06-08 +* [#1506](https://github.com/stripe/stripe-php/pull/1506) Update generated code + * Add support for `preferred_locales` on `Issuing.Cardholder` + ## 10.14.0 - 2023-05-25 * [#1503](https://github.com/stripe/stripe-php/pull/1503) Update generated code * Add support for `zip` on `PaymentMethod` diff --git a/VERSION b/VERSION index 0ca1348de..f9fb144f9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.14.0 +10.15.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index 3555a618d..71eeb327f 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.14.0'; + const VERSION = '10.15.0'; /** * @return string the API key used for requests From 87e019cbeea2f826eb70252f9dd6f79c95d1e477 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 18:52:48 +0000 Subject: [PATCH 09/11] Update generated code for v382 --- OPENAPI_VERSION | 2 +- lib/Checkout/Session.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 288efc7fa..b9fa23c79 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v380 \ No newline at end of file +v382 \ No newline at end of file diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index 38fb44b6e..111a9bdd9 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -65,7 +65,7 @@ * @property null|string $status The status of the Checkout Session, one of open, complete, or expired. * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. - * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. + * @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. * @property null|\Stripe\StripeObject $tax_id_collection * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. From fc16aa36abf05b73efc1b32396b2dada705994ff Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Sat, 10 Jun 2023 00:27:07 +0000 Subject: [PATCH 10/11] Update generated code for v384 --- OPENAPI_VERSION | 2 +- lib/Service/Issuing/AuthorizationService.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b9fa23c79..b6eb47d27 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v382 \ No newline at end of file +v384 \ No newline at end of file diff --git a/lib/Service/Issuing/AuthorizationService.php b/lib/Service/Issuing/AuthorizationService.php index d36f48ed9..60d78b7cc 100644 --- a/lib/Service/Issuing/AuthorizationService.php +++ b/lib/Service/Issuing/AuthorizationService.php @@ -29,7 +29,7 @@ public function all($params = null, $opts = null) * href="/docs/issuing/controls/real-time-authorizations">real-time * authorization flow. You can also respond directly to the webhook request to * approve an authorization (preferred). More details can be found here. + * href="/docs/issuing/controls/real-time-authorizations#authorization-handling">here. * * @param string $id * @param null|array $params @@ -50,7 +50,7 @@ public function approve($id, $params = null, $opts = null) * href="/docs/issuing/controls/real-time-authorizations">real time * authorization flow. You can also respond directly to the webhook request to * decline an authorization (preferred). More details can be found here. + * href="/docs/issuing/controls/real-time-authorizations#authorization-handling">here. * * @param string $id * @param null|array $params From 9ae091e8120a5e95841386a1b3b5faf27719fea9 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 19:48:48 +0000 Subject: [PATCH 11/11] Update generated code for v385 --- OPENAPI_VERSION | 2 +- tests/Stripe/GeneratedExamplesTest.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b6eb47d27..86e861958 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v384 \ No newline at end of file +v385 \ No newline at end of file diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index ba472ea44..e6ce7a82a 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -4097,4 +4097,15 @@ public function testCreateCalculation() ]); static::assertInstanceOf(\Stripe\Tax\Calculation::class, $result); } + + public function testPreviewLinesCreditNote() + { + $this->expectsRequest('get', '/v1/credit_notes/preview/lines'); + $result = $this->client->creditNotes->previewLines([ + 'limit' => 3, + 'invoice' => 'in_xxxxxxxxxxxxx', + ]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CreditNoteLineItem::class, $result->data[0]); + } }