From c4bb55a3ce91982221bd479348e88eb901bdfc07 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Mon, 18 Jul 2022 11:17:47 -0700 Subject: [PATCH] Codegen for openapi v165 (#1477) --- OPENAPI_VERSION | 2 +- lib/resources/Subscriptions.js | 5 + .../resources/generated_examples_test.spec.js | 4 +- types/2020-08-27/Accounts.d.ts | 33 +++++- types/2020-08-27/Charges.d.ts | 4 + types/2020-08-27/Checkout/Sessions.d.ts | 13 +- types/2020-08-27/Customers.d.ts | 1 + types/2020-08-27/Issuing/Cards.d.ts | 2 +- types/2020-08-27/Mandates.d.ts | 46 +++++++ types/2020-08-27/PaymentIntents.d.ts | 68 ++++++++++- types/2020-08-27/PaymentLinks.d.ts | 15 ++- types/2020-08-27/PaymentMethods.d.ts | 21 ++++ types/2020-08-27/SetupAttempts.d.ts | 4 + types/2020-08-27/SetupIntents.d.ts | 112 ++++++++++++++++++ types/2020-08-27/Subscriptions.d.ts | 34 ++++++ 15 files changed, 353 insertions(+), 11 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e02bb288e4..f95a4f0eaa 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v164 \ No newline at end of file +v165 \ No newline at end of file diff --git a/lib/resources/Subscriptions.js b/lib/resources/Subscriptions.js index e757534107..bd0dc644c7 100644 --- a/lib/resources/Subscriptions.js +++ b/lib/resources/Subscriptions.js @@ -29,6 +29,11 @@ module.exports = StripeResource.extend({ methodType: 'list', }), + cancel: stripeMethod({ + method: 'DELETE', + path: '/{subscriptionExposedId}', + }), + del: stripeMethod({ method: 'DELETE', path: '/{subscriptionExposedId}', diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index a04f41c00a..64b6f63fab 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -2492,8 +2492,8 @@ describe('Subscription', function() { expect(subscription).not.to.be.null; }); - it('del method', async function() { - const subscription = await stripe.subscriptions.del('sub_xxxxxxxxxxxxx'); + it('cancel method', async function() { + const subscription = await stripe.subscriptions.cancel('sub_xxxxxxxxxxxxx'); expect(subscription).not.to.be.null; }); diff --git a/types/2020-08-27/Accounts.d.ts b/types/2020-08-27/Accounts.d.ts index 4334c9f638..fc902d151c 100644 --- a/types/2020-08-27/Accounts.d.ts +++ b/types/2020-08-27/Accounts.d.ts @@ -191,6 +191,11 @@ declare module 'stripe' { */ bank_transfer_payments?: Capabilities.BankTransferPayments; + /** + * The status of the blik payments capability of the account, or whether the account can directly process blik charges. + */ + blik_payments?: Capabilities.BlikPayments; + /** * The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. */ @@ -332,6 +337,8 @@ declare module 'stripe' { type BankTransferPayments = 'active' | 'inactive' | 'pending'; + type BlikPayments = 'active' | 'inactive' | 'pending'; + type BoletoPayments = 'active' | 'inactive' | 'pending'; type CardIssuing = 'active' | 'inactive' | 'pending'; @@ -1299,6 +1306,11 @@ declare module 'stripe' { */ bank_transfer_payments?: Capabilities.BankTransferPayments; + /** + * The blik_payments capability. + */ + blik_payments?: Capabilities.BlikPayments; + /** * The boleto_payments capability. */ @@ -1475,6 +1487,13 @@ declare module 'stripe' { requested?: boolean; } + interface BlikPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + interface BoletoPayments { /** * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. @@ -1894,7 +1913,7 @@ declare module 'stripe' { interface ExternalAccount { /** - * The type of external account. + * The type of external account. Should be bank_account. */ object: string; @@ -2520,6 +2539,11 @@ declare module 'stripe' { */ bank_transfer_payments?: Capabilities.BankTransferPayments; + /** + * The blik_payments capability. + */ + blik_payments?: Capabilities.BlikPayments; + /** * The boleto_payments capability. */ @@ -2696,6 +2720,13 @@ declare module 'stripe' { requested?: boolean; } + interface BlikPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + interface BoletoPayments { /** * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. diff --git a/types/2020-08-27/Charges.d.ts b/types/2020-08-27/Charges.d.ts index 2682e7581e..e0dae6ed8b 100644 --- a/types/2020-08-27/Charges.d.ts +++ b/types/2020-08-27/Charges.d.ts @@ -405,6 +405,8 @@ declare module 'stripe' { bancontact?: PaymentMethodDetails.Bancontact; + blik?: PaymentMethodDetails.Blik; + boleto?: PaymentMethodDetails.Boleto; card?: PaymentMethodDetails.Card; @@ -672,6 +674,8 @@ declare module 'stripe' { type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index 2c7e7fc4ae..4548f3709f 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -296,7 +296,11 @@ declare module 'stripe' { * Session will determine whether to display an option to opt into promotional communication * from the merchant depending on the customer's locale. Only available to US merchants. */ - promotions: 'auto' | null; + promotions: ConsentCollection.Promotions | null; + } + + namespace ConsentCollection { + type Promotions = 'auto' | 'none'; } type CustomerCreation = 'always' | 'if_required'; @@ -1479,7 +1483,11 @@ declare module 'stripe' { * Session will determine whether to display an option to opt into promotional communication * from the merchant depending on the customer's locale. Only available to US merchants. */ - promotions?: 'auto'; + promotions?: ConsentCollection.Promotions; + } + + namespace ConsentCollection { + type Promotions = 'auto' | 'none'; } type CustomerCreation = 'always' | 'if_required'; @@ -2399,6 +2407,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'eps' diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index 936a734edc..8d63c58388 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -872,6 +872,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'card_present' diff --git a/types/2020-08-27/Issuing/Cards.d.ts b/types/2020-08-27/Issuing/Cards.d.ts index c937dfe53a..3255b004c0 100644 --- a/types/2020-08-27/Issuing/Cards.d.ts +++ b/types/2020-08-27/Issuing/Cards.d.ts @@ -40,7 +40,7 @@ declare module 'stripe' { created: number; /** - * 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). + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK. */ currency: string; diff --git a/types/2020-08-27/Mandates.d.ts b/types/2020-08-27/Mandates.d.ts index a6ad83a9d2..445a75371a 100644 --- a/types/2020-08-27/Mandates.d.ts +++ b/types/2020-08-27/Mandates.d.ts @@ -89,6 +89,8 @@ declare module 'stripe' { bacs_debit?: PaymentMethodDetails.BacsDebit; + blik?: PaymentMethodDetails.Blik; + card?: PaymentMethodDetails.Card; link?: PaymentMethodDetails.Link; @@ -162,6 +164,50 @@ declare module 'stripe' { type NetworkStatus = 'accepted' | 'pending' | 'refused' | 'revoked'; } + interface Blik { + /** + * Date at which the mandate expires. + */ + expires_after: number | null; + + off_session?: Blik.OffSession; + + /** + * Type of the mandate. + */ + type: Blik.Type | null; + } + + namespace Blik { + interface OffSession { + /** + * Amount of each recurring payment. + */ + amount: number | null; + + /** + * Currency of each recurring payment. + */ + currency: string | null; + + /** + * Frequency interval of each recurring payment. + */ + interval: OffSession.Interval | null; + + /** + * Frequency indicator of each recurring payment. + */ + interval_count: number | null; + } + + namespace OffSession { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type Type = 'off_session' | 'on_session'; + } + interface Card {} interface Link {} diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index e03fb46815..4ecad6ac1e 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -441,7 +441,7 @@ declare module 'stripe' { charge_attempt_at: number | null; /** - * For payments greater than INR 5000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required. + * For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required. */ customer_approval_required: boolean | null; } @@ -880,6 +880,8 @@ declare module 'stripe' { bancontact?: PaymentMethodOptions.Bancontact; + blik?: PaymentMethodOptions.Blik; + boleto?: PaymentMethodOptions.Boleto; card?: PaymentMethodOptions.Card; @@ -1081,6 +1083,8 @@ declare module 'stripe' { type SetupFutureUsage = 'none' | 'off_session'; } + interface Blik {} + interface Boleto { /** * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. @@ -1671,7 +1675,7 @@ declare module 'stripe' { namespace Card { interface CustomerNotification { /** - * Whether customer approval has been requested for this payment. For payments greater than INR 5000 or mandate amount, the customer must provide explicit approval of the payment with their bank. + * Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. */ approval_requested: boolean | null; @@ -1999,6 +2003,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodData.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -2188,6 +2197,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -2409,6 +2420,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'customer_balance' | 'eps' @@ -2502,6 +2514,11 @@ declare module 'stripe' { */ bancontact?: Stripe.Emptyable; + /** + * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + */ + blik?: Stripe.Emptyable; + /** * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. */ @@ -2795,6 +2812,13 @@ declare module 'stripe' { type SetupFutureUsage = 'none' | 'off_session'; } + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + interface Boleto { /** * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. @@ -3701,6 +3725,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodData.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -3890,6 +3919,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -4111,6 +4142,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'customer_balance' | 'eps' @@ -4204,6 +4236,11 @@ declare module 'stripe' { */ bancontact?: Stripe.Emptyable; + /** + * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + */ + blik?: Stripe.Emptyable; + /** * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. */ @@ -4497,6 +4534,13 @@ declare module 'stripe' { type SetupFutureUsage = 'none' | 'off_session'; } + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + interface Boleto { /** * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. @@ -5538,6 +5582,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodData.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -5727,6 +5776,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -5948,6 +5999,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'customer_balance' | 'eps' @@ -6041,6 +6093,11 @@ declare module 'stripe' { */ bancontact?: Stripe.Emptyable; + /** + * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + */ + blik?: Stripe.Emptyable; + /** * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. */ @@ -6334,6 +6391,13 @@ declare module 'stripe' { type SetupFutureUsage = 'none' | 'off_session'; } + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + interface Boleto { /** * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. diff --git a/types/2020-08-27/PaymentLinks.d.ts b/types/2020-08-27/PaymentLinks.d.ts index 0150b7feda..5a850b029c 100644 --- a/types/2020-08-27/PaymentLinks.d.ts +++ b/types/2020-08-27/PaymentLinks.d.ts @@ -163,7 +163,11 @@ declare module 'stripe' { /** * If set to `auto`, enables the collection of customer consent for promotional communications. */ - promotions: 'auto' | null; + promotions: ConsentCollection.Promotions | null; + } + + namespace ConsentCollection { + type Promotions = 'auto' | 'none'; } type CustomerCreation = 'always' | 'if_required'; @@ -193,6 +197,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'eps' @@ -672,7 +677,11 @@ declare module 'stripe' { * Session will determine whether to display an option to opt into promotional communication * from the merchant depending on the customer's locale. Only available to US merchants. */ - promotions?: 'auto'; + promotions?: ConsentCollection.Promotions; + } + + namespace ConsentCollection { + type Promotions = 'auto' | 'none'; } type CustomerCreation = 'always' | 'if_required'; @@ -748,6 +757,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'eps' @@ -1219,6 +1229,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'eps' diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index f6e28bc875..e917965d53 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -32,6 +32,8 @@ declare module 'stripe' { billing_details: PaymentMethod.BillingDetails; + blik?: PaymentMethod.Blik; + boleto?: PaymentMethod.Boleto; card?: PaymentMethod.Card; @@ -197,6 +199,8 @@ declare module 'stripe' { phone: string | null; } + interface Blik {} + interface Boleto { /** * Uniquely identifies the customer tax id (CNPJ or CPF) @@ -683,6 +687,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'card_present' @@ -813,6 +818,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodCreateParams.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodCreateParams.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -1022,6 +1032,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -1269,6 +1281,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'customer_balance' @@ -1358,6 +1371,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodUpdateParams.BillingDetails; + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + blik?: PaymentMethodUpdateParams.Blik; + /** * If this is a `card` PaymentMethod, this hash contains the user's card details. */ @@ -1426,6 +1444,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Card { /** * Two-digit number representing the card's expiration month. @@ -1480,6 +1500,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'card' | 'card_present' diff --git a/types/2020-08-27/SetupAttempts.d.ts b/types/2020-08-27/SetupAttempts.d.ts index 574d2155aa..44ad86e475 100644 --- a/types/2020-08-27/SetupAttempts.d.ts +++ b/types/2020-08-27/SetupAttempts.d.ts @@ -95,6 +95,8 @@ declare module 'stripe' { bancontact?: PaymentMethodDetails.Bancontact; + blik?: PaymentMethodDetails.Blik; + boleto?: PaymentMethodDetails.Boleto; card?: PaymentMethodDetails.Card; @@ -172,6 +174,8 @@ declare module 'stripe' { type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; } + interface Blik {} + interface Boleto {} interface Card { diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2020-08-27/SetupIntents.d.ts index eaa66bcaac..086febcce5 100644 --- a/types/2020-08-27/SetupIntents.d.ts +++ b/types/2020-08-27/SetupIntents.d.ts @@ -298,6 +298,8 @@ declare module 'stripe' { interface PaymentMethodOptions { acss_debit?: PaymentMethodOptions.AcssDebit; + blik?: PaymentMethodOptions.Blik; + card?: PaymentMethodOptions.Card; link?: PaymentMethodOptions.Link; @@ -363,6 +365,56 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Blik { + mandate_options?: Blik.MandateOptions; + } + + namespace Blik { + interface MandateOptions { + /** + * Date at which the mandate expires. + */ + expires_after: number | null; + + off_session?: MandateOptions.OffSession; + + /** + * Type of the mandate. + */ + type: MandateOptions.Type | null; + } + + namespace MandateOptions { + interface OffSession { + /** + * Amount of each recurring payment. + */ + amount: number | null; + + /** + * Currency of each recurring payment. + */ + currency: string | null; + + /** + * Frequency interval of each recurring payment. + */ + interval: OffSession.Interval | null; + + /** + * Frequency indicator of each recurring payment. + */ + interval_count: number | null; + } + + namespace OffSession { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type Type = 'off_session' | 'on_session'; + } + } + interface Card { /** * Configuration options for setting up an eMandate for cards issued in India. @@ -694,6 +746,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodData.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -883,6 +940,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -1104,6 +1163,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'customer_balance' | 'eps' @@ -1165,6 +1225,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodOptions.AcssDebit; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodOptions.Blik; + /** * Configuration for any card setup attempted on this SetupIntent. */ @@ -1247,6 +1312,13 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + interface Card { /** * Configuration options for setting up an eMandate for cards issued in India. @@ -1529,6 +1601,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodData.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -1718,6 +1795,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -1939,6 +2018,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'customer_balance' | 'eps' @@ -2000,6 +2080,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodOptions.AcssDebit; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodOptions.Blik; + /** * Configuration for any card setup attempted on this SetupIntent. */ @@ -2082,6 +2167,13 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + interface Card { /** * Configuration options for setting up an eMandate for cards issued in India. @@ -2446,6 +2538,11 @@ declare module 'stripe' { */ billing_details?: PaymentMethodData.BillingDetails; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + /** * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. */ @@ -2635,6 +2732,8 @@ declare module 'stripe' { } } + interface Blik {} + interface Boleto { /** * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) @@ -2856,6 +2955,7 @@ declare module 'stripe' { | 'au_becs_debit' | 'bacs_debit' | 'bancontact' + | 'blik' | 'boleto' | 'customer_balance' | 'eps' @@ -2917,6 +3017,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodOptions.AcssDebit; + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodOptions.Blik; + /** * Configuration for any card setup attempted on this SetupIntent. */ @@ -2999,6 +3104,13 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + interface Card { /** * Configuration options for setting up an eMandate for cards issued in India. diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index 6b9688c722..55f278e7c5 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -1820,6 +1820,23 @@ declare module 'stripe' { | 'unpaid'; } + interface SubscriptionCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + */ + invoice_now?: boolean; + + /** + * Will generate a proration invoice item that credits remaining unused time until the subscription period end. + */ + prorate?: boolean; + } + interface SubscriptionDeleteParams { /** * Specifies which fields in the response should be expanded. @@ -1907,6 +1924,23 @@ declare module 'stripe' { ): ApiListPromise; list(options?: RequestOptions): ApiListPromise; + /** + * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + * + * Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + * + * By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. + */ + cancel( + id: string, + params?: SubscriptionCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + /** * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. *