From d7ccbbb33b126ac515286daaa094283141257888 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:29:58 -0700 Subject: [PATCH] Codegen for openapi v162 (#1467) --- OPENAPI_VERSION | 2 +- .../resources/generated_examples_test.spec.js | 116 +++++++++--------- types/2020-08-27/CashBalances.d.ts | 14 +-- types/2020-08-27/Checkout/Sessions.d.ts | 5 + types/2020-08-27/Customers.d.ts | 20 +-- types/2020-08-27/PaymentLinks.d.ts | 2 +- types/2020-08-27/Refunds.d.ts | 21 ++++ types/2020-08-27/WebhookEndpoints.d.ts | 10 ++ 8 files changed, 104 insertions(+), 86 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 515f433c0c..b164d836dc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v161 \ No newline at end of file +v162 \ No newline at end of file diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 777c115ddd..719357dbdb 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -486,6 +486,16 @@ describe('PaymentLink', function() { }); }); +describe('SetupAttempt', function() { + it('list method', async function() { + const setupAttempts = await stripe.setupAttempts.list({ + limit: 3, + setup_intent: 'si_xyz', + }); + expect(setupAttempts).not.to.be.null; + }); +}); + describe('SetupIntent', function() { it('verifyMicrodeposits method', async function() { const setupIntent = await stripe.setupIntents.verifyMicrodeposits( @@ -647,6 +657,54 @@ describe('Terminal.Configuration', function() { }); }); +describe('Issuing.Card', function() { + it('deliverCard method', async function() { + const card = await stripe.testHelpers.issuing.cards.deliverCard('card_123'); + expect(card).not.to.be.null; + }); + + it('failCard method', async function() { + const card = await stripe.testHelpers.issuing.cards.failCard('card_123'); + expect(card).not.to.be.null; + }); + + it('returnCard method', async function() { + const card = await stripe.testHelpers.issuing.cards.returnCard('card_123'); + expect(card).not.to.be.null; + }); + + it('shipCard method', async function() { + const card = await stripe.testHelpers.issuing.cards.shipCard('card_123'); + expect(card).not.to.be.null; + }); + + it('list method', async function() { + const cards = await stripe.issuing.cards.list({limit: 3}); + expect(cards).not.to.be.null; + }); + + it('create method', async function() { + const card = await stripe.issuing.cards.create({ + cardholder: 'ich_xxxxxxxxxxxxx', + currency: 'usd', + type: 'virtual', + }); + expect(card).not.to.be.null; + }); + + it('retrieve method', async function() { + const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx'); + expect(card).not.to.be.null; + }); + + it('update method', async function() { + const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(card).not.to.be.null; + }); +}); + describe('Refund', function() { it('expire method', async function() { const refund = await stripe.testHelpers.refunds.expire('re_123'); @@ -987,64 +1045,6 @@ describe('Token', function() { }); }); -describe('SetupAttempt', function() { - it('list method', async function() { - const setupAttempts = await stripe.setupAttempts.list({ - limit: 3, - setup_intent: 'si_xyz', - }); - expect(setupAttempts).not.to.be.null; - }); -}); - -describe('Issuing.Card', function() { - it('deliverCard method', async function() { - const card = await stripe.testHelpers.issuing.cards.deliverCard('card_123'); - expect(card).not.to.be.null; - }); - - it('failCard method', async function() { - const card = await stripe.testHelpers.issuing.cards.failCard('card_123'); - expect(card).not.to.be.null; - }); - - it('returnCard method', async function() { - const card = await stripe.testHelpers.issuing.cards.returnCard('card_123'); - expect(card).not.to.be.null; - }); - - it('shipCard method', async function() { - const card = await stripe.testHelpers.issuing.cards.shipCard('card_123'); - expect(card).not.to.be.null; - }); - - it('list method', async function() { - const cards = await stripe.issuing.cards.list({limit: 3}); - expect(cards).not.to.be.null; - }); - - it('create method', async function() { - const card = await stripe.issuing.cards.create({ - cardholder: 'ich_xxxxxxxxxxxxx', - currency: 'usd', - type: 'virtual', - }); - expect(card).not.to.be.null; - }); - - it('retrieve method', async function() { - const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx'); - expect(card).not.to.be.null; - }); - - it('update method', async function() { - const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(card).not.to.be.null; - }); -}); - describe('AccountLink', function() { it('create method', async function() { const accountLink = await stripe.accountLinks.create({ diff --git a/types/2020-08-27/CashBalances.d.ts b/types/2020-08-27/CashBalances.d.ts index cf7afa1b89..d2729b6a70 100644 --- a/types/2020-08-27/CashBalances.d.ts +++ b/types/2020-08-27/CashBalances.d.ts @@ -12,7 +12,7 @@ declare module 'stripe' { object: 'cash_balance'; /** - * A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. + * A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). */ available: { [key: string]: number; @@ -57,20 +57,16 @@ declare module 'stripe' { */ expand?: Array; + /** + * A hash of settings for this cash balance. + */ settings?: CashBalanceUpdateParams.Settings; } namespace CashBalanceUpdateParams { interface Settings { /** - * Method for using the customer balance to pay outstanding - * `customer_balance` PaymentIntents. If set to `automatic`, all available - * funds will automatically be used to pay any outstanding PaymentIntent. - * If set to `manual`, only customer balance funds from bank transfers - * with a reference code matching - * `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - * automatically be used to pay the corresponding outstanding - * PaymentIntent. + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). */ reconciliation_mode?: Settings.ReconciliationMode; } diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index fda304a7f6..83005a906e 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -2907,6 +2907,11 @@ declare module 'stripe' { } interface SessionListParams extends PaginationParams { + /** + * Only return the Checkout Sessions for the Customer specified. + */ + customer?: string; + /** * Specifies which fields in the response should be expanded. */ diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index e3391d4b0a..936a734edc 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -398,14 +398,7 @@ declare module 'stripe' { namespace CashBalance { interface Settings { /** - * Method for using the customer balance to pay outstanding - * `customer_balance` PaymentIntents. If set to `automatic`, all available - * funds will automatically be used to pay any outstanding PaymentIntent. - * If set to `manual`, only customer balance funds from bank transfers - * with a reference code matching - * `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - * automatically be used to pay the corresponding outstanding - * PaymentIntent. + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). */ reconciliation_mode?: Settings.ReconciliationMode; } @@ -683,14 +676,7 @@ declare module 'stripe' { namespace CashBalance { interface Settings { /** - * Method for using the customer balance to pay outstanding - * `customer_balance` PaymentIntents. If set to `automatic`, all available - * funds will automatically be used to pay any outstanding PaymentIntent. - * If set to `manual`, only customer balance funds from bank transfers - * with a reference code matching - * `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - * automatically be used to pay the corresponding outstanding - * PaymentIntent. + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). */ reconciliation_mode?: Settings.ReconciliationMode; } @@ -1068,7 +1054,7 @@ declare module 'stripe' { ): Promise>; /** - * Updates a customer's cash balance. + * Changes the settings on a customer's cash balance. */ updateCashBalance( id: string, diff --git a/types/2020-08-27/PaymentLinks.d.ts b/types/2020-08-27/PaymentLinks.d.ts index d4f813438d..8baa471239 100644 --- a/types/2020-08-27/PaymentLinks.d.ts +++ b/types/2020-08-27/PaymentLinks.d.ts @@ -596,7 +596,7 @@ declare module 'stripe' { shipping_options?: Array; /** - * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. + * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). */ submit_type?: PaymentLinkCreateParams.SubmitType; diff --git a/types/2020-08-27/Refunds.d.ts b/types/2020-08-27/Refunds.d.ts index 5e85fd749b..03af79b646 100644 --- a/types/2020-08-27/Refunds.d.ts +++ b/types/2020-08-27/Refunds.d.ts @@ -145,15 +145,31 @@ declare module 'stripe' { } interface RefundCreateParams { + /** + * A positive integer representing how much to refund. + */ amount?: number; charge?: string; + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + + /** + * Customer whose customer balance to refund from. + */ + customer?: string; + /** * Specifies which fields in the response should be expanded. */ expand?: Array; + /** + * Address to send refund email, use customer email if not specified + */ instructions_email?: string; /** @@ -161,6 +177,11 @@ declare module 'stripe' { */ metadata?: Stripe.Emptyable; + /** + * Origin of the refund + */ + origin?: 'customer_balance'; + payment_intent?: string; reason?: RefundCreateParams.Reason; diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2020-08-27/WebhookEndpoints.d.ts index a42bef2c92..5ab9755061 100644 --- a/types/2020-08-27/WebhookEndpoints.d.ts +++ b/types/2020-08-27/WebhookEndpoints.d.ts @@ -285,6 +285,11 @@ declare module 'stripe' { | 'customer.tax_id.updated' | 'customer.updated' | 'file.created' + | 'financial_connections.account.created' + | 'financial_connections.account.deactivated' + | 'financial_connections.account.disconnected' + | 'financial_connections.account.reactivated' + | 'financial_connections.account.refreshed_balance' | 'identity.verification_session.canceled' | 'identity.verification_session.created' | 'identity.verification_session.processing' @@ -544,6 +549,11 @@ declare module 'stripe' { | 'customer.tax_id.updated' | 'customer.updated' | 'file.created' + | 'financial_connections.account.created' + | 'financial_connections.account.deactivated' + | 'financial_connections.account.disconnected' + | 'financial_connections.account.reactivated' + | 'financial_connections.account.refreshed_balance' | 'identity.verification_session.canceled' | 'identity.verification_session.created' | 'identity.verification_session.processing'