From 1d4344af5361422c1386a1abdc10ff271092b6ce Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Thu, 5 May 2022 09:22:57 -0400 Subject: [PATCH 01/25] API Updates (#1413) --- lib/resources.js | 4 + .../FinancialConnections/Accounts.js | 25 ++ .../FinancialConnections/Sessions.js | 20 ++ types/2020-08-27/Checkout/Sessions.d.ts | 42 +++ .../FinancialConnections/AccountOwners.d.ts | 52 +++ .../AccountOwnerships.d.ts | 32 ++ .../FinancialConnections/Accounts.d.ts | 311 ++++++++++++++++++ .../FinancialConnections/Sessions.d.ts | 185 +++++++++++ types/2020-08-27/Invoices.d.ts | 53 +++ types/2020-08-27/PaymentIntents.d.ts | 112 +++++++ types/2020-08-27/PaymentMethods.d.ts | 10 + types/2020-08-27/SetupIntents.d.ts | 112 +++++++ types/2020-08-27/Subscriptions.d.ts | 53 +++ types/2020-08-27/index.d.ts | 8 + 14 files changed, 1019 insertions(+) create mode 100644 lib/resources/FinancialConnections/Accounts.js create mode 100644 lib/resources/FinancialConnections/Sessions.js create mode 100644 types/2020-08-27/FinancialConnections/AccountOwners.d.ts create mode 100644 types/2020-08-27/FinancialConnections/AccountOwnerships.d.ts create mode 100644 types/2020-08-27/FinancialConnections/Accounts.d.ts create mode 100644 types/2020-08-27/FinancialConnections/Sessions.d.ts diff --git a/lib/resources.js b/lib/resources.js index dd9e534319..c949e2476a 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -63,6 +63,10 @@ module.exports = { Checkout: resourceNamespace('checkout', { Sessions: require('./resources/Checkout/Sessions'), }), + FinancialConnections: resourceNamespace('financialConnections', { + Accounts: require('./resources/FinancialConnections/Accounts'), + Sessions: require('./resources/FinancialConnections/Sessions'), + }), Identity: resourceNamespace('identity', { VerificationReports: require('./resources/Identity/VerificationReports'), VerificationSessions: require('./resources/Identity/VerificationSessions'), diff --git a/lib/resources/FinancialConnections/Accounts.js b/lib/resources/FinancialConnections/Accounts.js new file mode 100644 index 0000000000..2f3270f08a --- /dev/null +++ b/lib/resources/FinancialConnections/Accounts.js @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'financial_connections/accounts', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{account}', + }), + + disconnect: stripeMethod({ + method: 'POST', + path: '/{account}/disconnect', + }), + + refresh: stripeMethod({ + method: 'POST', + path: '/{account}/refresh', + }), +}); diff --git a/lib/resources/FinancialConnections/Sessions.js b/lib/resources/FinancialConnections/Sessions.js new file mode 100644 index 0000000000..0e968a437b --- /dev/null +++ b/lib/resources/FinancialConnections/Sessions.js @@ -0,0 +1,20 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'financial_connections/sessions', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{session}', + }), +}); diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index d957b00978..4bc1fc82af 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -535,6 +535,8 @@ declare module 'stripe' { } interface UsBankAccount { + financial_connections?: UsBankAccount.FinancialConnections; + /** * Bank account verification method. */ @@ -542,6 +544,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. The `payment_method` permission must be included. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant'; } } @@ -1658,6 +1680,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -1665,6 +1692,21 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant'; } diff --git a/types/2020-08-27/FinancialConnections/AccountOwners.d.ts b/types/2020-08-27/FinancialConnections/AccountOwners.d.ts new file mode 100644 index 0000000000..63488cca3e --- /dev/null +++ b/types/2020-08-27/FinancialConnections/AccountOwners.d.ts @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace FinancialConnections { + /** + * The AccountOwner object. + */ + interface AccountOwner { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'financial_connections.account_owner'; + + /** + * The email address of the owner. + */ + email: string | null; + + /** + * The full name of the owner. + */ + name: string; + + /** + * The ownership object that this owner belongs to. + */ + ownership: string; + + /** + * The raw phone number of the owner. + */ + phone: string | null; + + /** + * The raw physical address of the owner. + */ + raw_address: string | null; + + /** + * The timestamp of the refresh that updated this owner. + */ + refreshed_at: number | null; + } + } + } +} diff --git a/types/2020-08-27/FinancialConnections/AccountOwnerships.d.ts b/types/2020-08-27/FinancialConnections/AccountOwnerships.d.ts new file mode 100644 index 0000000000..bea129c359 --- /dev/null +++ b/types/2020-08-27/FinancialConnections/AccountOwnerships.d.ts @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace FinancialConnections { + /** + * The AccountOwnership object. + */ + interface AccountOwnership { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'financial_connections.account_ownership'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * A paginated list of owners for this account. + */ + owners: ApiList; + } + } + } +} diff --git a/types/2020-08-27/FinancialConnections/Accounts.d.ts b/types/2020-08-27/FinancialConnections/Accounts.d.ts new file mode 100644 index 0000000000..2df9ce4e7e --- /dev/null +++ b/types/2020-08-27/FinancialConnections/Accounts.d.ts @@ -0,0 +1,311 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace FinancialConnections { + /** + * The Account object. + */ + interface Account { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'financial_connections.account'; + + /** + * The account holder that this account belongs to. + */ + account_holder: Account.AccountHolder | null; + + /** + * The most recent information about the account's balance. + */ + balance: Account.Balance | null; + + /** + * The state of the most recent attempt to refresh the account balance. + */ + balance_refresh: Account.BalanceRefresh | null; + + /** + * The type of the account. Account category is further divided in `subcategory`. + */ + category: Account.Category; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * A human-readable name that has been assigned to this account, either by the account holder or by the institution. + */ + display_name: string | null; + + /** + * The name of the institution that holds this account. + */ + institution_name: string; + + /** + * The last 4 digits of the account number. If present, this will be 4 numeric characters. + */ + last4: string | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The most recent information about the account's owners. + */ + ownership: string | Stripe.FinancialConnections.AccountOwnership | null; + + /** + * The state of the most recent attempt to refresh the account owners. + */ + ownership_refresh: Account.OwnershipRefresh | null; + + /** + * The list of permissions granted by this account. + */ + permissions: Array | null; + + /** + * The status of the link to the account. + */ + status: Account.Status; + + /** + * If `category` is `cash`, one of: + * + * - `checking` + * - `savings` + * - `other` + * + * If `category` is `credit`, one of: + * + * - `mortgage` + * - `line_of_credit` + * - `credit_card` + * - `other` + * + * If `category` is `investment` or `other`, this will be `other`. + */ + subcategory: Account.Subcategory; + + /** + * The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. + */ + supported_payment_method_types: Array< + Account.SupportedPaymentMethodType + >; + } + + namespace Account { + interface AccountHolder { + /** + * The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. + */ + account?: string | Stripe.Account; + + /** + * ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. + */ + customer?: string | Stripe.Customer; + + /** + * Type of account holder that this account belongs to. + */ + type: AccountHolder.Type; + } + + namespace AccountHolder { + type Type = 'account' | 'customer'; + } + + interface Balance { + /** + * The time that the external institution calculated this balance. Measured in seconds since the Unix epoch. + */ + as_of: number; + + cash?: Balance.Cash; + + credit?: Balance.Credit; + + /** + * The balances owed to (or by) the account holder. + * + * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + */ + current: { + [key: string]: number; + }; + + /** + * The `type` of the balance. An additional hash is included on the balance with a name matching this value. + */ + type: Balance.Type; + } + + namespace Balance { + interface Cash { + /** + * The funds available to the account holder. Typically this is the current balance less any holds. + * + * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + */ + available: { + [key: string]: number; + } | null; + } + + interface Credit { + /** + * The credit that has been used by the account holder. + * + * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + */ + used: { + [key: string]: number; + } | null; + } + + type Type = 'cash' | 'credit'; + } + + interface BalanceRefresh { + /** + * The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + */ + last_attempted_at: number; + + /** + * The status of the last refresh attempt. + */ + status: BalanceRefresh.Status; + } + + namespace BalanceRefresh { + type Status = 'failed' | 'pending' | 'succeeded'; + } + + type Category = 'cash' | 'credit' | 'investment' | 'other'; + + interface OwnershipRefresh { + /** + * The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + */ + last_attempted_at: number; + + /** + * The status of the last refresh attempt. + */ + status: OwnershipRefresh.Status; + } + + namespace OwnershipRefresh { + type Status = 'failed' | 'pending' | 'succeeded'; + } + + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + + type Status = 'active' | 'disconnected' | 'inactive'; + + type Subcategory = + | 'checking' + | 'credit_card' + | 'line_of_credit' + | 'mortgage' + | 'other' + | 'savings'; + + type SupportedPaymentMethodType = 'link' | 'us_bank_account'; + } + + interface AccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountDisconnectParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountRefreshParams { + /** + * The list of account features that you would like to refresh. Either: `balance` or `ownership`. + */ + features: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace AccountRefreshParams { + type Feature = 'balance' | 'ownership'; + } + + class AccountsResource { + /** + * Retrieves the details of an Financial Connections Account. + */ + retrieve( + id: string, + params?: AccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + */ + disconnect( + id: string, + params?: AccountDisconnectParams, + options?: RequestOptions + ): Promise>; + disconnect( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Refreshes the data associated with a Financial Connections Account. + */ + refresh( + id: string, + params: AccountRefreshParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/FinancialConnections/Sessions.d.ts b/types/2020-08-27/FinancialConnections/Sessions.d.ts new file mode 100644 index 0000000000..a58f8d0cb2 --- /dev/null +++ b/types/2020-08-27/FinancialConnections/Sessions.d.ts @@ -0,0 +1,185 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace FinancialConnections { + /** + * The Session object. + */ + interface Session { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'financial_connections.session'; + + /** + * The account holder for whom accounts are collected in this session. + */ + account_holder: Session.AccountHolder | null; + + /** + * The accounts that were collected as part of this Session. + */ + accounts: ApiList; + + /** + * A value that will be passed to the client to launch the authentication flow. + */ + client_secret: string; + + filters?: Session.Filters; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Permissions requested for accounts collected during this session. + */ + permissions: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace Session { + interface AccountHolder { + /** + * The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. + */ + account?: string | Stripe.Account; + + /** + * ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. + */ + customer?: string | Stripe.Customer; + + /** + * Type of account holder that this account belongs to. + */ + type: AccountHolder.Type; + } + + namespace AccountHolder { + type Type = 'account' | 'customer'; + } + + interface Filters { + /** + * List of countries from which to filter accounts. + */ + countries: Array | null; + } + + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface SessionCreateParams { + /** + * The account holder to link accounts for. + */ + account_holder: SessionCreateParams.AccountHolder; + + /** + * List of data features that you would like to request access to. + * + * Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. + */ + permissions: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Filters to restrict the kinds of accounts to collect. + */ + filters?: SessionCreateParams.Filters; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace SessionCreateParams { + interface AccountHolder { + /** + * The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. + */ + account?: string; + + /** + * The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. + */ + customer?: string; + + /** + * Type of account holder to collect accounts for. + */ + type: AccountHolder.Type; + } + + namespace AccountHolder { + type Type = 'account' | 'customer'; + } + + interface Filters { + /** + * List of countries from which to collect accounts. + */ + countries: Array; + } + + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface SessionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class SessionsResource { + /** + * To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. + */ + create( + params: SessionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a Financial Connections Session + */ + retrieve( + id: string, + params?: SessionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index e7bbd5fb84..3d6e97310c 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -706,6 +706,8 @@ declare module 'stripe' { interface Konbini {} interface UsBankAccount { + financial_connections?: UsBankAccount.FinancialConnections; + /** * Bank account verification method. */ @@ -713,6 +715,17 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. The `payment_method` permission must be included. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = 'balances' | 'payment_method' | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -1134,6 +1147,11 @@ declare module 'stripe' { interface Konbini {} interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -1141,6 +1159,21 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -1454,6 +1487,11 @@ declare module 'stripe' { interface Konbini {} interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -1461,6 +1499,21 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 581f3b9bfd..5cd2f540ee 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -1364,6 +1364,8 @@ declare module 'stripe' { } interface UsBankAccount { + financial_connections?: UsBankAccount.FinancialConnections; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -1380,6 +1382,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. The `payment_method` permission must be included. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; @@ -2160,6 +2182,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ @@ -2972,6 +2999,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -2990,6 +3022,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; @@ -3649,6 +3701,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ @@ -4461,6 +4518,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -4479,6 +4541,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; @@ -5275,6 +5357,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ @@ -6087,6 +6174,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -6105,6 +6197,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index 81d279ac6f..7b7d9e44f6 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -684,6 +684,11 @@ declare module 'stripe' { */ bank_name: string | null; + /** + * The ID of the Financial Connections Account used to create the payment method. + */ + financial_connections_account?: string | null; + /** * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. */ @@ -1206,6 +1211,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2020-08-27/SetupIntents.d.ts index 5b9313dfd6..540b3f2b6e 100644 --- a/types/2020-08-27/SetupIntents.d.ts +++ b/types/2020-08-27/SetupIntents.d.ts @@ -428,6 +428,8 @@ declare module 'stripe' { } interface UsBankAccount { + financial_connections?: UsBankAccount.FinancialConnections; + /** * Bank account verification method. */ @@ -435,6 +437,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. The `payment_method` permission must be included. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -1023,6 +1045,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ @@ -1214,6 +1241,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -1221,6 +1253,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -1748,6 +1800,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ @@ -1939,6 +1996,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -1946,6 +2008,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -2564,6 +2646,11 @@ declare module 'stripe' { */ account_type?: UsBankAccount.AccountType; + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + /** * Routing number of the bank account. */ @@ -2755,6 +2842,11 @@ declare module 'stripe' { } interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -2762,6 +2854,26 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index d3f2a39a35..df1105347a 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -380,6 +380,8 @@ declare module 'stripe' { interface Konbini {} interface UsBankAccount { + financial_connections?: UsBankAccount.FinancialConnections; + /** * Bank account verification method. */ @@ -387,6 +389,17 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. The `payment_method` permission must be included. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = 'balances' | 'payment_method' | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -965,6 +978,11 @@ declare module 'stripe' { interface Konbini {} interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -972,6 +990,21 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -1555,6 +1588,11 @@ declare module 'stripe' { interface Konbini {} interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + /** * Verification method for the intent */ @@ -1562,6 +1600,21 @@ declare module 'stripe' { } namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } diff --git a/types/2020-08-27/index.d.ts b/types/2020-08-27/index.d.ts index d8a87ad1ad..7161b24530 100644 --- a/types/2020-08-27/index.d.ts +++ b/types/2020-08-27/index.d.ts @@ -42,6 +42,10 @@ /// /// /// +/// +/// +/// +/// /// /// /// @@ -188,6 +192,10 @@ declare module 'stripe' { checkout: { sessions: Stripe.Checkout.SessionsResource; }; + financialConnections: { + accounts: Stripe.FinancialConnections.AccountsResource; + sessions: Stripe.FinancialConnections.SessionsResource; + }; identity: { verificationReports: Stripe.Identity.VerificationReportsResource; verificationSessions: Stripe.Identity.VerificationSessionsResource; From 59e81999d44b9b0d17cd185adbfc2f857f11879a Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Thu, 5 May 2022 09:26:18 -0400 Subject: [PATCH 02/25] Bump version to 8.221.0 --- CHANGELOG.md | 14 ++++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b9c4343c7..55a294756c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # CHANGELOG +## 8.221.0 - 2022-05-05 +* [#1413](https://github.com/stripe/stripe-node/pull/1413) API Updates + * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` + * Add support for `financial_connections` on `Checkout.Session.payment_method_options.us_bank_account`, `CheckoutSessionCreateParams.payment_method_options.us_bank_account`, `Invoice.payment_settings.payment_method_options.us_bank_account`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account`, `PaymentIntent.payment_method_options.us_bank_account`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `SetupIntent.payment_method_options.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, `SetupIntentUpdateParams.payment_method_options.us_bank_account`, `Subscription.payment_settings.payment_method_options.us_bank_account`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account` + * Add support for `financial_connections_account` on `PaymentIntentConfirmParams.payment_method_data.us_bank_account`, `PaymentIntentCreateParams.payment_method_data.us_bank_account`, `PaymentIntentUpdateParams.payment_method_data.us_bank_account`, `PaymentMethod.us_bank_account`, `PaymentMethodCreateParams.us_bank_account`, `SetupIntentConfirmParams.payment_method_data.us_bank_account`, `SetupIntentCreateParams.payment_method_data.us_bank_account`, and `SetupIntentUpdateParams.payment_method_data.us_bank_account` + +* [#1410](https://github.com/stripe/stripe-node/pull/1410) API Updates + * Add support for `registered_address` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `Person`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person` + * Change type of `PaymentIntent.amount_details.tip.amount` from `nullable(integer)` to `integer` + * Change `PaymentIntent.amount_details.tip.amount` to be optional + * Add support for `payment_method_data` on `SetupIntentConfirmParams`, `SetupIntentCreateParams`, and `SetupIntentUpdateParams` +* [#1409](https://github.com/stripe/stripe-node/pull/1409) Update autoPagination tests to be hermetic. +* [#1411](https://github.com/stripe/stripe-node/pull/1411) Enable CI on beta branch + ## 8.220.0 - 2022-05-03 * [#1407](https://github.com/stripe/stripe-node/pull/1407) API Updates * Add support for new resource `CashBalance` diff --git a/VERSION b/VERSION index 81c2443469..c13e129a50 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.220.0 +8.221.0 diff --git a/package.json b/package.json index b284edfcaf..5fb940fa14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "8.220.0", + "version": "8.221.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From ffe44f552edc7e8eab8e383c848b79157e7c2c70 Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Thu, 5 May 2022 09:53:45 -0400 Subject: [PATCH 03/25] API Updates (#1414) --- types/2020-08-27/Products.d.ts | 62 ++++++++++++++++++++++++++++++++++ types/2020-08-27/Refunds.d.ts | 7 ++++ 2 files changed, 69 insertions(+) diff --git a/types/2020-08-27/Products.d.ts b/types/2020-08-27/Products.d.ts index 5c14fb7a69..56cf520f20 100644 --- a/types/2020-08-27/Products.d.ts +++ b/types/2020-08-27/Products.d.ts @@ -41,6 +41,11 @@ declare module 'stripe' { */ deactivate_on?: Array; + /** + * The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + */ + default_price?: string | Stripe.Price | null; + deleted?: void; /** @@ -181,6 +186,11 @@ declare module 'stripe' { */ deactivate_on?: Array; + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product. + */ + default_price_data?: ProductCreateParams.DefaultPriceData; + /** * The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. */ @@ -246,6 +256,53 @@ declare module 'stripe' { } namespace ProductCreateParams { + interface DefaultPriceData { + /** + * 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; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring?: DefaultPriceData.Recurring; + + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: DefaultPriceData.TaxBehavior; + + /** + * A positive integer in %s (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace DefaultPriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + interface PackageDimensions { /** * Height, in inches. Maximum precision is 2 decimal places. @@ -299,6 +356,11 @@ declare module 'stripe' { */ deactivate_on?: Array; + /** + * The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + */ + default_price?: string; + /** * The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. */ diff --git a/types/2020-08-27/Refunds.d.ts b/types/2020-08-27/Refunds.d.ts index 5cba688748..ec3fe3705d 100644 --- a/types/2020-08-27/Refunds.d.ts +++ b/types/2020-08-27/Refunds.d.ts @@ -56,6 +56,11 @@ declare module 'stripe' { */ failure_reason?: string; + /** + * Email to which refund instructions, if required, are sent to. + */ + instructions_email?: string; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. */ @@ -149,6 +154,8 @@ declare module 'stripe' { */ expand?: Array; + instructions_email?: string; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ From 0bf569b027c3330cd87e3c767a14e449d5af9926 Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Thu, 5 May 2022 13:16:14 -0400 Subject: [PATCH 04/25] Bump version to 8.222.0 --- CHANGELOG.md | 7 +++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a294756c..5b5e85aa6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## 8.222.0 - 2022-05-05 +* [#1414](https://github.com/stripe/stripe-node/pull/1414) API Updates + * Add support for `default_price_data` on `ProductCreateParams` + * Add support for `default_price` on `ProductUpdateParams` and `Product` + * Add support for `instructions_email` on `RefundCreateParams` and `Refund` + + ## 8.221.0 - 2022-05-05 * [#1413](https://github.com/stripe/stripe-node/pull/1413) API Updates * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` diff --git a/VERSION b/VERSION index c13e129a50..61785b063c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.221.0 +8.222.0 diff --git a/package.json b/package.json index 5fb940fa14..680bce89f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "8.221.0", + "version": "8.222.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 7cdf0667289fe25c1ef55e14d645f992a92a69d1 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Mon, 9 May 2022 15:24:12 -0400 Subject: [PATCH 05/25] API Updates (#1415) --- lib/resources.js | 1 - lib/resources/OrderReturns.js | 21 - lib/resources/Orders.js | 19 +- test/resources/OrderReturns.spec.js | 47 - test/resources/Orders.spec.js | 133 - .../resources/generated_examples_test.spec.js | 143 +- types/2020-08-27/Charges.d.ts | 7 +- types/2020-08-27/Checkout/Sessions.d.ts | 2 +- types/2020-08-27/Customers.d.ts | 2 +- types/2020-08-27/Invoices.d.ts | 2 +- types/2020-08-27/LineItems.d.ts | 17 + types/2020-08-27/OrderItems.d.ts | 45 - types/2020-08-27/OrderReturns.d.ts | 103 - types/2020-08-27/Orders.d.ts | 2993 +++++++++++++++-- types/2020-08-27/PaymentIntents.d.ts | 2 +- types/2020-08-27/Sources.d.ts | 2 +- types/2020-08-27/index.d.ts | 3 - 17 files changed, 2805 insertions(+), 737 deletions(-) delete mode 100644 lib/resources/OrderReturns.js delete mode 100644 test/resources/OrderReturns.spec.js delete mode 100644 test/resources/Orders.spec.js delete mode 100644 types/2020-08-27/OrderItems.d.ts delete mode 100644 types/2020-08-27/OrderReturns.d.ts diff --git a/lib/resources.js b/lib/resources.js index c949e2476a..46e3705947 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -30,7 +30,6 @@ module.exports = { Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), Orders: require('./resources/Orders'), - OrderReturns: require('./resources/OrderReturns'), PaymentIntents: require('./resources/PaymentIntents'), PaymentLinks: require('./resources/PaymentLinks'), PaymentMethods: require('./resources/PaymentMethods'), diff --git a/lib/resources/OrderReturns.js b/lib/resources/OrderReturns.js deleted file mode 100644 index 4a54818362..0000000000 --- a/lib/resources/OrderReturns.js +++ /dev/null @@ -1,21 +0,0 @@ -// File generated from our OpenAPI spec - -'use strict'; - -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; - -module.exports = StripeResource.extend({ - path: 'order_returns', - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), -}); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js index df456424dd..a216b32fc7 100644 --- a/lib/resources/Orders.js +++ b/lib/resources/Orders.js @@ -29,13 +29,24 @@ module.exports = StripeResource.extend({ methodType: 'list', }), - pay: stripeMethod({ + cancel: stripeMethod({ method: 'POST', - path: '/{id}/pay', + path: '/{id}/cancel', }), - returnOrder: stripeMethod({ + listLineItems: stripeMethod({ + method: 'GET', + path: '/{id}/line_items', + methodType: 'list', + }), + + reopen: stripeMethod({ + method: 'POST', + path: '/{id}/reopen', + }), + + submit: stripeMethod({ method: 'POST', - path: '/{id}/returns', + path: '/{id}/submit', }), }); diff --git a/test/resources/OrderReturns.spec.js b/test/resources/OrderReturns.spec.js deleted file mode 100644 index 7e265132f1..0000000000 --- a/test/resources/OrderReturns.spec.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils').getSpyableStripe(); -const expect = require('chai').expect; - -describe('OrderReturn Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.orderReturns.retrieve('orderReturnIdFoo123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/order_returns/orderReturnIdFoo123', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.orderReturns.list({ - limit: 3, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/order_returns?limit=3', - data: {}, - headers: {}, - settings: {}, - }); - }); - - it('Supports filtering by order', () => { - stripe.orderReturns.list({ - order: 'orderIdFoo123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/order_returns?order=orderIdFoo123', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Orders.spec.js b/test/resources/Orders.spec.js deleted file mode 100644 index 41c50c2fb0..0000000000 --- a/test/resources/Orders.spec.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Order Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.orders.retrieve('orderIdFoo123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/orders/orderIdFoo123', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.orders.create({ - currency: 'usd', - items: [ - { - type: 'sku', - parent: 'skuIdFoo123', - }, - ], - shipping: { - name: 'Jane Rosen', - address: { - line1: 'foo', - }, - }, - email: 'jane@ros.en', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/orders', - data: { - currency: 'usd', - items: [ - { - type: 'sku', - parent: 'skuIdFoo123', - }, - ], - shipping: { - name: 'Jane Rosen', - address: { - line1: 'foo', - }, - }, - email: 'jane@ros.en', - }, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.orders.list({ - limit: 3, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/orders?limit=3', - data: {}, - headers: {}, - settings: {}, - }); - }); - - it('Supports filtering by status', () => { - stripe.orders.list({ - status: 'active', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/orders?status=active', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('pay', () => { - it('Sends the correct request', () => { - stripe.orders.pay('orderIdFoo3242', { - source: 'tok_FooBar', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/orders/orderIdFoo3242/pay', - headers: {}, - data: {source: 'tok_FooBar'}, - settings: {}, - }); - }); - }); - - describe('returnOrder', () => { - it('Sends the correct request', () => { - stripe.orders.returnOrder('orderIdFoo3242', { - items: [{parent: 'sku_123'}], - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/orders/orderIdFoo3242/returns', - headers: {}, - data: {items: [{parent: 'sku_123'}]}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.orders.update('orderIdFoo3242', {status: 'fulfilled'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/orders/orderIdFoo3242', - headers: {}, - data: {status: 'fulfilled'}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index a0d883209c..d10bc61426 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -1848,65 +1848,6 @@ describe('Terminal.Reader', function() { }); }); -describe('Order', function() { - it('create method', async function() { - const order = await stripe.orders.create({ - currency: 'usd', - email: 'jenny.rosen@example.com', - items: [{type: 'sku', parent: 'sku_xxxxxxxxxxxxx'}], - shipping: { - name: 'Jenny Rosen', - address: { - line1: '1234 Main Street', - city: 'San Francisco', - state: 'CA', - country: 'US', - postal_code: '94111', - }, - }, - }); - expect(order).not.to.be.null; - }); - - it('retrieve method', async function() { - const order = await stripe.orders.retrieve('or_xxxxxxxxxxxxx'); - expect(order).not.to.be.null; - }); - - it('update method', async function() { - const order = await stripe.orders.update('or_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(order).not.to.be.null; - }); - - it('pay method', async function() { - const order = await stripe.orders.pay('or_xxxxxxxxxxxxx', { - source: 'tok_xxxx', - }); - expect(order).not.to.be.null; - }); - - it('list method', async function() { - const orders = await stripe.orders.list({limit: 3}); - expect(orders).not.to.be.null; - }); -}); - -describe('OrderReturn', function() { - it('retrieve method', async function() { - const orderReturn = await stripe.orderReturns.retrieve( - 'orret_xxxxxxxxxxxxx' - ); - expect(orderReturn).not.to.be.null; - }); - - it('list method', async function() { - const orderReturns = await stripe.orderReturns.list({limit: 3}); - expect(orderReturns).not.to.be.null; - }); -}); - describe('Sku', function() { it('create method', async function() { const sku = await stripe.skus.create({ @@ -2127,3 +2068,87 @@ describe('Terminal.Configuration', function() { expect(deleted).not.to.be.null; }); }); + +describe('Order', function() { + it('create method', async function() { + const order = await stripe.orders.create({ + description: 'description', + currency: 'usd', + line_items: [{description: 'my line item'}], + }); + expect(order).not.to.be.null; + }); + + it('update method', async function() { + const order = await stripe.orders.update('order_xyz'); + expect(order).not.to.be.null; + }); + + it('listLineItems method', async function() { + const lineItems = await stripe.orders.listLineItems('order_xyz'); + expect(lineItems).not.to.be.null; + }); + + it('cancel method', async function() { + const order = await stripe.orders.cancel('order_xyz'); + expect(order).not.to.be.null; + }); + + it('reopen method', async function() { + const order = await stripe.orders.reopen('order_xyz'); + expect(order).not.to.be.null; + }); + + it('submit method', async function() { + const order = await stripe.orders.submit('order_xyz', { + expected_total: 100, + }); + expect(order).not.to.be.null; + }); + + it('update method', async function() { + const order = await stripe.orders.update('order_xyz'); + expect(order).not.to.be.null; + }); +}); + +describe('FinancialConnections.Account', function() { + it('retrieve method', async function() { + const account = await stripe.financialConnections.accounts.retrieve( + 'fca_xyz' + ); + expect(account).not.to.be.null; + }); + + it('refresh method', async function() { + const account = await stripe.financialConnections.accounts.refresh( + 'fca_xyz', + {features: ['balance']} + ); + expect(account).not.to.be.null; + }); + + it('disconnect method', async function() { + const account = await stripe.financialConnections.accounts.disconnect( + 'fca_xyz' + ); + expect(account).not.to.be.null; + }); +}); + +describe('FinancialConnections.Session', function() { + it('create method', async function() { + const session = await stripe.financialConnections.sessions.create({ + account_holder: {type: 'customer', customer: 'cus_123'}, + permissions: ['balances'], + }); + expect(session).not.to.be.null; + }); + + it('retrieve method', async function() { + const session = await stripe.financialConnections.sessions.retrieve( + 'fcsess_xyz' + ); + expect(session).not.to.be.null; + }); +}); diff --git a/types/2020-08-27/Charges.d.ts b/types/2020-08-27/Charges.d.ts index 883e4af496..bca649c06c 100644 --- a/types/2020-08-27/Charges.d.ts +++ b/types/2020-08-27/Charges.d.ts @@ -147,11 +147,6 @@ declare module 'stripe' { */ on_behalf_of: string | Stripe.Account | null; - /** - * ID of the order this charge is for if one exists. - */ - order: string | Stripe.Order | null; - /** * Details about whether the payment was accepted, and why. See [understanding declines](https://stripe.com/docs/declines) for details. */ @@ -1723,7 +1718,7 @@ declare module 'stripe' { /** * Recipient name. */ - name?: string | null; + name?: string; /** * Recipient phone (including extension). diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index 4bc1fc82af..b4f0f2c735 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -588,7 +588,7 @@ declare module 'stripe' { /** * Recipient name. */ - name?: string | null; + name?: string; /** * Recipient phone (including extension). diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index 6ad88013b3..f1070a1a18 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -185,7 +185,7 @@ declare module 'stripe' { /** * Recipient name. */ - name?: string | null; + name?: string; /** * Recipient phone (including extension). diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index 3d6e97310c..5ac7c9c39d 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -401,7 +401,7 @@ declare module 'stripe' { /** * Recipient name. */ - name?: string | null; + name?: string; /** * Recipient phone (including extension). diff --git a/types/2020-08-27/LineItems.d.ts b/types/2020-08-27/LineItems.d.ts index a5ddfe5251..beb2b87f50 100644 --- a/types/2020-08-27/LineItems.d.ts +++ b/types/2020-08-27/LineItems.d.ts @@ -16,11 +16,21 @@ declare module 'stripe' { */ object: 'item'; + /** + * Total discount amount applied. If no discounts were applied, defaults to 0. + */ + amount_discount?: number; + /** * Total before any discounts or taxes are applied. */ amount_subtotal: number; + /** + * Total tax amount applied. If no tax was applied, defaults to 0. + */ + amount_tax?: number; + /** * Total after discounts and taxes. */ @@ -46,6 +56,13 @@ declare module 'stripe' { */ price: Stripe.Price | null; + /** + * The ID of the product for this line item. + * + * This will always be the same as `price.product`. + */ + product?: string | Stripe.Product | Stripe.DeletedProduct; + /** * The quantity of products being purchased. */ diff --git a/types/2020-08-27/OrderItems.d.ts b/types/2020-08-27/OrderItems.d.ts deleted file mode 100644 index d353f863a1..0000000000 --- a/types/2020-08-27/OrderItems.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - /** - * The OrderItem object. - */ - interface OrderItem { - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'order_item'; - - /** - * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the line item. - */ - amount: 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). - */ - currency: string; - - /** - * Description of the line item, meant to be displayable to the user (e.g., `"Express shipping"`). - */ - description: string; - - /** - * The ID of the associated object for this line item. Expandable if not null (e.g., expandable to a SKU). - */ - parent: string | Stripe.Sku | null; - - /** - * A positive integer representing the number of instances of `parent` that are included in this order item. Applicable/present only if `type` is `sku`. - */ - quantity: number | null; - - /** - * The type of line item. One of `sku`, `tax`, `shipping`, or `discount`. - */ - type: string; - } - } -} diff --git a/types/2020-08-27/OrderReturns.d.ts b/types/2020-08-27/OrderReturns.d.ts deleted file mode 100644 index bbb15415c5..0000000000 --- a/types/2020-08-27/OrderReturns.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - /** - * The OrderReturn object. - */ - interface OrderReturn { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'order_return'; - - /** - * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. - */ - amount: number; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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). - */ - currency: string; - - /** - * The items included in this order return. - */ - items: Array; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * The order that this return includes items from. - */ - order: string | Stripe.Order | null; - - /** - * The ID of the refund issued for this return. - */ - refund: string | Stripe.Refund | null; - } - - interface OrderReturnRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderReturnListParams extends PaginationParams { - /** - * Date this return was created. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The order to retrieve returns for. - */ - order?: string; - } - - class OrderReturnsResource { - /** - * Retrieves the details of an existing order return. Supply the unique order ID from either an order return creation request or the order return list, and Stripe will return the corresponding order information. - */ - retrieve( - id: string, - params?: OrderReturnRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your order returns. The returns are returned sorted by creation date, with the most recently created return appearing first. - */ - list( - params?: OrderReturnListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } - } -} diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index ebbeeb6d32..fab8c1465e 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -17,29 +17,26 @@ declare module 'stripe' { object: 'order'; /** - * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + * Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). */ - amount: number; + amount_subtotal: number; /** - * The total amount that was returned to the customer. + * Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). */ - amount_returned: number | null; + amount_total: number; /** - * ID of the Connect Application that created the order. + * ID of the Connect application that created the Order, if any. */ - application: string | null; + application: string | Stripe.Application | null; - /** - * A fee in cents that will be applied to the order and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. - */ - application_fee: number | null; + automatic_tax?: Order.AutomaticTax; /** - * The ID of the payment used to pay for the order. Present if the order status is `paid`, `fulfilled`, or `refunded`. + * Customer billing details associated with the order. */ - charge: string | Stripe.Charge | null; + billing_details: Order.BillingDetails | null; /** * Time at which the object was created. Measured in seconds since the Unix epoch. @@ -52,24 +49,29 @@ declare module 'stripe' { currency: string; /** - * The customer used for the order. + * The customer which this orders belongs to. */ customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; /** - * The email address of the customer placing the order. + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The discounts applied to the order. Use `expand[]=discounts` to expand each discount. */ - email: string | null; + discounts: Array | null; /** - * External coupon code to load for this order. + * A recent IP address of the purchaser used for tax reporting and tax location inference. */ - external_coupon_code?: string; + ip_address: string | null; /** - * List of items constituting the order. An order can have up to 25 items. + * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. */ - items: Array; + line_items?: ApiList; /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. @@ -81,495 +83,2866 @@ declare module 'stripe' { */ metadata: Stripe.Metadata | null; - /** - * A list of returns that have taken place for this order. - */ - returns: ApiList | null; - - /** - * The shipping method that is currently selected for this order, if any. If present, it is equal to one of the `id`s of shipping methods in the `shipping_methods` array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. - */ - selected_shipping_method: string | null; - - /** - * The shipping address for the order. Present if the order is for goods to be shipped. - */ - shipping: Order.Shipping | null; + payment: Order.Payment; /** - * A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. + * The details of the customer cost of shipping, including the customer chosen ShippingRate. */ - shipping_methods: Array | null; + shipping_cost: Order.ShippingCost | null; /** - * Current order status. One of `created`, `paid`, `canceled`, `fulfilled`, or `returned`. More details in the [Orders Guide](https://stripe.com/docs/orders/guide#understanding-order-statuses). + * Customer shipping information associated with the order. */ - status: string; + shipping_details: Order.ShippingDetails | null; /** - * The timestamps at which the order status was updated. + * The overall status of the order. */ - status_transitions: Order.StatusTransitions | null; + status: Order.Status; - /** - * Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ - updated: number | null; + tax_details?: Order.TaxDetails; - /** - * The user's order ID if it is different from the Stripe order ID. - */ - upstream_id?: string; + total_details: Order.TotalDetails; } namespace Order { - interface Shipping { - address?: Stripe.Address; - + interface AutomaticTax { /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + * Whether Stripe automatically computes tax on this Order. */ - carrier?: string | null; + enabled: boolean; /** - * Recipient name. + * The status of the most recent automated tax calculation for this Order. */ - name?: string | null; + status: AutomaticTax.Status | null; + } + namespace AutomaticTax { + type Status = 'complete' | 'failed' | 'requires_location_inputs'; + } + + interface BillingDetails { /** - * Recipient phone (including extension). + * Billing address for the order. */ - phone?: string | null; + address: Stripe.Address | null; /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + * Email address for the order. */ - tracking_number?: string | null; - } + email: string | null; - interface ShippingMethod { /** - * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the line item. + * Full name for the order. */ - amount: number; + name: string | null; /** - * 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). + * Billing phone number for the order (including extension). */ - currency: string; + phone: string | null; + } + interface Payment { /** - * The estimated delivery date for the given shipping method. Can be either a specific date or a range. + * ID of the payment intent associated with this order. Null when the order is `open`. */ - delivery_estimate: ShippingMethod.DeliveryEstimate | null; + payment_intent: string | Stripe.PaymentIntent | null; /** - * An arbitrary string attached to the object. Often useful for displaying to users. + * Settings describing how the order should configure generated PaymentIntents. */ - description: string; + settings: Payment.Settings | null; /** - * Unique identifier for the object. + * The status of the underlying payment associated with this order, if any. Null when the order is `open`. */ - id: string; + status: Payment.Status | null; } - namespace ShippingMethod { - interface DeliveryEstimate { + namespace Payment { + interface Settings { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + */ + application_fee_amount: number | null; + + /** + * PaymentMethod-specific configuration to provide to the order's PaymentIntent. + */ + payment_method_options: Settings.PaymentMethodOptions | null; + + /** + * The list of payment method types (e.g., card) to provide to the order's PaymentIntent. + */ + payment_method_types: Array | null; + /** - * If `type` is `"exact"`, `date` will be the expected delivery date in the format YYYY-MM-DD. + * The URL to redirect the customer to after they authenticate their payment. */ - date?: string; + return_url: string | null; /** - * If `type` is `"range"`, `earliest` will be be the earliest delivery date in the format YYYY-MM-DD. + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. */ - earliest?: string; + statement_descriptor: string | null; /** - * If `type` is `"range"`, `latest` will be the latest delivery date in the format YYYY-MM-DD. + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. */ - latest?: string; + statement_descriptor_suffix: string | null; /** - * The type of estimate. Must be either `"range"` or `"exact"`. + * Provides configuration for completing a transfer for the order after it is paid. */ - type: string; + transfer_data: Settings.TransferData | null; + } + + namespace Settings { + interface PaymentMethodOptions { + acss_debit?: PaymentMethodOptions.AcssDebit; + + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + + alipay?: PaymentMethodOptions.Alipay; + + bancontact?: PaymentMethodOptions.Bancontact; + + card?: PaymentMethodOptions.Card; + + customer_balance?: PaymentMethodOptions.CustomerBalance; + + ideal?: PaymentMethodOptions.Ideal; + + klarna?: PaymentMethodOptions.Klarna; + + link?: PaymentMethodOptions.Link; + + oxxo?: PaymentMethodOptions.Oxxo; + + p24?: PaymentMethodOptions.P24; + + paypal?: PaymentMethodOptions.Paypal; + + sepa_debit?: PaymentMethodOptions.SepaDebit; + + sofort?: PaymentMethodOptions.Sofort; + + wechat_pay?: PaymentMethodOptions.WechatPay; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AcssDebit.SetupFutureUsage; + + /** + * Bank account verification method. + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text + */ + custom_mandate_url?: string; + + /** + * Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description: string | null; + + /** + * Payment schedule for the mandate. + */ + payment_schedule: MandateOptions.PaymentSchedule | null; + + /** + * Transaction type of the mandate. + */ + transaction_type: MandateOptions.TransactionType | null; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = + | 'automatic' + | 'instant' + | 'microdeposits'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: AfterpayClearpay.CaptureMethod; + + /** + * Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference: string | null; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace AfterpayClearpay { + type CaptureMethod = 'automatic' | 'manual'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Alipay.SetupFutureUsage; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Bancontact.SetupFutureUsage; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method: Card.CaptureMethod; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CustomerBalance { + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type: 'bank_transfer' | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `zengin`. + */ + requested_address_types?: Array<'zengin'>; + + /** + * The bank transfer type that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + */ + type: BankTransfer.Type | null; + } + + namespace BankTransfer { + type Type = + | 'eu_bank_account' + | 'eu_bank_transfer' + | 'gb_bank_account' + | 'gb_bank_transfer' + | 'id_bank_account' + | 'id_bank_transfer' + | 'jp_bank_account' + | 'jp_bank_transfer' + | 'mx_bank_account' + | 'mx_bank_transfer' + | 'us_bank_account' + | 'us_bank_transfer'; + } + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Ideal.SetupFutureUsage; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Preferred locale of the Klarna checkout page that the customer is redirected to. + */ + preferred_locale: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Token used for persistent Link logins. + */ + persistent_token: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Link.SetupFutureUsage; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Paypal { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Preferred locale of the PayPal checkout page that the customer is redirected to. + */ + preferred_locale: string | null; + } + + interface SepaDebit { + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: SepaDebit.SetupFutureUsage; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Preferred language of the SOFORT authorization page that the customer is redirected to. + */ + preferred_language: Sofort.PreferredLanguage | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Sofort.SetupFutureUsage; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id: string | null; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'link' + | 'oxxo' + | 'p24' + | 'paypal' + | 'sepa_debit' + | 'sofort' + | 'wechat_pay'; + + interface TransferData { + /** + * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount: number | null; + + /** + * ID of the Connected account receiving the transfer. + */ + destination: string | Stripe.Account; + } } + + type Status = + | 'canceled' + | 'complete' + | 'not_required' + | 'processing' + | 'requires_action' + | 'requires_capture' + | 'requires_confirmation' + | 'requires_payment_method'; } - interface StatusTransitions { + interface ShippingCost { /** - * The time that the order was canceled. + * Total shipping cost before any discounts or taxes are applied. */ - canceled: number | null; + amount_subtotal: number; /** - * The time that the order was fulfilled. + * Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. */ - fulfiled: number | null; + amount_tax: number; /** - * The time that the order was paid. + * Total shipping cost after discounts and taxes are applied. */ - paid: number | null; + amount_total: number; /** - * The time that the order was returned. + * The ID of the ShippingRate for this order. */ - returned: number | null; - } - } - - interface OrderCreateParams { - /** - * 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; - - /** - * A coupon code that represents a discount to be applied to this order. Must be one-time duration and in same currency as the order. An order can have multiple coupons. - */ - coupon?: string; + shipping_rate: string | Stripe.ShippingRate | null; - /** - * The ID of an existing customer to use for this order. If provided, the customer email and shipping address will be used to create the order. Subsequently, the customer will also be charged to pay the order. If `email` or `shipping` are also provided, they will override the values retrieved from the customer object. - */ - customer?: string; - - /** - * The email address of the customer placing the order. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; + /** + * The taxes applied to the shipping rate. + */ + taxes?: Array; + } - /** - * List of items constituting the order. An order can have up to 25 items. - */ - items?: Array; + namespace ShippingCost { + interface Tax { + /** + * Amount of tax applied for this rate. + */ + amount: number; - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.MetadataParam; + /** + * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + * + * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). + */ + rate: Stripe.TaxRate; + } + } - /** - * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. - */ - shipping?: OrderCreateParams.Shipping; - } + interface ShippingDetails { + /** + * Recipient shipping address. Required if the order includes products that are shippable. + */ + address: Stripe.Address | null; - namespace OrderCreateParams { - interface Item { - amount?: number; + /** + * Recipient name. + */ + name: string | null; - currency?: string; + /** + * Recipient phone (including extension). + */ + phone: string | null; + } - description?: string; + type Status = + | 'canceled' + | 'complete' + | 'open' + | 'processing' + | 'submitted'; + interface TaxDetails { /** - * The ID of the SKU being ordered. + * Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. */ - parent?: string; + tax_exempt: TaxDetails.TaxExempt; /** - * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + * The purchaser's tax IDs to be used in calculation of tax for this Order. */ - quantity?: number; - - type?: Item.Type; + tax_ids: Array; } - namespace Item { - type Type = 'discount' | 'shipping' | 'sku' | 'tax'; + namespace TaxDetails { + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown` + */ + type: TaxId.Type; + + /** + * The value of the tax ID. + */ + value: string | null; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tw_vat' + | 'ua_vat' + | 'unknown' + | 'us_ein' + | 'za_vat'; + } } - interface Shipping { + interface TotalDetails { /** - * Customer shipping address. + * This is the sum of all the discounts. */ - address: Shipping.Address; + amount_discount: number; /** - * Customer name. + * This is the sum of all the shipping amounts. */ - name: string; + amount_shipping: number | null; /** - * Customer phone (including extension). + * This is the sum of all the tax amounts. */ - phone?: string; + amount_tax: number; + + breakdown?: TotalDetails.Breakdown; } - namespace Shipping { - interface Address extends Omit { - line1?: string; + namespace TotalDetails { + interface Breakdown { + /** + * The aggregated discounts. + */ + discounts: Array; + + /** + * The aggregated tax amounts by rate. + */ + taxes: Array; + } + + namespace Breakdown { + interface Discount { + /** + * The amount discounted. + */ + amount: number; + + /** + * A discount represents the actual application of a coupon to a particular + * customer. It contains information about when the discount began and when it + * will end. + * + * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). + */ + discount: Stripe.Discount; + } + + interface Tax { + /** + * Amount of tax applied for this rate. + */ + amount: number; + + /** + * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + * + * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). + */ + rate: Stripe.TaxRate; + } } } } - interface OrderRetrieveParams { + interface OrderCreateParams { /** - * Specifies which fields in the response should be expanded. + * 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). */ - expand?: Array; - } + currency: string; - interface OrderUpdateParams { /** - * A coupon code that represents a discount to be applied to this order. Must be one-time duration and in same currency as the order. An order can have multiple coupons. + * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. */ - coupon?: string; + line_items: Array; /** - * Specifies which fields in the response should be expanded. + * Settings for automatic tax calculation for this order. */ - expand?: Array; + automatic_tax?: OrderCreateParams.AutomaticTax; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. */ - metadata?: Stripe.Emptyable; + billing_details?: Stripe.Emptyable; /** - * The shipping method to select for fulfilling this order. If specified, must be one of the `id`s of a shipping method in the `shipping_methods` array. If specified, will overwrite the existing selected shipping method, updating `items` as necessary. + * The customer associated with this order. */ - selected_shipping_method?: string; + customer?: string; /** - * Tracking information once the order has been fulfilled. + * An arbitrary string attached to the object. Often useful for displaying to users. */ - shipping?: OrderUpdateParams.Shipping; + description?: string; /** - * Current order status. One of `created`, `paid`, `canceled`, `fulfilled`, or `returned`. More detail in the [Orders Guide](https://stripe.com/docs/orders/guide#understanding-order-statuses). + * The coupons, promotion codes, and/or discounts to apply to the order. */ - status?: OrderUpdateParams.Status; - } - - namespace OrderUpdateParams { - interface Shipping { - /** - * The name of the carrier like `USPS`, `UPS`, or `FedEx`. - */ - carrier: string; - - /** - * The tracking number provided by the carrier. - */ - tracking_number: string; - } - - type Status = 'canceled' | 'created' | 'fulfilled' | 'paid' | 'returned'; - } + discounts?: Stripe.Emptyable>; - interface OrderListParams extends PaginationParams { /** - * Date this order was created. + * Specifies which fields in the response should be expanded. */ - created?: Stripe.RangeQueryParam | number; + expand?: Array; /** - * Only return orders for the given customer. + * The IP address of the purchaser for this order. */ - customer?: string; + ip_address?: string; /** - * Specifies which fields in the response should be expanded. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ - expand?: Array; + metadata?: Stripe.MetadataParam; /** - * Only return orders with the given IDs. + * Payment information associated with the order, including payment settings. */ - ids?: Array; + payment?: OrderCreateParams.Payment; /** - * Only return orders that have the given status. One of `created`, `paid`, `fulfilled`, or `refunded`. + * Settings for the customer cost of shipping for this order. */ - status?: string; + shipping_cost?: Stripe.Emptyable; /** - * Filter orders based on when they were paid, fulfilled, canceled, or returned. + * Shipping details for the order. */ - status_transitions?: OrderListParams.StatusTransitions; + shipping_details?: Stripe.Emptyable; /** - * Only return orders with the given upstream order IDs. + * Additional tax details about the purchaser to be used for this order. */ - upstream_ids?: Array; + tax_details?: OrderCreateParams.TaxDetails; } - namespace OrderListParams { - interface StatusTransitions { + namespace OrderCreateParams { + interface AutomaticTax { /** - * Date this order was canceled. + * Enable automatic tax calculation which will automatically compute tax rates on this order. */ - canceled?: Stripe.RangeQueryParam | number; + enabled: boolean; + } + interface BillingDetails { /** - * Date this order was fulfilled. + * The billing address provided by the customer. */ - fulfilled?: Stripe.RangeQueryParam | number; + address?: BillingDetails.Address; /** - * Date this order was paid. + * The billing email provided by the customer. */ - paid?: Stripe.RangeQueryParam | number; + email?: string; /** - * Date this order was returned. + * The billing name provided by the customer. */ - returned?: Stripe.RangeQueryParam | number; - } - } + name?: string; - interface OrderPayParams { - /** - * A fee in %s that will be applied to the order and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). - */ - application_fee?: number; - - /** - * The ID of an existing customer that will be charged for this order. If no customer was attached to the order at creation, either `source` or `customer` is required. Otherwise, the specified customer will be charged instead of the one attached to the order. - */ - customer?: string; + /** + * The billing phone number provided by the customer. + */ + phone?: string; + } - /** - * The email address of the customer placing the order. Required if not previously specified for the order. - */ - email?: string; + namespace BillingDetails { + interface Address extends Omit { + line1?: string; + } + } - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.MetadataParam; + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; - /** - * A [Token](https://stripe.com/docs/api#tokens)'s or a [Source](https://stripe.com/docs/api#sources)'s ID, as returned by [Elements](https://stripe.com/docs/elements). If no customer was attached to the order at creation, either `source` or `customer` is required. Otherwise, the specified source will be charged intead of the customer attached to the order. - */ - source?: string; - } + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } - interface OrderReturnOrderParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; + interface LineItem { + /** + * The description for the line item. Will default to the name of the associated product. + */ + description?: string; - /** - * List of items to return. - */ - items?: Stripe.Emptyable>; - } + /** + * The discounts applied to this line item. + */ + discounts?: Stripe.Emptyable>; - namespace OrderReturnOrderParams { - interface Item { /** - * The amount (price) for this order item to return. + * The ID of the price object. One of `product` (with default price) or `price` or `price_data` is required. */ - amount?: number; + price?: string; /** - * If returning a `tax` item, use description to disambiguate which one to return. + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `product` (with default price) or `price` or `price_data` is required. */ - description?: string; + price_data?: LineItem.PriceData; /** - * The ID of the SKU, tax, or shipping item being returned. + * The product of the line item. The product must have a default price specified. One of `product` (with default price) or `price` or `price_data` is required. */ - parent?: string; + product?: string; /** - * When type is `sku`, this is the number of instances of the SKU to be returned. + * The quantity of the line item. */ quantity?: number; /** - * The type of this order item. Must be `sku`, `tax`, or `shipping`. + * The tax rates applied to this line item. */ - type?: Item.Type; + tax_rates?: Stripe.Emptyable>; } - namespace Item { - type Type = 'discount' | 'shipping' | 'sku' | 'tax'; - } - } + namespace LineItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; - class OrdersResource { - /** - * Creates a new order object. - */ - create( - params: OrderCreateParams, - options?: RequestOptions - ): Promise>; + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } - /** - * Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. - */ - retrieve( - id: string, - params?: OrderRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; + interface PriceData { + /** + * 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; - /** - * Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: OrderUpdateParams, - options?: RequestOptions - ): Promise>; + /** + * The ID of the product that this price will belong to. + */ + product?: string; - /** - * Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. - */ - list( - params?: OrderListParams, - options?: RequestOptions - ): ApiListPromise; + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in %s (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface Payment { + /** + * Settings describing how the order should configure generated PaymentIntents. + */ + settings: Payment.Settings; + } + + namespace Payment { + interface Settings { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + */ + application_fee_amount?: number; + + /** + * PaymentMethod-specific configuration to provide to the order's PaymentIntent. + */ + payment_method_options?: Settings.PaymentMethodOptions; + + /** + * The list of payment method types (e.g., card) to provide to the order's PaymentIntent. + */ + payment_method_types?: Array; + + /** + * The URL to redirect the customer to after they authenticate their payment. + */ + return_url?: string; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * Provides configuration for completing a transfer for the order after it is paid. + */ + transfer_data?: Settings.TransferData; + } + + namespace Settings { + interface PaymentMethodOptions { + /** + * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + */ + acss_debit?: PaymentMethodOptions.AcssDebit; + + /** + * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + */ + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + + /** + * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + */ + alipay?: PaymentMethodOptions.Alipay; + + /** + * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + */ + bancontact?: PaymentMethodOptions.Bancontact; + + /** + * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + */ + card?: PaymentMethodOptions.Card; + + /** + * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + */ + customer_balance?: PaymentMethodOptions.CustomerBalance; + + /** + * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + */ + ideal?: PaymentMethodOptions.Ideal; + + /** + * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + */ + klarna?: PaymentMethodOptions.Klarna; + + /** + * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + */ + oxxo?: PaymentMethodOptions.Oxxo; + + /** + * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + */ + p24?: PaymentMethodOptions.P24; + + /** + * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + */ + sofort?: PaymentMethodOptions.Sofort; + + /** + * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + */ + wechat_pay?: PaymentMethodOptions.WechatPay; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = + | 'automatic' + | 'instant' + | 'microdeposits'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: AfterpayClearpay.CaptureMethod; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace AfterpayClearpay { + type CaptureMethod = 'automatic' | 'manual'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable< + Bancontact.SetupFutureUsage + >; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: Card.CaptureMethod; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `zengin`. + */ + requested_address_types?: Array<'zengin'>; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + */ + type: 'jp_bank_transfer'; + } + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-DE' + | 'en-AT' + | 'en-BE' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-FR' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'sv-FI' + | 'sv-SE'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'link' + | 'oxxo' + | 'p24' + | 'paypal' + | 'sepa_debit' + | 'sofort' + | 'wechat_pay'; + + interface TransferData { + /** + * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount?: number; + + /** + * ID of the Connected account receiving the transfer. + */ + destination: string; + } + } + } + + interface ShippingCost { + /** + * The ID of the shipping rate to use for this order. + */ + shipping_rate?: string; + + /** + * Parameters to create a new ad-hoc shipping rate for this order. + */ + shipping_rate_data?: ShippingCost.ShippingRateData; + } + + namespace ShippingCost { + interface ShippingRateData { + /** + * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + delivery_estimate?: ShippingRateData.DeliveryEstimate; + + /** + * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + display_name: string; + + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateData.FixedAmount; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateData.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + */ + tax_code?: string; + + /** + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ + type?: 'fixed_amount'; + } + + namespace ShippingRateData { + interface DeliveryEstimate { + /** + * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + */ + maximum?: DeliveryEstimate.Maximum; + + /** + * The lower bound of the estimated range. If empty, represents no lower bound. + */ + minimum?: DeliveryEstimate.Minimum; + } + + namespace DeliveryEstimate { + interface Maximum { + /** + * A unit of time. + */ + unit: Maximum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Maximum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + + interface Minimum { + /** + * A unit of time. + */ + unit: Minimum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Minimum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + } + + interface FixedAmount { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: 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). + */ + currency: string; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface ShippingDetails { + /** + * The shipping address for the order. + */ + address: ShippingDetails.Address; + + /** + * The name of the recipient of the order. + */ + name: string; + + /** + * The phone number (including extension) for the recipient of the order. + */ + phone?: string; + } + + namespace ShippingDetails { + interface Address extends Omit { + line1?: string; + } + } + + interface TaxDetails { + /** + * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The purchaser's tax IDs to be used for this order. + */ + tax_ids?: Array; + } + + namespace TaxDetails { + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + } + + interface OrderRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderUpdateParams { + /** + * Settings for automatic tax calculation for this order. + */ + automatic_tax?: OrderUpdateParams.AutomaticTax; + + /** + * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + */ + billing_details?: Stripe.Emptyable; + + /** + * 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; + + /** + * The customer associated with this order. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string `""` to unset this field. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The IP address of the purchaser for this order. + */ + ip_address?: string; + + /** + * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + */ + line_items?: Array; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.Emptyable; + + /** + * Payment information associated with the order, including payment settings. + */ + payment?: OrderUpdateParams.Payment; + + /** + * Settings for the customer cost of shipping for this order. + */ + shipping_cost?: Stripe.Emptyable; + + /** + * Shipping details for the order. + */ + shipping_details?: Stripe.Emptyable; + + /** + * Additional tax details about the purchaser to be used for this order. + */ + tax_details?: OrderUpdateParams.TaxDetails; + } + + namespace OrderUpdateParams { + interface AutomaticTax { + /** + * Enable automatic tax calculation which will automatically compute tax rates on this order. + */ + enabled: boolean; + } + + interface BillingDetails { + /** + * The billing address provided by the customer. + */ + address?: BillingDetails.Address; + + /** + * The billing email provided by the customer. + */ + email?: string; + + /** + * The billing name provided by the customer. + */ + name?: string; + + /** + * The billing phone number provided by the customer. + */ + phone?: string; + } + + namespace BillingDetails { + interface Address extends Omit { + line1?: string; + } + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface LineItem { + /** + * The description for the line item. Will default to the name of the associated product. + */ + description?: string; + + /** + * The discounts applied to this line item. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of an existing line item on the order. + */ + id?: string; + + /** + * The ID of the price object. One of `product` (with default price) or `price` or `price_data` is required. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `product` (with default price) or `price` or `price_data` is required. + */ + price_data?: LineItem.PriceData; + + /** + * The product of the line item. The product must have a default price specified. One of `product` (with default price) or `price` or `price_data` is required. + */ + product?: string; + + /** + * The quantity of the line item. + */ + quantity?: number; + + /** + * The tax rates applied to this line item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace LineItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface PriceData { + /** + * 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; + + /** + * The ID of the product that this price will belong to. + */ + product?: string; + + /** + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in %s (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface Payment { + /** + * Settings describing how the order should configure generated PaymentIntents. + */ + settings: Payment.Settings; + } + + namespace Payment { + interface Settings { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + */ + application_fee_amount?: Stripe.Emptyable; + + /** + * PaymentMethod-specific configuration to provide to the order's PaymentIntent. + */ + payment_method_options?: Settings.PaymentMethodOptions; + + /** + * The list of payment method types (e.g., card) to provide to the order's PaymentIntent. + */ + payment_method_types?: Array; + + /** + * The URL to redirect the customer to after they authenticate their payment. + */ + return_url?: Stripe.Emptyable; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * Provides configuration for completing a transfer for the order after it is paid. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace Settings { + interface PaymentMethodOptions { + /** + * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + */ + afterpay_clearpay?: Stripe.Emptyable< + PaymentMethodOptions.AfterpayClearpay + >; + + /** + * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + */ + alipay?: Stripe.Emptyable; + + /** + * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + */ + bancontact?: Stripe.Emptyable; + + /** + * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + */ + ideal?: Stripe.Emptyable; + + /** + * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + */ + klarna?: Stripe.Emptyable; + + /** + * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + */ + oxxo?: Stripe.Emptyable; + + /** + * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + */ + p24?: Stripe.Emptyable; + + /** + * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + */ + sepa_debit?: Stripe.Emptyable; + + /** + * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + */ + sofort?: Stripe.Emptyable; + + /** + * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + */ + wechat_pay?: Stripe.Emptyable; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = + | 'automatic' + | 'instant' + | 'microdeposits'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: AfterpayClearpay.CaptureMethod; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace AfterpayClearpay { + type CaptureMethod = 'automatic' | 'manual'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable< + Bancontact.SetupFutureUsage + >; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: Card.CaptureMethod; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `zengin`. + */ + requested_address_types?: Array<'zengin'>; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + */ + type: 'jp_bank_transfer'; + } + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-DE' + | 'en-AT' + | 'en-BE' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-FR' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'sv-FI' + | 'sv-SE'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'link' + | 'oxxo' + | 'p24' + | 'paypal' + | 'sepa_debit' + | 'sofort' + | 'wechat_pay'; + + interface TransferData { + /** + * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount?: number; + + /** + * ID of the Connected account receiving the transfer. + */ + destination: string; + } + } + } + + interface ShippingCost { + /** + * The ID of the shipping rate to use for this order. + */ + shipping_rate?: string; + + /** + * Parameters to create a new ad-hoc shipping rate for this order. + */ + shipping_rate_data?: ShippingCost.ShippingRateData; + } + + namespace ShippingCost { + interface ShippingRateData { + /** + * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + delivery_estimate?: ShippingRateData.DeliveryEstimate; + + /** + * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + display_name: string; + + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateData.FixedAmount; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateData.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + */ + tax_code?: string; + + /** + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ + type?: 'fixed_amount'; + } + + namespace ShippingRateData { + interface DeliveryEstimate { + /** + * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + */ + maximum?: DeliveryEstimate.Maximum; + + /** + * The lower bound of the estimated range. If empty, represents no lower bound. + */ + minimum?: DeliveryEstimate.Minimum; + } + + namespace DeliveryEstimate { + interface Maximum { + /** + * A unit of time. + */ + unit: Maximum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Maximum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + + interface Minimum { + /** + * A unit of time. + */ + unit: Minimum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Minimum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + } + + interface FixedAmount { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: 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). + */ + currency: string; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface ShippingDetails { + /** + * The shipping address for the order. + */ + address: ShippingDetails.Address; + + /** + * The name of the recipient of the order. + */ + name: string; + + /** + * The phone number (including extension) for the recipient of the order. + */ + phone?: string; + } + + namespace ShippingDetails { + interface Address extends Omit { + line1?: string; + } + } + + interface TaxDetails { + /** + * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The purchaser's tax IDs to be used for this order. + */ + tax_ids?: Array; + } + + namespace TaxDetails { + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + } + + interface OrderListParams extends PaginationParams { + /** + * Only return orders for the given customer. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderReopenParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderSubmitParams { + /** + * `expected_total` should always be set to the order's `amount_total` field. If they don't match, submitting the order will fail. This helps detect race conditions where something else concurrently modifies the order. + */ + expected_total: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class OrdersResource { + /** + * Creates a new open order object. + */ + create( + params: OrderCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. + */ + retrieve( + id: string, + params?: OrderRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: OrderUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. + */ + list( + params?: OrderListParams, + options?: RequestOptions + ): ApiListPromise; list(options?: RequestOptions): ApiListPromise; /** - * Pay an order by providing a source to create a payment. + * Cancels the order as well as the payment intent if one is attached. */ - pay( + cancel( id: string, - params?: OrderPayParams, + params?: OrderCancelParams, options?: RequestOptions ): Promise>; - pay( + cancel( id: string, options?: RequestOptions ): Promise>; /** - * Return all or part of an order. The order must have a status of paid or fulfilled before it can be returned. Once all items have been returned, the order will become canceled or returned depending on which status the order started in. + * When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. */ - returnOrder( + listLineItems( id: string, - params?: OrderReturnOrderParams, + params?: OrderListLineItemsParams, options?: RequestOptions - ): Promise>; - returnOrder( + ): ApiListPromise; + listLineItems( id: string, options?: RequestOptions - ): Promise>; + ): ApiListPromise; + + /** + * Reopens a processing order. + */ + reopen( + id: string, + params?: OrderReopenParams, + options?: RequestOptions + ): Promise>; + reopen( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called. + */ + submit( + id: string, + params: OrderSubmitParams, + options?: RequestOptions + ): Promise>; } } } diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 5cd2f540ee..82562d0f44 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -1475,7 +1475,7 @@ declare module 'stripe' { /** * Recipient name. */ - name?: string | null; + name?: string; /** * Recipient phone (including extension). diff --git a/types/2020-08-27/Sources.d.ts b/types/2020-08-27/Sources.d.ts index 661f1f1b63..dfc541b042 100644 --- a/types/2020-08-27/Sources.d.ts +++ b/types/2020-08-27/Sources.d.ts @@ -641,7 +641,7 @@ declare module 'stripe' { /** * Recipient name. */ - name?: string | null; + name?: string; /** * Recipient phone (including extension). diff --git a/types/2020-08-27/index.d.ts b/types/2020-08-27/index.d.ts index 7161b24530..5afc19d52b 100644 --- a/types/2020-08-27/index.d.ts +++ b/types/2020-08-27/index.d.ts @@ -62,8 +62,6 @@ /// /// /// -/// -/// /// /// /// @@ -153,7 +151,6 @@ declare module 'stripe' { issuerFraudRecords: Stripe.IssuerFraudRecordsResource; mandates: Stripe.MandatesResource; orders: Stripe.OrdersResource; - orderReturns: Stripe.OrderReturnsResource; paymentIntents: Stripe.PaymentIntentsResource; paymentLinks: Stripe.PaymentLinksResource; paymentMethods: Stripe.PaymentMethodsResource; From 47776ef15ef3590980c48d6dece1ea54657fdbca Mon Sep 17 00:00:00 2001 From: Bruno Pinto Date: Tue, 10 May 2022 00:47:36 +0100 Subject: [PATCH 06/25] feat(http-client): retry closed connection errors (#1336) * feat(http-client): Retry requests that failed with closed connection Requests that fail with closed connection errors (ECONNRESET, EPIPE) are automatically retried. - `ECONNRESET` (Connection reset by peer): A connection was forcibly closed by a peer.closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or reboot. Commonly encountered via the http and net modules. - `EPIPE` (Broken pipe): A write on a pipe, socket, or FIFO for which there is no process to read the data. Commonly encountered at the net and http layers, indicative that the remote side of the stream being written to has been closed. Fixes: #1040 --- lib/StripeResource.js | 12 ++++++++++-- lib/net/HttpClient.js | 1 + test/StripeResource.spec.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/lib/StripeResource.js b/lib/StripeResource.js index ca364dae7e..0bfc93cd4e 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -273,7 +273,15 @@ StripeResource.prototype = { }, // For more on when and how to retry API requests, see https://stripe.com/docs/error-handling#safely-retrying-requests-with-idempotency - _shouldRetry(res, numRetries, maxRetries) { + _shouldRetry(res, numRetries, maxRetries, error) { + if ( + error && + numRetries === 0 && + HttpClient.CONNECTION_CLOSED_ERROR_CODES.includes(error.code) + ) { + return true; + } + // Do not retry if we are out of retries. if (numRetries >= maxRetries) { return false; @@ -529,7 +537,7 @@ StripeResource.prototype = { } }) .catch((error) => { - if (this._shouldRetry(null, requestRetries, maxRetries)) { + if (this._shouldRetry(null, requestRetries, maxRetries, error)) { return retryRequest( makeRequest, apiVersion, diff --git a/lib/net/HttpClient.js b/lib/net/HttpClient.js index eca551a084..053ab0d8e7 100644 --- a/lib/net/HttpClient.js +++ b/lib/net/HttpClient.js @@ -31,6 +31,7 @@ class HttpClient { } } +HttpClient.CONNECTION_CLOSED_ERROR_CODES = ['ECONNRESET', 'EPIPE']; HttpClient.TIMEOUT_ERROR_CODE = 'ETIMEDOUT'; class HttpClientResponse { diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index 23ab4def2b..1cdf98e285 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -403,6 +403,39 @@ describe('StripeResource', () => { ); }); + it('retries closed connection errors once', (done) => { + nock(`https://${options.host}`) + .post(options.path, options.params) + .replyWithError({ + code: 'ECONNRESET', + errno: 'ECONNRESET', + }) + .post(options.path, options.params) + .reply(200, { + id: 'ch_123', + object: 'charge', + amount: 1000, + }); + + realStripe.charges.create(options.data, (err, charge) => { + expect(charge.id).to.equal('ch_123'); + done(err); + }); + }); + + it('throws on multiple closed connection errors', (done) => { + nock(`https://${options.host}`) + .post(options.path, options.params) + .replyWithError({code: 'ECONNRESET'}) + .post(options.path, options.params) + .replyWithError({code: 'ECONNRESET'}); + + realStripe.charges.create(options.data, (err) => { + expect(err.detail.code).to.deep.equal('ECONNRESET'); + done(); + }); + }); + it('should retry the request if max retries are set', (done) => { nock(`https://${options.host}`) .post(options.path, options.params) From 50aab85704eb05ba82390d5d6b06a61a5ff34b84 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Mon, 9 May 2022 20:15:19 -0400 Subject: [PATCH 07/25] Remove deprecated orders-related events (#1417) --- types/2020-08-27/WebhookEndpoints.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2020-08-27/WebhookEndpoints.d.ts index 073836541f..cee43182e8 100644 --- a/types/2020-08-27/WebhookEndpoints.d.ts +++ b/types/2020-08-27/WebhookEndpoints.d.ts @@ -323,9 +323,6 @@ declare module 'stripe' { | 'mandate.updated' | 'order.created' | 'order.payment_failed' - | 'order.payment_succeeded' - | 'order.updated' - | 'order_return.created' | 'payment_intent.amount_capturable_updated' | 'payment_intent.canceled' | 'payment_intent.created' @@ -555,9 +552,6 @@ declare module 'stripe' { | 'mandate.updated' | 'order.created' | 'order.payment_failed' - | 'order.payment_succeeded' - | 'order.updated' - | 'order_return.created' | 'payment_intent.amount_capturable_updated' | 'payment_intent.canceled' | 'payment_intent.created' From 1512d0053bfc17f98864eb074add35e1b6b65640 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Mon, 9 May 2022 17:44:33 -0700 Subject: [PATCH 08/25] Bump version to 9.0.0 --- CHANGELOG.md | 14 ++++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5e85aa6a..727a621071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # CHANGELOG +## 9.0.0 - 2022-05-09 +Major version release - The [migration guide](https://github.com/stripe/stripe-node/wiki/Migration-Guide-for-v9) contains a detailed list of backwards-incompatible changes with upgrade instructions. +(⚠️ = breaking changes): +* ⚠️[#1336](https://github.com/stripe/stripe-node/pull/1336) feat(http-client): retry closed connection errors +* [#1415](https://github.com/stripe/stripe-node/pull/1415) [#1417](https://github.com/stripe/stripe-node/pull/1417) API Updates + * ⚠️ Replace the legacy `Order` API with the new `Order` API. + * Resource modified: `Order`. + * New methods: `cancel`, `list_line_items`, `reopen`, and `submit` + * Removed methods: `pay` and `return_order` + * Removed resources: `OrderItem` and `OrderReturn` + * Removed references from other resources: `Charge.order` + * Add support for `amount_discount`, `amount_tax`, and `product` on `LineItem` + * Change type of `Charge.shipping.name`, `Checkout.Session.shipping.name`, `Customer.shipping.name`, `Invoice.customer_shipping.name`, `PaymentIntent.shipping.name`, `ShippingDetails.name`, and `Source.source_order.shipping.name` from `nullable(string)` to `string` + ## 8.222.0 - 2022-05-05 * [#1414](https://github.com/stripe/stripe-node/pull/1414) API Updates * Add support for `default_price_data` on `ProductCreateParams` diff --git a/VERSION b/VERSION index 61785b063c..f7ee06693c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.222.0 +9.0.0 diff --git a/package.json b/package.json index 680bce89f0..aa5a0bd395 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "8.222.0", + "version": "9.0.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 16bf01d69f24f56cb2d577bf07b992a50e3ce6aa Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Wed, 11 May 2022 13:48:48 -0400 Subject: [PATCH 09/25] API Updates (#1420) * Codegen for openapi 7789931 --- types/2020-08-27/Checkout/Sessions.d.ts | 12 +- types/2020-08-27/Discounts.d.ts | 8 +- types/2020-08-27/LineItems.d.ts | 5 +- types/2020-08-27/Orders.d.ts | 7 +- types/2020-08-27/PaymentLinks.d.ts | 167 ++++++++++++++++++++ types/2020-08-27/PromotionCodes.d.ts | 4 +- types/2020-08-27/Quotes.d.ts | 15 +- types/2020-08-27/Refunds.d.ts | 2 +- types/2020-08-27/SubscriptionSchedules.d.ts | 15 ++ types/2020-08-27/Subscriptions.d.ts | 15 ++ types/2020-08-27/WebhookEndpoints.d.ts | 2 + 11 files changed, 226 insertions(+), 26 deletions(-) diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index b4f0f2c735..e375b90611 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -913,9 +913,8 @@ declare module 'stripe' { amount: number; /** - * A discount represents the actual application of a coupon to a particular - * customer. It contains information about when the discount began and when it - * will end. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ @@ -2157,6 +2156,13 @@ declare module 'stripe' { */ default_tax_rates?: Array; + /** + * The subscription's description, meant to be displayable to the customer. + * Use this field to optionally store an explanation of the subscription + * for rendering in Stripe hosted surfaces. + */ + description?: string; + /** * A list of items, each with an attached plan, that the customer is subscribing to. Prefer using `line_items`. */ diff --git a/types/2020-08-27/Discounts.d.ts b/types/2020-08-27/Discounts.d.ts index 8343cf5598..685fb4db8d 100644 --- a/types/2020-08-27/Discounts.d.ts +++ b/types/2020-08-27/Discounts.d.ts @@ -23,8 +23,8 @@ declare module 'stripe' { /** * A coupon contains information about a percent-off or amount-off discount you - * might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or - * [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge). + * might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + * [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). */ coupon: Stripe.Coupon; @@ -87,8 +87,8 @@ declare module 'stripe' { /** * A coupon contains information about a percent-off or amount-off discount you - * might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or - * [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge). + * might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + * [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). */ coupon: Stripe.Coupon; diff --git a/types/2020-08-27/LineItems.d.ts b/types/2020-08-27/LineItems.d.ts index beb2b87f50..6f41fb08c0 100644 --- a/types/2020-08-27/LineItems.d.ts +++ b/types/2020-08-27/LineItems.d.ts @@ -82,9 +82,8 @@ declare module 'stripe' { amount: number; /** - * A discount represents the actual application of a coupon to a particular - * customer. It contains information about when the discount began and when it - * will end. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index fab8c1465e..317473ad46 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -833,9 +833,8 @@ declare module 'stripe' { amount: number; /** - * A discount represents the actual application of a coupon to a particular - * customer. It contains information about when the discount began and when it - * will end. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ @@ -2923,7 +2922,7 @@ declare module 'stripe' { ): ApiListPromise; /** - * Reopens a processing order. + * Reopens a submitted order. */ reopen( id: string, diff --git a/types/2020-08-27/PaymentLinks.d.ts b/types/2020-08-27/PaymentLinks.d.ts index 1b5abb6044..7dbeae83e0 100644 --- a/types/2020-08-27/PaymentLinks.d.ts +++ b/types/2020-08-27/PaymentLinks.d.ts @@ -45,6 +45,16 @@ declare module 'stripe' { */ billing_address_collection: PaymentLink.BillingAddressCollection; + /** + * When set, provides configuration to gather active consent from customers. + */ + consent_collection: PaymentLink.ConsentCollection | null; + + /** + * Configuration for Customer creation during checkout. + */ + customer_creation: PaymentLink.CustomerCreation; + /** * The line items representing what is being sold. */ @@ -65,6 +75,11 @@ declare module 'stripe' { */ on_behalf_of: string | Stripe.Account | null; + /** + * Indicates the parameters to be passed to PaymentIntent creation during checkout. + */ + payment_intent_data: PaymentLink.PaymentIntentData | null; + /** * The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). */ @@ -77,11 +92,23 @@ declare module 'stripe' { */ shipping_address_collection: PaymentLink.ShippingAddressCollection | null; + /** + * The shipping rate options applied to the session. + */ + shipping_options: Array; + + /** + * Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. + */ + submit_type: PaymentLink.SubmitType; + /** * When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. */ subscription_data: PaymentLink.SubscriptionData | null; + tax_id_collection: PaymentLink.TaxIdCollection; + /** * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. */ @@ -132,6 +159,33 @@ declare module 'stripe' { type BillingAddressCollection = 'auto' | 'required'; + interface ConsentCollection { + /** + * If set to `auto`, enables the collection of customer consent for promotional communications. + */ + promotions: 'auto' | null; + } + + type CustomerCreation = 'always' | 'if_required'; + + interface PaymentIntentData { + /** + * Indicates when the funds will be captured from the customer's account. + */ + capture_method: PaymentIntentData.CaptureMethod | null; + + /** + * Indicates that you intend to make future payments with the payment method collected during checkout. + */ + setup_future_usage: PaymentIntentData.SetupFutureUsage | null; + } + + namespace PaymentIntentData { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'off_session' | 'on_session'; + } + interface PhoneNumberCollection { /** * If `true`, a phone number will be collected during checkout. @@ -387,6 +441,20 @@ declare module 'stripe' { | 'ZZ'; } + interface ShippingOption { + /** + * A non-negative integer in cents representing how much to charge. + */ + shipping_amount: number; + + /** + * The ID of the Shipping Rate to use for this shipping option. + */ + shipping_rate: string | Stripe.ShippingRate; + } + + type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; + interface SubscriptionData { /** * Integer representing the number of trial period days before the customer is charged for the first time. @@ -394,6 +462,13 @@ declare module 'stripe' { trial_period_days: number | null; } + interface TaxIdCollection { + /** + * Indicates whether tax ID collection is enabled for the session. + */ + enabled: boolean; + } + interface TransferData { /** * The amount in %s that will be transferred to the destination account. By default, the entire amount is transferred to the destination. @@ -443,6 +518,16 @@ declare module 'stripe' { */ billing_address_collection?: PaymentLinkCreateParams.BillingAddressCollection; + /** + * Configure fields to gather active consent from customers. + */ + consent_collection?: PaymentLinkCreateParams.ConsentCollection; + + /** + * Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). + */ + customer_creation?: PaymentLinkCreateParams.CustomerCreation; + /** * Specifies which fields in the response should be expanded. */ @@ -458,6 +543,11 @@ declare module 'stripe' { */ on_behalf_of?: string; + /** + * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + */ + payment_intent_data?: PaymentLinkCreateParams.PaymentIntentData; + /** * The list of payment method types that customers can use. Only `card` is supported. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). */ @@ -475,11 +565,26 @@ declare module 'stripe' { */ shipping_address_collection?: PaymentLinkCreateParams.ShippingAddressCollection; + /** + * The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + */ + shipping_options?: Array; + + /** + * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. + */ + submit_type?: PaymentLinkCreateParams.SubmitType; + /** * When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. */ subscription_data?: PaymentLinkCreateParams.SubscriptionData; + /** + * Controls tax ID collection during checkout. + */ + tax_id_collection?: PaymentLinkCreateParams.TaxIdCollection; + /** * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. */ @@ -531,6 +636,17 @@ declare module 'stripe' { type BillingAddressCollection = 'auto' | 'required'; + interface ConsentCollection { + /** + * If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + * 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'; + } + + type CustomerCreation = 'always' | 'if_required'; + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. @@ -567,6 +683,34 @@ declare module 'stripe' { } } + interface PaymentIntentData { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: PaymentIntentData.CaptureMethod; + + /** + * Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + * + * When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + * + * When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + * + * If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. + * + * If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + * + * When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + */ + setup_future_usage?: PaymentIntentData.SetupFutureUsage; + } + + namespace PaymentIntentData { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'off_session' | 'on_session'; + } + interface PhoneNumberCollection { /** * Set to `true` to enable phone number collection. @@ -823,6 +967,15 @@ declare module 'stripe' { | 'ZZ'; } + interface ShippingOption { + /** + * The ID of the Shipping Rate to use for this shipping option. + */ + shipping_rate?: string; + } + + type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; + interface SubscriptionData { /** * Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. @@ -830,6 +983,13 @@ declare module 'stripe' { trial_period_days?: number; } + interface TaxIdCollection { + /** + * Set to `true` to enable tax ID collection. + */ + enabled: boolean; + } + interface TransferData { /** * The amount that will be transferred automatically when a charge succeeds. @@ -879,6 +1039,11 @@ declare module 'stripe' { */ billing_address_collection?: PaymentLinkUpdateParams.BillingAddressCollection; + /** + * Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). + */ + customer_creation?: PaymentLinkUpdateParams.CustomerCreation; + /** * Specifies which fields in the response should be expanded. */ @@ -952,6 +1117,8 @@ declare module 'stripe' { type BillingAddressCollection = 'auto' | 'required'; + type CustomerCreation = 'always' | 'if_required'; + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. diff --git a/types/2020-08-27/PromotionCodes.d.ts b/types/2020-08-27/PromotionCodes.d.ts index b2ce6181ec..3b22639eff 100644 --- a/types/2020-08-27/PromotionCodes.d.ts +++ b/types/2020-08-27/PromotionCodes.d.ts @@ -28,8 +28,8 @@ declare module 'stripe' { /** * A coupon contains information about a percent-off or amount-off discount you - * might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or - * [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge). + * might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + * [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). */ coupon: Stripe.Coupon; diff --git a/types/2020-08-27/Quotes.d.ts b/types/2020-08-27/Quotes.d.ts index 53d4da4a64..1d9daf0030 100644 --- a/types/2020-08-27/Quotes.d.ts +++ b/types/2020-08-27/Quotes.d.ts @@ -267,9 +267,8 @@ declare module 'stripe' { amount: number; /** - * A discount represents the actual application of a coupon to a particular - * customer. It contains information about when the discount began and when it - * will end. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ @@ -353,9 +352,8 @@ declare module 'stripe' { amount: number; /** - * A discount represents the actual application of a coupon to a particular - * customer. It contains information about when the discount began and when it - * will end. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ @@ -470,9 +468,8 @@ declare module 'stripe' { amount: number; /** - * A discount represents the actual application of a coupon to a particular - * customer. It contains information about when the discount began and when it - * will end. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ diff --git a/types/2020-08-27/Refunds.d.ts b/types/2020-08-27/Refunds.d.ts index ec3fe3705d..5e85fd749b 100644 --- a/types/2020-08-27/Refunds.d.ts +++ b/types/2020-08-27/Refunds.d.ts @@ -89,7 +89,7 @@ declare module 'stripe' { source_transfer_reversal: string | Stripe.TransferReversal | null; /** - * Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `succeeded`, `failed`, or `canceled`. Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details. + * Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details. */ status: string | null; diff --git a/types/2020-08-27/SubscriptionSchedules.d.ts b/types/2020-08-27/SubscriptionSchedules.d.ts index b6774a1a4e..389ebaaa41 100644 --- a/types/2020-08-27/SubscriptionSchedules.d.ts +++ b/types/2020-08-27/SubscriptionSchedules.d.ts @@ -254,6 +254,11 @@ declare module 'stripe' { */ items: Array; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + */ + metadata: Stripe.Metadata | null; + /** * If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. */ @@ -584,6 +589,11 @@ declare module 'stripe' { */ iterations?: number; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + */ + metadata?: Stripe.MetadataParam; + /** * If a subscription schedule will create prorations when transitioning to this phase. Possible values are `create_prorations` or `none`, and the default value is `create_prorations`. See [Prorations](https://stripe.com/docs/billing/subscriptions/prorations). */ @@ -999,6 +1009,11 @@ declare module 'stripe' { */ iterations?: number; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + */ + metadata?: Stripe.MetadataParam; + /** * If a subscription schedule will create prorations when transitioning to this phase. Possible values are `create_prorations` or `none`, and the default value is `create_prorations`. See [Prorations](https://stripe.com/docs/billing/subscriptions/prorations). */ diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index df1105347a..f645521de9 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -102,6 +102,11 @@ declare module 'stripe' { */ default_tax_rates?: Array | null; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. + */ + description: string | null; + /** * Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. */ @@ -570,6 +575,11 @@ declare module 'stripe' { */ default_tax_rates?: Stripe.Emptyable>; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. + */ + description?: string; + /** * Specifies which fields in the response should be expanded. */ @@ -1138,6 +1148,11 @@ declare module 'stripe' { */ default_tax_rates?: Stripe.Emptyable>; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. + */ + description?: string; + /** * Specifies which fields in the response should be expanded. */ diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2020-08-27/WebhookEndpoints.d.ts index cee43182e8..864a4583dd 100644 --- a/types/2020-08-27/WebhookEndpoints.d.ts +++ b/types/2020-08-27/WebhookEndpoints.d.ts @@ -239,6 +239,7 @@ declare module 'stripe' { | 'balance.available' | 'billing_portal.configuration.created' | 'billing_portal.configuration.updated' + | 'billing_portal.session.created' | 'capability.updated' | 'cash_balance.funds_available' | 'charge.captured' @@ -468,6 +469,7 @@ declare module 'stripe' { | 'balance.available' | 'billing_portal.configuration.created' | 'billing_portal.configuration.updated' + | 'billing_portal.session.created' | 'capability.updated' | 'cash_balance.funds_available' | 'charge.captured' From 287681450a70e49cd1132ce6405d50b6db1bcd86 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Wed, 11 May 2022 11:10:32 -0700 Subject: [PATCH 10/25] Bump version to 9.1.0 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 727a621071..b875b4f6a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # CHANGELOG +## 9.1.0 - 2022-05-11 +* [#1420](https://github.com/stripe/stripe-node/pull/1420) API Updates + * Add support for `description` on `CheckoutSessionCreateParams.subscription_data`, `SubscriptionCreateParams`, `SubscriptionUpdateParams`, and `Subscription` + * Add support for `consent_collection`, `payment_intent_data`, `shipping_options`, `submit_type`, and `tax_id_collection` on `PaymentLinkCreateParams` and `PaymentLink` + * Add support for `customer_creation` on `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink` + * Add support for `metadata` on `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.phases[]`, and `SubscriptionScheduleUpdateParams.phases[]` + * Add support for new value `billing_portal.session.created` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` + ## 9.0.0 - 2022-05-09 Major version release - The [migration guide](https://github.com/stripe/stripe-node/wiki/Migration-Guide-for-v9) contains a detailed list of backwards-incompatible changes with upgrade instructions. (⚠️ = breaking changes): diff --git a/VERSION b/VERSION index f7ee06693c..47da986f86 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.0.0 +9.1.0 diff --git a/package.json b/package.json index aa5a0bd395..c35f5ad16a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.0.0", + "version": "9.1.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 4819fc54a6635081935aa42ccda88ba292ace464 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik <99290280+kamil-stripe@users.noreply.github.com> Date: Thu, 19 May 2022 16:55:08 -0700 Subject: [PATCH 11/25] API Updates (#1422) * Codegen for openapi 056745c Co-authored-by: Richard Marmorstein Co-authored-by: Dominic Charley-Roy --- lib/resources.js | 19 + lib/resources/Customers.js | 5 + .../FinancialConnections/Accounts.js | 12 + .../TestHelpers/Treasury/InboundTransfers.js | 25 + .../TestHelpers/Treasury/OutboundPayments.js | 25 + .../TestHelpers/Treasury/OutboundTransfers.js | 25 + .../TestHelpers/Treasury/ReceivedCredits.js | 15 + .../TestHelpers/Treasury/ReceivedDebits.js | 15 + lib/resources/Treasury/CreditReversals.js | 26 + lib/resources/Treasury/DebitReversals.js | 26 + lib/resources/Treasury/FinancialAccounts.js | 41 + lib/resources/Treasury/InboundTransfers.js | 31 + lib/resources/Treasury/OutboundPayments.js | 31 + lib/resources/Treasury/OutboundTransfers.js | 31 + lib/resources/Treasury/ReceivedCredits.js | 21 + lib/resources/Treasury/ReceivedDebits.js | 21 + lib/resources/Treasury/TransactionEntries.js | 21 + lib/resources/Treasury/Transactions.js | 21 + .../resources/generated_examples_test.spec.js | 1807 ++++++++++++----- types/2020-08-27/Accounts.d.ts | 10 +- .../BillingPortal/Configurations.d.ts | 2 +- types/2020-08-27/BillingPortal/Sessions.d.ts | 2 +- types/2020-08-27/Checkout/Sessions.d.ts | 42 + types/2020-08-27/Customers.d.ts | 22 + .../FinancialConnections/Accounts.d.ts | 63 + types/2020-08-27/Issuing/Authorizations.d.ts | 22 + types/2020-08-27/Issuing/Cards.d.ts | 7 + types/2020-08-27/Issuing/Disputes.d.ts | 29 + types/2020-08-27/Issuing/Transactions.d.ts | 17 + types/2020-08-27/Orders.d.ts | 9 + types/2020-08-27/PaymentIntents.d.ts | 52 +- types/2020-08-27/PaymentMethods.d.ts | 21 + types/2020-08-27/SetupIntents.d.ts | 64 + types/2020-08-27/Subscriptions.d.ts | 25 +- types/2020-08-27/Terminal/Configurations.d.ts | 63 + .../Treasury/InboundTransfers.d.ts | 108 + .../Treasury/OutboundPayments.d.ts | 105 + .../Treasury/OutboundTransfers.d.ts | 105 + .../TestHelpers/Treasury/ReceivedCredits.d.ts | 93 + .../TestHelpers/Treasury/ReceivedDebits.d.ts | 91 + types/2020-08-27/Tokens.d.ts | 4 +- .../2020-08-27/Treasury/CreditReversals.d.ts | 168 ++ types/2020-08-27/Treasury/DebitReversals.d.ts | 187 ++ .../Treasury/FinancialAccountFeatures.d.ts | 622 ++++++ .../Treasury/FinancialAccounts.d.ts | 833 ++++++++ .../2020-08-27/Treasury/InboundTransfers.d.ts | 349 ++++ .../2020-08-27/Treasury/OutboundPayments.d.ts | 550 +++++ .../Treasury/OutboundTransfers.d.ts | 385 ++++ .../2020-08-27/Treasury/ReceivedCredits.d.ts | 303 +++ types/2020-08-27/Treasury/ReceivedDebits.d.ts | 231 +++ .../Treasury/TransactionEntries.d.ts | 257 +++ types/2020-08-27/Treasury/Transactions.d.ts | 268 +++ types/2020-08-27/WebhookEndpoints.d.ts | 62 +- types/2020-08-27/index.d.ts | 35 + 54 files changed, 6855 insertions(+), 569 deletions(-) create mode 100644 lib/resources/TestHelpers/Treasury/InboundTransfers.js create mode 100644 lib/resources/TestHelpers/Treasury/OutboundPayments.js create mode 100644 lib/resources/TestHelpers/Treasury/OutboundTransfers.js create mode 100644 lib/resources/TestHelpers/Treasury/ReceivedCredits.js create mode 100644 lib/resources/TestHelpers/Treasury/ReceivedDebits.js create mode 100644 lib/resources/Treasury/CreditReversals.js create mode 100644 lib/resources/Treasury/DebitReversals.js create mode 100644 lib/resources/Treasury/FinancialAccounts.js create mode 100644 lib/resources/Treasury/InboundTransfers.js create mode 100644 lib/resources/Treasury/OutboundPayments.js create mode 100644 lib/resources/Treasury/OutboundTransfers.js create mode 100644 lib/resources/Treasury/ReceivedCredits.js create mode 100644 lib/resources/Treasury/ReceivedDebits.js create mode 100644 lib/resources/Treasury/TransactionEntries.js create mode 100644 lib/resources/Treasury/Transactions.js create mode 100644 types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts create mode 100644 types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts create mode 100644 types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts create mode 100644 types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts create mode 100644 types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts create mode 100644 types/2020-08-27/Treasury/CreditReversals.d.ts create mode 100644 types/2020-08-27/Treasury/DebitReversals.d.ts create mode 100644 types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts create mode 100644 types/2020-08-27/Treasury/FinancialAccounts.d.ts create mode 100644 types/2020-08-27/Treasury/InboundTransfers.d.ts create mode 100644 types/2020-08-27/Treasury/OutboundPayments.d.ts create mode 100644 types/2020-08-27/Treasury/OutboundTransfers.d.ts create mode 100644 types/2020-08-27/Treasury/ReceivedCredits.d.ts create mode 100644 types/2020-08-27/Treasury/ReceivedDebits.d.ts create mode 100644 types/2020-08-27/Treasury/TransactionEntries.d.ts create mode 100644 types/2020-08-27/Treasury/Transactions.d.ts diff --git a/lib/resources.js b/lib/resources.js index 46e3705947..ed98980bd5 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -101,5 +101,24 @@ module.exports = { Terminal: resourceNamespace('terminal', { Readers: require('./resources/TestHelpers/Terminal/Readers'), }), + Treasury: resourceNamespace('treasury', { + InboundTransfers: require('./resources/TestHelpers/Treasury/InboundTransfers'), + OutboundPayments: require('./resources/TestHelpers/Treasury/OutboundPayments'), + OutboundTransfers: require('./resources/TestHelpers/Treasury/OutboundTransfers'), + ReceivedCredits: require('./resources/TestHelpers/Treasury/ReceivedCredits'), + ReceivedDebits: require('./resources/TestHelpers/Treasury/ReceivedDebits'), + }), + }), + Treasury: resourceNamespace('treasury', { + CreditReversals: require('./resources/Treasury/CreditReversals'), + DebitReversals: require('./resources/Treasury/DebitReversals'), + FinancialAccounts: require('./resources/Treasury/FinancialAccounts'), + InboundTransfers: require('./resources/Treasury/InboundTransfers'), + OutboundPayments: require('./resources/Treasury/OutboundPayments'), + OutboundTransfers: require('./resources/Treasury/OutboundTransfers'), + ReceivedCredits: require('./resources/Treasury/ReceivedCredits'), + ReceivedDebits: require('./resources/Treasury/ReceivedDebits'), + Transactions: require('./resources/Treasury/Transactions'), + TransactionEntries: require('./resources/Treasury/TransactionEntries'), }), }; diff --git a/lib/resources/Customers.js b/lib/resources/Customers.js index 81b3c1c951..17bc7c6498 100644 --- a/lib/resources/Customers.js +++ b/lib/resources/Customers.js @@ -50,6 +50,11 @@ module.exports = StripeResource.extend({ methodType: 'list', }), + retrievePaymentMethod: stripeMethod({ + method: 'GET', + path: '/{customer}/payment_methods/{paymentMethod}', + }), + search: stripeMethod({ method: 'GET', path: '/search', diff --git a/lib/resources/FinancialConnections/Accounts.js b/lib/resources/FinancialConnections/Accounts.js index 2f3270f08a..674f42ec48 100644 --- a/lib/resources/FinancialConnections/Accounts.js +++ b/lib/resources/FinancialConnections/Accounts.js @@ -13,11 +13,23 @@ module.exports = StripeResource.extend({ path: '/{account}', }), + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + disconnect: stripeMethod({ method: 'POST', path: '/{account}/disconnect', }), + listOwners: stripeMethod({ + method: 'GET', + path: '/{account}/owners', + methodType: 'list', + }), + refresh: stripeMethod({ method: 'POST', path: '/{account}/refresh', diff --git a/lib/resources/TestHelpers/Treasury/InboundTransfers.js b/lib/resources/TestHelpers/Treasury/InboundTransfers.js new file mode 100644 index 0000000000..178816ad58 --- /dev/null +++ b/lib/resources/TestHelpers/Treasury/InboundTransfers.js @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'test_helpers/treasury/inbound_transfers', + + fail: stripeMethod({ + method: 'POST', + path: '/{id}/fail', + }), + + returnInboundTransfer: stripeMethod({ + method: 'POST', + path: '/{id}/return', + }), + + succeed: stripeMethod({ + method: 'POST', + path: '/{id}/succeed', + }), +}); diff --git a/lib/resources/TestHelpers/Treasury/OutboundPayments.js b/lib/resources/TestHelpers/Treasury/OutboundPayments.js new file mode 100644 index 0000000000..3a1b4d6516 --- /dev/null +++ b/lib/resources/TestHelpers/Treasury/OutboundPayments.js @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'test_helpers/treasury/outbound_payments', + + fail: stripeMethod({ + method: 'POST', + path: '/{id}/fail', + }), + + post: stripeMethod({ + method: 'POST', + path: '/{id}/post', + }), + + returnOutboundPayment: stripeMethod({ + method: 'POST', + path: '/{id}/return', + }), +}); diff --git a/lib/resources/TestHelpers/Treasury/OutboundTransfers.js b/lib/resources/TestHelpers/Treasury/OutboundTransfers.js new file mode 100644 index 0000000000..90d7d6236b --- /dev/null +++ b/lib/resources/TestHelpers/Treasury/OutboundTransfers.js @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'test_helpers/treasury/outbound_transfers', + + fail: stripeMethod({ + method: 'POST', + path: '/{outboundTransfer}/fail', + }), + + post: stripeMethod({ + method: 'POST', + path: '/{outboundTransfer}/post', + }), + + returnOutboundTransfer: stripeMethod({ + method: 'POST', + path: '/{outboundTransfer}/return', + }), +}); diff --git a/lib/resources/TestHelpers/Treasury/ReceivedCredits.js b/lib/resources/TestHelpers/Treasury/ReceivedCredits.js new file mode 100644 index 0000000000..8c3e5f0286 --- /dev/null +++ b/lib/resources/TestHelpers/Treasury/ReceivedCredits.js @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'test_helpers/treasury/received_credits', + + create: stripeMethod({ + method: 'POST', + path: '', + }), +}); diff --git a/lib/resources/TestHelpers/Treasury/ReceivedDebits.js b/lib/resources/TestHelpers/Treasury/ReceivedDebits.js new file mode 100644 index 0000000000..e25dc03bd2 --- /dev/null +++ b/lib/resources/TestHelpers/Treasury/ReceivedDebits.js @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'test_helpers/treasury/received_debits', + + create: stripeMethod({ + method: 'POST', + path: '', + }), +}); diff --git a/lib/resources/Treasury/CreditReversals.js b/lib/resources/Treasury/CreditReversals.js new file mode 100644 index 0000000000..9039b816a2 --- /dev/null +++ b/lib/resources/Treasury/CreditReversals.js @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/credit_reversals', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{creditReversal}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/lib/resources/Treasury/DebitReversals.js b/lib/resources/Treasury/DebitReversals.js new file mode 100644 index 0000000000..f95bfe5372 --- /dev/null +++ b/lib/resources/Treasury/DebitReversals.js @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/debit_reversals', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{debitReversal}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/lib/resources/Treasury/FinancialAccounts.js b/lib/resources/Treasury/FinancialAccounts.js new file mode 100644 index 0000000000..a30b1273b6 --- /dev/null +++ b/lib/resources/Treasury/FinancialAccounts.js @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/financial_accounts', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{financialAccount}', + }), + + update: stripeMethod({ + method: 'POST', + path: '/{financialAccount}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + + retrieveFeatures: stripeMethod({ + method: 'GET', + path: '/{financialAccount}/features', + }), + + updateFeatures: stripeMethod({ + method: 'POST', + path: '/{financialAccount}/features', + }), +}); diff --git a/lib/resources/Treasury/InboundTransfers.js b/lib/resources/Treasury/InboundTransfers.js new file mode 100644 index 0000000000..468adba0e7 --- /dev/null +++ b/lib/resources/Treasury/InboundTransfers.js @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/inbound_transfers', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{id}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + + cancel: stripeMethod({ + method: 'POST', + path: '/{inboundTransfer}/cancel', + }), +}); diff --git a/lib/resources/Treasury/OutboundPayments.js b/lib/resources/Treasury/OutboundPayments.js new file mode 100644 index 0000000000..5d08eaad0d --- /dev/null +++ b/lib/resources/Treasury/OutboundPayments.js @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/outbound_payments', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{id}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + + cancel: stripeMethod({ + method: 'POST', + path: '/{id}/cancel', + }), +}); diff --git a/lib/resources/Treasury/OutboundTransfers.js b/lib/resources/Treasury/OutboundTransfers.js new file mode 100644 index 0000000000..40d72465dd --- /dev/null +++ b/lib/resources/Treasury/OutboundTransfers.js @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/outbound_transfers', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + retrieve: stripeMethod({ + method: 'GET', + path: '/{outboundTransfer}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + + cancel: stripeMethod({ + method: 'POST', + path: '/{outboundTransfer}/cancel', + }), +}); diff --git a/lib/resources/Treasury/ReceivedCredits.js b/lib/resources/Treasury/ReceivedCredits.js new file mode 100644 index 0000000000..98b11b1699 --- /dev/null +++ b/lib/resources/Treasury/ReceivedCredits.js @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/received_credits', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{id}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/lib/resources/Treasury/ReceivedDebits.js b/lib/resources/Treasury/ReceivedDebits.js new file mode 100644 index 0000000000..c472144aa9 --- /dev/null +++ b/lib/resources/Treasury/ReceivedDebits.js @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/received_debits', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{id}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/lib/resources/Treasury/TransactionEntries.js b/lib/resources/Treasury/TransactionEntries.js new file mode 100644 index 0000000000..a52c432d68 --- /dev/null +++ b/lib/resources/Treasury/TransactionEntries.js @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/transaction_entries', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{id}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/lib/resources/Treasury/Transactions.js b/lib/resources/Treasury/Transactions.js new file mode 100644 index 0000000000..a810413116 --- /dev/null +++ b/lib/resources/Treasury/Transactions.js @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'treasury/transactions', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{id}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index d10bc61426..3e05a0d5b5 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -6,40 +6,6 @@ const stripe = require('../../testUtils').getStripeMockClient(); const expect = require('chai').expect; describe('Customer', function() { - it('list method', async function() { - const customers = await stripe.customers.list({limit: 3}); - expect(customers).not.to.be.null; - }); - - it('create method', async function() { - const customer = await stripe.customers.create({ - description: 'My First Test Customer (created for API docs)', - }); - expect(customer).not.to.be.null; - }); - - it('retrieve method', async function() { - const customer = await stripe.customers.retrieve('cus_xxxxxxxxxxxxx'); - expect(customer).not.to.be.null; - }); - - it('update method', async function() { - const customer = await stripe.customers.update('cus_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(customer).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.customers.del('cus_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; - }); - - it('list method', async function() { - const customers = await stripe.customers.list({limit: 3}); - expect(customers).not.to.be.null; - }); - it('listPaymentMethods method', async function() { const paymentMethods = await stripe.customers.listPaymentMethods( 'cus_xyz', @@ -62,140 +28,183 @@ describe('Customer', function() { ); expect(fundingInstructions).not.to.be.null; }); -}); -describe('BalanceTransaction', function() { - it('retrieve method', async function() { - const balanceTransaction = await stripe.balanceTransactions.retrieve( - 'txn_xxxxxxxxxxxxx' - ); - expect(balanceTransaction).not.to.be.null; + it('list method', async function() { + const customers = await stripe.customers.list({limit: 3}); + expect(customers).not.to.be.null; }); - it('list method', async function() { - const balanceTransactions = await stripe.balanceTransactions.list({ - limit: 3, + it('search method', async function() { + const customers = await stripe.customers.search({ + query: "name:'fakename' AND metadata['foo']:'bar'", }); - expect(balanceTransactions).not.to.be.null; + expect(customers).not.to.be.null; }); -}); -describe('Charge', function() { it('create method', async function() { - const charge = await stripe.charges.create({ - amount: 2000, - currency: 'usd', - source: 'tok_xxxx', - description: 'My First Test Charge (created for API docs)', + const customer = await stripe.customers.create({ + description: 'My First Test Customer (created for API docs)', }); - expect(charge).not.to.be.null; + expect(customer).not.to.be.null; }); it('retrieve method', async function() { - const charge = await stripe.charges.retrieve('ch_xxxxxxxxxxxxx'); - expect(charge).not.to.be.null; + const customer = await stripe.customers.retrieve('cus_xxxxxxxxxxxxx'); + expect(customer).not.to.be.null; }); it('update method', async function() { - const charge = await stripe.charges.update('ch_xxxxxxxxxxxxx', { + const customer = await stripe.customers.update('cus_xxxxxxxxxxxxx', { metadata: {order_id: '6735'}, }); - expect(charge).not.to.be.null; + expect(customer).not.to.be.null; }); - it('capture method', async function() { - const charge = await stripe.charges.capture('ch_xxxxxxxxxxxxx'); - expect(charge).not.to.be.null; + it('del method', async function() { + const deleted = await stripe.customers.del('cus_xxxxxxxxxxxxx'); + expect(deleted).not.to.be.null; }); it('list method', async function() { - const charges = await stripe.charges.list({limit: 3}); - expect(charges).not.to.be.null; + const customers = await stripe.customers.list({limit: 3}); + expect(customers).not.to.be.null; + }); + + it('search method', async function() { + const customers = await stripe.customers.search({ + query: "name:'fakename' AND metadata['foo']:'bar'", + }); + expect(customers).not.to.be.null; + }); + + it('listPaymentMethods method', async function() { + const paymentMethods = await stripe.customers.listPaymentMethods( + 'cus_xxxxxxxxxxxxx', + {type: 'card'} + ); + expect(paymentMethods).not.to.be.null; }); }); -describe('Dispute', function() { - it('retrieve method', async function() { - const dispute = await stripe.disputes.retrieve('dp_xxxxxxxxxxxxx'); - expect(dispute).not.to.be.null; +describe('Checkout.Session', function() { + it('expire method', async function() { + const session = await stripe.checkout.sessions.expire('sess_xyz'); + expect(session).not.to.be.null; }); - it('update method', async function() { - const dispute = await stripe.disputes.update('dp_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, + it('create method', async function() { + const session = await stripe.checkout.sessions.create({ + success_url: 'https://example.com/success', + cancel_url: 'https://example.com/cancel', + mode: 'payment', + shipping_options: [ + {shipping_rate: 'shr_standard'}, + { + shipping_rate_data: { + display_name: 'Standard', + delivery_estimate: { + minimum: {unit: 'day', value: 5}, + maximum: {unit: 'day', value: 7}, + }, + }, + }, + ], }); - expect(dispute).not.to.be.null; + expect(session).not.to.be.null; }); - it('close method', async function() { - const dispute = await stripe.disputes.close('dp_xxxxxxxxxxxxx'); - expect(dispute).not.to.be.null; + it('create method', async function() { + const session = await stripe.checkout.sessions.create({ + success_url: 'https://example.com/success', + cancel_url: 'https://example.com/cancel', + line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 2}], + mode: 'payment', + }); + expect(session).not.to.be.null; }); - it('list method', async function() { - const disputes = await stripe.disputes.list({limit: 3}); - expect(disputes).not.to.be.null; + it('expire method', async function() { + const session = await stripe.checkout.sessions.expire( + 'cs_test_xxxxxxxxxxxxx' + ); + expect(session).not.to.be.null; }); -}); -describe('Event', function() { it('retrieve method', async function() { - const event = await stripe.events.retrieve('evt_xxxxxxxxxxxxx'); - expect(event).not.to.be.null; + const session = await stripe.checkout.sessions.retrieve( + 'cs_test_xxxxxxxxxxxxx' + ); + expect(session).not.to.be.null; }); it('list method', async function() { - const events = await stripe.events.list({limit: 3}); - expect(events).not.to.be.null; + const sessions = await stripe.checkout.sessions.list({limit: 3}); + expect(sessions).not.to.be.null; }); }); -describe('File', function() { - it('retrieve method', async function() { - const file = await stripe.files.retrieve('file_xxxxxxxxxxxxx'); - expect(file).not.to.be.null; +describe('ShippingRate', function() { + it('create method', async function() { + const shippingRate = await stripe.shippingRates.create({ + display_name: 'Sample Shipper', + fixed_amount: {currency: 'usd', amount: 400}, + type: 'fixed_amount', + }); + expect(shippingRate).not.to.be.null; }); it('list method', async function() { - const files = await stripe.files.list({limit: 3}); - expect(files).not.to.be.null; + const shippingRates = await stripe.shippingRates.list(); + expect(shippingRates).not.to.be.null; }); -}); -describe('FileLink', function() { it('create method', async function() { - const fileLink = await stripe.fileLinks.create({ - file: 'file_xxxxxxxxxxxxx', + const shippingRate = await stripe.shippingRates.create({ + display_name: 'Ground shipping', + type: 'fixed_amount', + fixed_amount: {amount: 500, currency: 'usd'}, }); - expect(fileLink).not.to.be.null; + expect(shippingRate).not.to.be.null; }); it('retrieve method', async function() { - const fileLink = await stripe.fileLinks.retrieve('link_xxxxxxxxxxxxx'); - expect(fileLink).not.to.be.null; + const shippingRate = await stripe.shippingRates.retrieve( + 'shr_xxxxxxxxxxxxx' + ); + expect(shippingRate).not.to.be.null; }); it('update method', async function() { - const fileLink = await stripe.fileLinks.update('link_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(fileLink).not.to.be.null; + const shippingRate = await stripe.shippingRates.update( + 'shr_xxxxxxxxxxxxx', + {metadata: {order_id: '6735'}} + ); + expect(shippingRate).not.to.be.null; }); it('list method', async function() { - const fileLinks = await stripe.fileLinks.list({limit: 3}); - expect(fileLinks).not.to.be.null; + const shippingRates = await stripe.shippingRates.list({limit: 3}); + expect(shippingRates).not.to.be.null; }); }); -describe('Mandate', function() { - it('retrieve method', async function() { - const mandate = await stripe.mandates.retrieve('mandate_xxxxxxxxxxxxx'); - expect(mandate).not.to.be.null; +describe('PaymentIntent', function() { + it('create method', async function() { + const paymentIntent = await stripe.paymentIntents.create({ + amount: 1099, + currency: 'eur', + automatic_payment_methods: {enabled: true}, + }); + expect(paymentIntent).not.to.be.null; + }); + + it('verifyMicrodeposits method', async function() { + const paymentIntent = await stripe.paymentIntents.verifyMicrodeposits( + 'pi_xxxxxxxxxxxxx' + ); + expect(paymentIntent).not.to.be.null; }); -}); -describe('PaymentIntent', function() { it('create method', async function() { const paymentIntent = await stripe.paymentIntents.create({ amount: 2000, @@ -247,204 +256,766 @@ describe('PaymentIntent', function() { expect(paymentIntents).not.to.be.null; }); - it('create method', async function() { - const paymentIntent = await stripe.paymentIntents.create({ - amount: 1099, - currency: 'eur', - automatic_payment_methods: {enabled: true}, - }); + it('incrementAuthorization method', async function() { + const paymentIntent = await stripe.paymentIntents.incrementAuthorization( + 'pi_xxxxxxxxxxxxx', + {amount: 2099} + ); expect(paymentIntent).not.to.be.null; }); - it('verifyMicrodeposits method', async function() { - const paymentIntent = await stripe.paymentIntents.verifyMicrodeposits( + it('search method', async function() { + const paymentIntents = await stripe.paymentIntents.search({ + query: "status:'succeeded' AND metadata['order_id']:'6735'", + }); + expect(paymentIntents).not.to.be.null; + }); + + it('applyCustomerBalance method', async function() { + const paymentIntent = await stripe.paymentIntents.applyCustomerBalance( 'pi_xxxxxxxxxxxxx' ); expect(paymentIntent).not.to.be.null; }); }); -describe('SetupIntent', function() { +describe('PaymentLink', function() { it('create method', async function() { - const setupIntent = await stripe.setupIntents.create({ - payment_method_types: ['card'], + const paymentLink = await stripe.paymentLinks.create({ + line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 1}], }); - expect(setupIntent).not.to.be.null; + expect(paymentLink).not.to.be.null; + }); + + it('listLineItems method', async function() { + const lineItems = await stripe.paymentLinks.listLineItems('pl_xyz'); + expect(lineItems).not.to.be.null; }); it('retrieve method', async function() { - const setupIntent = await stripe.setupIntents.retrieve( - 'seti_xxxxxxxxxxxxx' - ); - expect(setupIntent).not.to.be.null; + const paymentLink = await stripe.paymentLinks.retrieve('pl_xyz'); + expect(paymentLink).not.to.be.null; }); - it('update method', async function() { - const setupIntent = await stripe.setupIntents.update('seti_xxxxxxxxxxxxx', { - metadata: {user_id: '3435453'}, + it('create method', async function() { + const paymentLink = await stripe.paymentLinks.create({ + line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 1}], }); - expect(setupIntent).not.to.be.null; + expect(paymentLink).not.to.be.null; }); - it('confirm method', async function() { - const setupIntent = await stripe.setupIntents.confirm( - 'seti_xxxxxxxxxxxxx', - {payment_method: 'pm_card_visa'} + it('retrieve method', async function() { + const paymentLink = await stripe.paymentLinks.retrieve( + 'plink_xxxxxxxxxxxxx' ); - expect(setupIntent).not.to.be.null; + expect(paymentLink).not.to.be.null; }); - it('cancel method', async function() { - const setupIntent = await stripe.setupIntents.cancel('seti_xxxxxxxxxxxxx'); - expect(setupIntent).not.to.be.null; + it('update method', async function() { + const paymentLink = await stripe.paymentLinks.update( + 'plink_xxxxxxxxxxxxx', + {active: false} + ); + expect(paymentLink).not.to.be.null; }); it('list method', async function() { - const setupIntents = await stripe.setupIntents.list({limit: 3}); - expect(setupIntents).not.to.be.null; + const paymentLinks = await stripe.paymentLinks.list({limit: 3}); + expect(paymentLinks).not.to.be.null; }); +}); +describe('SetupIntent', function() { it('verifyMicrodeposits method', async function() { const setupIntent = await stripe.setupIntents.verifyMicrodeposits( 'seti_xxxxxxxxxxxxx' ); expect(setupIntent).not.to.be.null; }); + + it('create method', async function() { + const setupIntent = await stripe.setupIntents.create({ + payment_method_types: ['card'], + }); + expect(setupIntent).not.to.be.null; + }); + + it('retrieve method', async function() { + const setupIntent = await stripe.setupIntents.retrieve( + 'seti_xxxxxxxxxxxxx' + ); + expect(setupIntent).not.to.be.null; + }); + + it('update method', async function() { + const setupIntent = await stripe.setupIntents.update('seti_xxxxxxxxxxxxx', { + metadata: {user_id: '3435453'}, + }); + expect(setupIntent).not.to.be.null; + }); + + it('confirm method', async function() { + const setupIntent = await stripe.setupIntents.confirm( + 'seti_xxxxxxxxxxxxx', + {payment_method: 'pm_card_visa'} + ); + expect(setupIntent).not.to.be.null; + }); + + it('cancel method', async function() { + const setupIntent = await stripe.setupIntents.cancel('seti_xxxxxxxxxxxxx'); + expect(setupIntent).not.to.be.null; + }); + + it('list method', async function() { + const setupIntents = await stripe.setupIntents.list({limit: 3}); + expect(setupIntents).not.to.be.null; + }); }); -describe('SetupAttempt', function() { +describe('TestHelpers.TestClock', function() { + it('create method', async function() { + const testClock = await stripe.testHelpers.testClocks.create({ + frozen_time: 123, + name: 'cogsworth', + }); + expect(testClock).not.to.be.null; + }); + + it('retrieve method', async function() { + const testClock = await stripe.testHelpers.testClocks.retrieve('clock_xyz'); + expect(testClock).not.to.be.null; + }); + it('list method', async function() { - const setupAttempts = await stripe.setupAttempts.list({ - setup_intent: 'seti_xxxxxxxxxxxxx', + const testClocks = await stripe.testHelpers.testClocks.list(); + expect(testClocks).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.testHelpers.testClocks.del('clock_xyz'); + expect(deleted).not.to.be.null; + }); + + it('advance method', async function() { + const testClock = await stripe.testHelpers.testClocks.advance('clock_xyz', { + frozen_time: 142, + }); + expect(testClock).not.to.be.null; + }); + + it('create method', async function() { + const testClock = await stripe.testHelpers.testClocks.create({ + frozen_time: 1577836800, + }); + expect(testClock).not.to.be.null; + }); + + it('retrieve method', async function() { + const testClock = await stripe.testHelpers.testClocks.retrieve( + 'clock_xxxxxxxxxxxxx' + ); + expect(testClock).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.testHelpers.testClocks.del( + 'clock_xxxxxxxxxxxxx' + ); + expect(deleted).not.to.be.null; + }); + + it('advance method', async function() { + const testClock = await stripe.testHelpers.testClocks.advance( + 'clock_xxxxxxxxxxxxx', + {frozen_time: 1652390605} + ); + expect(testClock).not.to.be.null; + }); + + it('list method', async function() { + const testClocks = await stripe.testHelpers.testClocks.list({limit: 3}); + expect(testClocks).not.to.be.null; + }); +}); + +describe('Terminal.Configuration', function() { + it('list method', async function() { + const configurations = await stripe.terminal.configurations.list(); + expect(configurations).not.to.be.null; + }); + + it('retrieve method', async function() { + const configuration = await stripe.terminal.configurations.retrieve( + 'uc_123' + ); + expect(configuration).not.to.be.null; + }); + + it('create method', async function() { + const configuration = await stripe.terminal.configurations.create(); + expect(configuration).not.to.be.null; + }); + + it('update method', async function() { + const configuration = await stripe.terminal.configurations.update( + 'uc_123', + {tipping: {usd: {fixed_amounts: [10]}}} + ); + expect(configuration).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.terminal.configurations.del('uc_123'); + expect(deleted).not.to.be.null; + }); + + it('create method', async function() { + const configuration = await stripe.terminal.configurations.create({ + bbpos_wisepos_e: {splashscreen: 'file_xxxxxxxxxxxxx'}, + }); + expect(configuration).not.to.be.null; + }); + + it('retrieve method', async function() { + const configuration = await stripe.terminal.configurations.retrieve( + 'tmc_xxxxxxxxxxxxx' + ); + expect(configuration).not.to.be.null; + }); + + it('update method', async function() { + const configuration = await stripe.terminal.configurations.update( + 'tmc_xxxxxxxxxxxxx', + {bbpos_wisepos_e: {splashscreen: 'file_xxxxxxxxxxxxx'}} + ); + expect(configuration).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.terminal.configurations.del( + 'tmc_xxxxxxxxxxxxx' + ); + expect(deleted).not.to.be.null; + }); + + it('list method', async function() { + const configurations = await stripe.terminal.configurations.list({ limit: 3, }); - expect(setupAttempts).not.to.be.null; + expect(configurations).not.to.be.null; }); }); -describe('Payout', function() { +describe('Refund', function() { + it('expire method', async function() { + const refund = await stripe.testHelpers.refunds.expire('re_123'); + expect(refund).not.to.be.null; + }); + it('create method', async function() { - const payout = await stripe.payouts.create({ - amount: 1100, + const refund = await stripe.refunds.create({ + charge: 'ch_xxxxxxxxxxxxx', + }); + expect(refund).not.to.be.null; + }); + + it('retrieve method', async function() { + const refund = await stripe.refunds.retrieve('re_xxxxxxxxxxxxx'); + expect(refund).not.to.be.null; + }); + + it('update method', async function() { + const refund = await stripe.refunds.update('re_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(refund).not.to.be.null; + }); + + it('cancel method', async function() { + const refund = await stripe.refunds.cancel('re_xxxxxxxxxxxxx'); + expect(refund).not.to.be.null; + }); + + it('list method', async function() { + const refunds = await stripe.refunds.list({limit: 3}); + expect(refunds).not.to.be.null; + }); +}); + +describe('Order', function() { + it('create method', async function() { + const order = await stripe.orders.create({ + description: 'description', currency: 'usd', + line_items: [{description: 'my line item'}], }); - expect(payout).not.to.be.null; + expect(order).not.to.be.null; + }); + + it('update method', async function() { + const order = await stripe.orders.update('order_xyz'); + expect(order).not.to.be.null; + }); + + it('listLineItems method', async function() { + const lineItems = await stripe.orders.listLineItems('order_xyz'); + expect(lineItems).not.to.be.null; + }); + + it('cancel method', async function() { + const order = await stripe.orders.cancel('order_xyz'); + expect(order).not.to.be.null; + }); + + it('reopen method', async function() { + const order = await stripe.orders.reopen('order_xyz'); + expect(order).not.to.be.null; + }); + + it('submit method', async function() { + const order = await stripe.orders.submit('order_xyz', { + expected_total: 100, + }); + expect(order).not.to.be.null; + }); + + it('update method', async function() { + const order = await stripe.orders.update('order_xyz'); + expect(order).not.to.be.null; + }); +}); + +describe('FinancialConnections.Account', function() { + it('retrieve method', async function() { + const account = await stripe.financialConnections.accounts.retrieve( + 'fca_xyz' + ); + expect(account).not.to.be.null; + }); + + it('refresh method', async function() { + const account = await stripe.financialConnections.accounts.refresh( + 'fca_xyz', + {features: ['balance']} + ); + expect(account).not.to.be.null; + }); + + it('disconnect method', async function() { + const account = await stripe.financialConnections.accounts.disconnect( + 'fca_xyz' + ); + expect(account).not.to.be.null; + }); + + it('list method', async function() { + const accounts = await stripe.financialConnections.accounts.list(); + expect(accounts).not.to.be.null; + }); + + it('listOwners method', async function() { + const accountOwners = await stripe.financialConnections.accounts.listOwners( + 'fca_xyz', + {ownership: 'fcaowns_xyz'} + ); + expect(accountOwners).not.to.be.null; + }); + + it('retrieve method', async function() { + const account = await stripe.financialConnections.accounts.retrieve( + 'fca_xxxxxxxxxxxxx' + ); + expect(account).not.to.be.null; + }); + + it('list method', async function() { + const accounts = await stripe.financialConnections.accounts.list({ + account_holder: {customer: 'cus_xxxxxxxxxxxxx'}, + }); + expect(accounts).not.to.be.null; + }); + + it('listOwners method', async function() { + const accountOwners = await stripe.financialConnections.accounts.listOwners( + 'fca_xxxxxxxxxxxxx', + {limit: 3, ownership: 'fcaowns_xxxxxxxxxxxxx'} + ); + expect(accountOwners).not.to.be.null; + }); +}); + +describe('FinancialConnections.Session', function() { + it('create method', async function() { + const session = await stripe.financialConnections.sessions.create({ + account_holder: {type: 'customer', customer: 'cus_123'}, + permissions: ['balances'], + }); + expect(session).not.to.be.null; + }); + + it('retrieve method', async function() { + const session = await stripe.financialConnections.sessions.retrieve( + 'fcsess_xyz' + ); + expect(session).not.to.be.null; + }); + + it('create method', async function() { + const session = await stripe.financialConnections.sessions.create({ + account_holder: {type: 'customer', customer: 'cus_xxxxxxxxxxxxx'}, + permissions: ['payment_method', 'balances'], + filters: {countries: ['US']}, + }); + expect(session).not.to.be.null; + }); + + it('retrieve method', async function() { + const session = await stripe.financialConnections.sessions.retrieve( + 'fcsess_xxxxxxxxxxxxx' + ); + expect(session).not.to.be.null; + }); +}); + +describe('Treasury.InboundTransfer', function() { + it('fail method', async function() { + const inboundTransfer = await stripe.testHelpers.treasury.inboundTransfers.fail( + 'ibt_123', + {failure_details: {code: 'account_closed'}} + ); + expect(inboundTransfer).not.to.be.null; + }); + + it('returnInboundTransfer method', async function() { + const inboundTransfer = await stripe.testHelpers.treasury.inboundTransfers.returnInboundTransfer( + 'ibt_123' + ); + expect(inboundTransfer).not.to.be.null; + }); + + it('succeed method', async function() { + const inboundTransfer = await stripe.testHelpers.treasury.inboundTransfers.succeed( + 'ibt_123' + ); + expect(inboundTransfer).not.to.be.null; + }); + + it('create method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + amount: 10000, + currency: 'usd', + origin_payment_method: 'pm_xxxxxxxxxxxxx', + description: 'InboundTransfer from my bank account', + }); + expect(inboundTransfer).not.to.be.null; + }); + + it('retrieve method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.retrieve( + 'ibt_xxxxxxxxxxxxx' + ); + expect(inboundTransfer).not.to.be.null; + }); + + it('list method', async function() { + const inboundTransfers = await stripe.treasury.inboundTransfers.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(inboundTransfers).not.to.be.null; + }); + + it('cancel method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.cancel( + 'ibt_xxxxxxxxxxxxx' + ); + expect(inboundTransfer).not.to.be.null; + }); +}); + +describe('Treasury.OutboundTransfer', function() { + it('post method', async function() { + const outboundTransfer = await stripe.testHelpers.treasury.outboundTransfers.post( + 'obt_123' + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('fail method', async function() { + const outboundTransfer = await stripe.testHelpers.treasury.outboundTransfers.fail( + 'obt_123' + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('returnOutboundTransfer method', async function() { + const outboundTransfer = await stripe.testHelpers.treasury.outboundTransfers.returnOutboundTransfer( + 'obt_123', + {returned_details: {code: 'account_closed'}} + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('create method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + destination_payment_method: 'pm_xxxxxxxxxxxxx', + amount: 500, + currency: 'usd', + description: 'OutboundTransfer to my external bank account', + }); + expect(outboundTransfer).not.to.be.null; + }); + + it('cancel method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.cancel( + 'obt_xxxxxxxxxxxxx' + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('retrieve method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.retrieve( + 'obt_xxxxxxxxxxxxx' + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('list method', async function() { + const outboundTransfers = await stripe.treasury.outboundTransfers.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(outboundTransfers).not.to.be.null; + }); +}); + +describe('Treasury.ReceivedCredit', function() { + it('create method', async function() { + const receivedCredit = await stripe.testHelpers.treasury.receivedCredits.create( + { + financial_account: 'fa_123', + network: 'ach', + amount: 1234, + currency: 'usd', + } + ); + expect(receivedCredit).not.to.be.null; + }); + + it('retrieve method', async function() { + const receivedCredit = await stripe.treasury.receivedCredits.retrieve( + 'rc_xxxxxxxxxxxxx' + ); + expect(receivedCredit).not.to.be.null; + }); + + it('list method', async function() { + const receivedCredits = await stripe.treasury.receivedCredits.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(receivedCredits).not.to.be.null; + }); +}); + +describe('Treasury.ReceivedDebit', function() { + it('create method', async function() { + const receivedDebit = await stripe.testHelpers.treasury.receivedDebits.create( + { + financial_account: 'fa_123', + network: 'ach', + amount: 1234, + currency: 'usd', + } + ); + expect(receivedDebit).not.to.be.null; + }); + + it('retrieve method', async function() { + const receivedDebit = await stripe.treasury.receivedDebits.retrieve( + 'rd_xxxxxxxxxxxxx' + ); + expect(receivedDebit).not.to.be.null; + }); + + it('list method', async function() { + const receivedDebits = await stripe.treasury.receivedDebits.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(receivedDebits).not.to.be.null; + }); +}); + +describe('Charge', function() { + it('create method', async function() { + const charge = await stripe.charges.create({ + amount: 2000, + currency: 'usd', + source: 'tok_xxxx', + description: 'My First Test Charge (created for API docs)', + }); + expect(charge).not.to.be.null; + }); + + it('retrieve method', async function() { + const charge = await stripe.charges.retrieve('ch_xxxxxxxxxxxxx'); + expect(charge).not.to.be.null; + }); + + it('update method', async function() { + const charge = await stripe.charges.update('ch_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(charge).not.to.be.null; + }); + + it('capture method', async function() { + const charge = await stripe.charges.capture('ch_xxxxxxxxxxxxx'); + expect(charge).not.to.be.null; + }); + + it('list method', async function() { + const charges = await stripe.charges.list({limit: 3}); + expect(charges).not.to.be.null; + }); + + it('search method', async function() { + const charges = await stripe.charges.search({ + query: "amount>999 AND metadata['order_id']:'6735'", + }); + expect(charges).not.to.be.null; + }); +}); + +describe('Dispute', function() { + it('retrieve method', async function() { + const dispute = await stripe.disputes.retrieve('dp_xxxxxxxxxxxxx'); + expect(dispute).not.to.be.null; + }); + + it('update method', async function() { + const dispute = await stripe.disputes.update('dp_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(dispute).not.to.be.null; + }); + + it('close method', async function() { + const dispute = await stripe.disputes.close('dp_xxxxxxxxxxxxx'); + expect(dispute).not.to.be.null; }); - it('retrieve method', async function() { - const payout = await stripe.payouts.retrieve('po_xxxxxxxxxxxxx'); - expect(payout).not.to.be.null; + it('list method', async function() { + const disputes = await stripe.disputes.list({limit: 3}); + expect(disputes).not.to.be.null; }); +}); - it('update method', async function() { - const payout = await stripe.payouts.update('po_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(payout).not.to.be.null; +describe('Event', function() { + it('retrieve method', async function() { + const event = await stripe.events.retrieve('evt_xxxxxxxxxxxxx'); + expect(event).not.to.be.null; }); it('list method', async function() { - const payouts = await stripe.payouts.list({limit: 3}); - expect(payouts).not.to.be.null; + const events = await stripe.events.list({limit: 3}); + expect(events).not.to.be.null; }); +}); - it('cancel method', async function() { - const payout = await stripe.payouts.cancel('po_xxxxxxxxxxxxx'); - expect(payout).not.to.be.null; +describe('File', function() { + it('retrieve method', async function() { + const file = await stripe.files.retrieve('file_xxxxxxxxxxxxx'); + expect(file).not.to.be.null; }); - it('reverse method', async function() { - const payout = await stripe.payouts.reverse('po_xxxxxxxxxxxxx'); - expect(payout).not.to.be.null; + it('list method', async function() { + const files = await stripe.files.list({limit: 3}); + expect(files).not.to.be.null; }); }); -describe('Product', function() { +describe('FileLink', function() { it('create method', async function() { - const product = await stripe.products.create({name: 'Gold Special'}); - expect(product).not.to.be.null; + const fileLink = await stripe.fileLinks.create({ + file: 'file_xxxxxxxxxxxxx', + }); + expect(fileLink).not.to.be.null; }); it('retrieve method', async function() { - const product = await stripe.products.retrieve('prod_xxxxxxxxxxxxx'); - expect(product).not.to.be.null; + const fileLink = await stripe.fileLinks.retrieve('link_xxxxxxxxxxxxx'); + expect(fileLink).not.to.be.null; }); it('update method', async function() { - const product = await stripe.products.update('prod_xxxxxxxxxxxxx', { + const fileLink = await stripe.fileLinks.update('link_xxxxxxxxxxxxx', { metadata: {order_id: '6735'}, }); - expect(product).not.to.be.null; + expect(fileLink).not.to.be.null; }); it('list method', async function() { - const products = await stripe.products.list({limit: 3}); - expect(products).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.products.del('prod_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; + const fileLinks = await stripe.fileLinks.list({limit: 3}); + expect(fileLinks).not.to.be.null; }); }); -describe('Price', function() { - it('create method', async function() { - const price = await stripe.prices.create({ - unit_amount: 2000, - currency: 'usd', - recurring: {interval: 'month'}, - product: 'prod_xxxxxxxxxxxxx', - }); - expect(price).not.to.be.null; - }); - +describe('Mandate', function() { it('retrieve method', async function() { - const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx'); - expect(price).not.to.be.null; - }); - - it('update method', async function() { - const price = await stripe.prices.update('price_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(price).not.to.be.null; + const mandate = await stripe.mandates.retrieve('mandate_xxxxxxxxxxxxx'); + expect(mandate).not.to.be.null; }); +}); +describe('SetupAttempt', function() { it('list method', async function() { - const prices = await stripe.prices.list({limit: 3}); - expect(prices).not.to.be.null; + const setupAttempts = await stripe.setupAttempts.list({ + limit: 3, + setup_intent: 'si_xyz', + }); + expect(setupAttempts).not.to.be.null; }); }); -describe('Refund', function() { +describe('Payout', function() { it('create method', async function() { - const refund = await stripe.refunds.create({ - charge: 'ch_xxxxxxxxxxxxx', + const payout = await stripe.payouts.create({ + amount: 1100, + currency: 'usd', }); - expect(refund).not.to.be.null; + expect(payout).not.to.be.null; }); it('retrieve method', async function() { - const refund = await stripe.refunds.retrieve('re_xxxxxxxxxxxxx'); - expect(refund).not.to.be.null; + const payout = await stripe.payouts.retrieve('po_xxxxxxxxxxxxx'); + expect(payout).not.to.be.null; }); it('update method', async function() { - const refund = await stripe.refunds.update('re_xxxxxxxxxxxxx', { + const payout = await stripe.payouts.update('po_xxxxxxxxxxxxx', { metadata: {order_id: '6735'}, }); - expect(refund).not.to.be.null; + expect(payout).not.to.be.null; }); it('list method', async function() { - const refunds = await stripe.refunds.list({limit: 3}); - expect(refunds).not.to.be.null; + const payouts = await stripe.payouts.list({limit: 3}); + expect(payouts).not.to.be.null; }); - it('expire method', async function() { - const refund = await stripe.testHelpers.refunds.expire('re_123'); - expect(refund).not.to.be.null; + it('cancel method', async function() { + const payout = await stripe.payouts.cancel('po_xxxxxxxxxxxxx'); + expect(payout).not.to.be.null; + }); + + it('reverse method', async function() { + const payout = await stripe.payouts.reverse('po_xxxxxxxxxxxxx'); + expect(payout).not.to.be.null; }); }); @@ -454,7 +1025,7 @@ describe('Token', function() { card: { number: '4242424242424242', exp_month: '5', - exp_year: '2022', + exp_year: '2023', cvc: '314', }, }); @@ -521,7 +1092,7 @@ describe('PaymentMethod', function() { card: { number: '4242424242424242', exp_month: 5, - exp_year: 2022, + exp_year: 2023, cvc: '314', }, }); @@ -590,107 +1161,190 @@ describe('Source', function() { }); expect(source).not.to.be.null; }); + + it('retrieve method', async function() { + const source = await stripe.sources.retrieve('src_xxxxxxxxxxxxx'); + expect(source).not.to.be.null; + }); }); -describe('Checkout.Session', function() { +describe('Product', function() { it('create method', async function() { - const session = await stripe.checkout.sessions.create({ - success_url: 'https://example.com/success', - cancel_url: 'https://example.com/cancel', - payment_method_types: ['card'], - line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 2}], - mode: 'payment', + const product = await stripe.products.create({name: 'Gold Special'}); + expect(product).not.to.be.null; + }); + + it('retrieve method', async function() { + const product = await stripe.products.retrieve('prod_xxxxxxxxxxxxx'); + expect(product).not.to.be.null; + }); + + it('update method', async function() { + const product = await stripe.products.update('prod_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, }); - expect(session).not.to.be.null; + expect(product).not.to.be.null; + }); + + it('list method', async function() { + const products = await stripe.products.list({limit: 3}); + expect(products).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.products.del('prod_xxxxxxxxxxxxx'); + expect(deleted).not.to.be.null; + }); + + it('search method', async function() { + const products = await stripe.products.search({ + query: "active:'true' AND metadata['order_id']:'6735'", + }); + expect(products).not.to.be.null; + }); +}); + +describe('Price', function() { + it('create method', async function() { + const price = await stripe.prices.create({ + unit_amount: 2000, + currency: 'usd', + recurring: {interval: 'month'}, + product: 'prod_xxxxxxxxxxxxx', + }); + expect(price).not.to.be.null; }); it('retrieve method', async function() { - const session = await stripe.checkout.sessions.retrieve( - 'cs_test_xxxxxxxxxxxxx' - ); - expect(session).not.to.be.null; + const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx'); + expect(price).not.to.be.null; + }); + + it('update method', async function() { + const price = await stripe.prices.update('price_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(price).not.to.be.null; }); it('list method', async function() { - const sessions = await stripe.checkout.sessions.list({limit: 3}); - expect(sessions).not.to.be.null; + const prices = await stripe.prices.list({limit: 3}); + expect(prices).not.to.be.null; }); - it('expire method', async function() { - const session = await stripe.checkout.sessions.expire('sess_xyz'); - expect(session).not.to.be.null; + it('search method', async function() { + const prices = await stripe.prices.search({ + query: "active:'true' AND metadata['order_id']:'6735'", + }); + expect(prices).not.to.be.null; }); +}); +describe('Coupon', function() { it('create method', async function() { - const session = await stripe.checkout.sessions.create({ - success_url: 'https://example.com/success', - cancel_url: 'https://example.com/cancel', - mode: 'payment', - shipping_options: [ - {shipping_rate: 'shr_standard'}, - { - shipping_rate_data: { - display_name: 'Standard', - delivery_estimate: { - minimum: {unit: 'day', value: 5}, - maximum: {unit: 'day', value: 7}, - }, - }, - }, - ], + const coupon = await stripe.coupons.create({ + percent_off: 25.5, + duration: 'repeating', + duration_in_months: 3, }); - expect(session).not.to.be.null; + expect(coupon).not.to.be.null; + }); + + it('retrieve method', async function() { + const coupon = await stripe.coupons.retrieve('Z4OV52SU'); + expect(coupon).not.to.be.null; + }); + + it('update method', async function() { + const coupon = await stripe.coupons.update('Z4OV52SU', { + metadata: {order_id: '6735'}, + }); + expect(coupon).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.coupons.del('Z4OV52SU'); + expect(deleted).not.to.be.null; + }); + + it('list method', async function() { + const coupons = await stripe.coupons.list({limit: 3}); + expect(coupons).not.to.be.null; + }); +}); + +describe('PromotionCode', function() { + it('create method', async function() { + const promotionCode = await stripe.promotionCodes.create({ + coupon: 'Z4OV52SU', + }); + expect(promotionCode).not.to.be.null; + }); + + it('update method', async function() { + const promotionCode = await stripe.promotionCodes.update( + 'promo_xxxxxxxxxxxxx', + {metadata: {order_id: '6735'}} + ); + expect(promotionCode).not.to.be.null; + }); + + it('retrieve method', async function() { + const promotionCode = await stripe.promotionCodes.retrieve( + 'promo_xxxxxxxxxxxxx' + ); + expect(promotionCode).not.to.be.null; + }); + + it('list method', async function() { + const promotionCodes = await stripe.promotionCodes.list({limit: 3}); + expect(promotionCodes).not.to.be.null; }); }); -describe('Coupon', function() { +describe('TaxCode', function() { + it('list method', async function() { + const taxCodes = await stripe.taxCodes.list({limit: 3}); + expect(taxCodes).not.to.be.null; + }); + + it('retrieve method', async function() { + const taxCode = await stripe.taxCodes.retrieve('txcd_xxxxxxxxxxxxx'); + expect(taxCode).not.to.be.null; + }); +}); + +describe('TaxRate', function() { it('create method', async function() { - const coupon = await stripe.coupons.create({ - percent_off: 25, - duration: 'repeating', - duration_in_months: 3, + const taxRate = await stripe.taxRates.create({ + display_name: 'VAT', + description: 'VAT Germany', + jurisdiction: 'DE', + percentage: 16, + inclusive: false, }); - expect(coupon).not.to.be.null; + expect(taxRate).not.to.be.null; }); it('retrieve method', async function() { - const coupon = await stripe.coupons.retrieve('25_5OFF'); - expect(coupon).not.to.be.null; + const taxRate = await stripe.taxRates.retrieve('txr_xxxxxxxxxxxxx'); + expect(taxRate).not.to.be.null; }); it('update method', async function() { - const coupon = await stripe.coupons.update('co_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, + const taxRate = await stripe.taxRates.update('txr_xxxxxxxxxxxxx', { + active: false, }); - expect(coupon).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.coupons.del('co_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; + expect(taxRate).not.to.be.null; }); it('list method', async function() { - const coupons = await stripe.coupons.list({limit: 3}); - expect(coupons).not.to.be.null; + const taxRates = await stripe.taxRates.list({limit: 3}); + expect(taxRates).not.to.be.null; }); }); describe('CreditNote', function() { - it('preview method', async function() { - const creditNote = await stripe.creditNotes.preview({ - invoice: 'in_xxxxxxxxxxxxx', - lines: [ - { - type: 'invoice_line_item', - invoice_line_item: 'il_xxxxxxxxxxxxx', - quantity: 1, - }, - ], - }); - expect(creditNote).not.to.be.null; - }); - it('create method', async function() { const creditNote = await stripe.creditNotes.create({ invoice: 'in_xxxxxxxxxxxxx', @@ -717,20 +1371,6 @@ describe('CreditNote', function() { expect(creditNote).not.to.be.null; }); - it('preview method', async function() { - const creditNote = await stripe.creditNotes.preview({ - invoice: 'in_xxxxxxxxxxxxx', - lines: [ - { - type: 'invoice_line_item', - invoice_line_item: 'il_xxxxxxxxxxxxx', - quantity: 1, - }, - ], - }); - expect(creditNote).not.to.be.null; - }); - it('voidCreditNote method', async function() { const creditNote = await stripe.creditNotes.voidCreditNote( 'cn_xxxxxxxxxxxxx' @@ -932,6 +1572,13 @@ describe('Invoice', function() { const invoices = await stripe.invoices.list({limit: 3}); expect(invoices).not.to.be.null; }); + + it('search method', async function() { + const invoices = await stripe.invoices.search({ + query: "total>999 AND metadata['order_id']:'6735'", + }); + expect(invoices).not.to.be.null; + }); }); describe('InvoiceItem', function() { @@ -1000,32 +1647,45 @@ describe('Plan', function() { }); }); -describe('PromotionCode', function() { +describe('Quote', function() { it('create method', async function() { - const promotionCode = await stripe.promotionCodes.create({ - coupon: '25_5OFF', + const quote = await stripe.quotes.create({ + customer: 'cus_xxxxxxxxxxxxx', + line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 2}], }); - expect(promotionCode).not.to.be.null; + expect(quote).not.to.be.null; + }); + + it('retrieve method', async function() { + const quote = await stripe.quotes.retrieve('qt_xxxxxxxxxxxxx'); + expect(quote).not.to.be.null; }); it('update method', async function() { - const promotionCode = await stripe.promotionCodes.update( - 'promo_xxxxxxxxxxxxx', - {metadata: {order_id: '6735'}} - ); - expect(promotionCode).not.to.be.null; + const quote = await stripe.quotes.update('qt_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(quote).not.to.be.null; }); - it('retrieve method', async function() { - const promotionCode = await stripe.promotionCodes.retrieve( - 'promo_xxxxxxxxxxxxx' - ); - expect(promotionCode).not.to.be.null; + it('finalizeQuote method', async function() { + const quote = await stripe.quotes.finalizeQuote('qt_xxxxxxxxxxxxx'); + expect(quote).not.to.be.null; + }); + + it('accept method', async function() { + const quote = await stripe.quotes.accept('qt_xxxxxxxxxxxxx'); + expect(quote).not.to.be.null; + }); + + it('cancel method', async function() { + const quote = await stripe.quotes.cancel('qt_xxxxxxxxxxxxx'); + expect(quote).not.to.be.null; }); it('list method', async function() { - const promotionCodes = await stripe.promotionCodes.list({limit: 3}); - expect(promotionCodes).not.to.be.null; + const quotes = await stripe.quotes.list({limit: 3}); + expect(quotes).not.to.be.null; }); }); @@ -1062,6 +1722,13 @@ describe('Subscription', function() { const subscriptions = await stripe.subscriptions.list({limit: 3}); expect(subscriptions).not.to.be.null; }); + + it('search method', async function() { + const subscriptions = await stripe.subscriptions.search({ + query: "status:'active' AND metadata['order_id']:'6735'", + }); + expect(subscriptions).not.to.be.null; + }); }); describe('SubscriptionItem', function() { @@ -1106,7 +1773,7 @@ describe('SubscriptionSchedule', function() { it('create method', async function() { const subscriptionSchedule = await stripe.subscriptionSchedules.create({ customer: 'cus_xxxxxxxxxxxxx', - start_date: 1620753115, + start_date: 1652909005, end_behavior: 'release', phases: [ { @@ -1155,36 +1822,6 @@ describe('SubscriptionSchedule', function() { }); }); -describe('TaxRate', function() { - it('create method', async function() { - const taxRate = await stripe.taxRates.create({ - display_name: 'VAT', - description: 'VAT Germany', - jurisdiction: 'DE', - percentage: 16, - inclusive: false, - }); - expect(taxRate).not.to.be.null; - }); - - it('retrieve method', async function() { - const taxRate = await stripe.taxRates.retrieve('txr_xxxxxxxxxxxxx'); - expect(taxRate).not.to.be.null; - }); - - it('update method', async function() { - const taxRate = await stripe.taxRates.update('txr_xxxxxxxxxxxxx', { - active: false, - }); - expect(taxRate).not.to.be.null; - }); - - it('list method', async function() { - const taxRates = await stripe.taxRates.list({limit: 3}); - expect(taxRates).not.to.be.null; - }); -}); - describe('UsageRecord', function() { it('createUsageRecord method', async function() { const usageRecord = await stripe.subscriptionItems.createUsageRecord( @@ -1783,68 +2420,252 @@ describe('Terminal.Location', function() { postal_code: '94111', }, }); - expect(location).not.to.be.null; + expect(location).not.to.be.null; + }); + + it('retrieve method', async function() { + const location = await stripe.terminal.locations.retrieve( + 'tml_xxxxxxxxxxxxx' + ); + expect(location).not.to.be.null; + }); + + it('update method', async function() { + const location = await stripe.terminal.locations.update( + 'tml_xxxxxxxxxxxxx', + {display_name: 'My First Store'} + ); + expect(location).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.terminal.locations.del('tml_xxxxxxxxxxxxx'); + expect(deleted).not.to.be.null; + }); + + it('list method', async function() { + const locations = await stripe.terminal.locations.list({limit: 3}); + expect(locations).not.to.be.null; + }); +}); + +describe('Terminal.Reader', function() { + it('create method', async function() { + const reader = await stripe.terminal.readers.create({ + registration_code: 'puppies-plug-could', + label: 'Blue Rabbit', + location: 'tml_1234', + }); + expect(reader).not.to.be.null; + }); + + it('retrieve method', async function() { + const reader = await stripe.terminal.readers.retrieve('tmr_xxxxxxxxxxxxx'); + expect(reader).not.to.be.null; + }); + + it('update method', async function() { + const reader = await stripe.terminal.readers.update('tmr_xxxxxxxxxxxxx', { + label: 'Blue Rabbit', + }); + expect(reader).not.to.be.null; + }); + + it('del method', async function() { + const deleted = await stripe.terminal.readers.del('tmr_xxxxxxxxxxxxx'); + expect(deleted).not.to.be.null; + }); + + it('list method', async function() { + const readers = await stripe.terminal.readers.list({limit: 3}); + expect(readers).not.to.be.null; + }); + + it('processPaymentIntent method', async function() { + const reader = await stripe.terminal.readers.processPaymentIntent( + 'tmr_xxxxxxxxxxxxx', + {payment_intent: 'pi_xxxxxxxxxxxxx'} + ); + expect(reader).not.to.be.null; + }); + + it('processSetupIntent method', async function() { + const reader = await stripe.terminal.readers.processSetupIntent( + 'tmr_xxxxxxxxxxxxx', + {setup_intent: 'seti_xxxxxxxxxxxxx', customer_consent_collected: true} + ); + expect(reader).not.to.be.null; + }); + + it('cancelAction method', async function() { + const reader = await stripe.terminal.readers.cancelAction( + 'tmr_xxxxxxxxxxxxx' + ); + expect(reader).not.to.be.null; + }); +}); + +describe('Treasury.FinancialAccount', function() { + it('create method', async function() { + const financialAccount = await stripe.treasury.financialAccounts.create({ + supported_currencies: ['usd'], + features: {}, + }); + expect(financialAccount).not.to.be.null; + }); + + it('update method', async function() { + const financialAccount = await stripe.treasury.financialAccounts.update( + 'fa_xxxxxxxxxxxxx', + {metadata: {order_id: '6735'}} + ); + expect(financialAccount).not.to.be.null; + }); + + it('retrieve method', async function() { + const financialAccount = await stripe.treasury.financialAccounts.retrieve( + 'fa_xxxxxxxxxxxxx' + ); + expect(financialAccount).not.to.be.null; + }); + + it('list method', async function() { + const financialAccounts = await stripe.treasury.financialAccounts.list({ + limit: 3, + }); + expect(financialAccounts).not.to.be.null; + }); + + it('updateFeatures method', async function() { + const financialAccountFeatures = await stripe.treasury.financialAccounts.updateFeatures( + 'fa_xxxxxxxxxxxxx' + ); + expect(financialAccountFeatures).not.to.be.null; + }); + + it('retrieveFeatures method', async function() { + const financialAccountFeatures = await stripe.treasury.financialAccounts.retrieveFeatures( + 'fa_xxxxxxxxxxxxx' + ); + expect(financialAccountFeatures).not.to.be.null; + }); +}); + +describe('Treasury.Transaction', function() { + it('retrieve method', async function() { + const transaction = await stripe.treasury.transactions.retrieve( + 'trxn_xxxxxxxxxxxxx' + ); + expect(transaction).not.to.be.null; + }); + + it('list method', async function() { + const transactions = await stripe.treasury.transactions.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(transactions).not.to.be.null; + }); +}); + +describe('Treasury.TransactionEntry', function() { + it('retrieve method', async function() { + const transactionEntry = await stripe.treasury.transactionEntries.retrieve( + 'trxne_xxxxxxxxxxxxx' + ); + expect(transactionEntry).not.to.be.null; + }); + + it('list method', async function() { + const transactionEntries = await stripe.treasury.transactionEntries.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(transactionEntries).not.to.be.null; + }); +}); + +describe('Treasury.OutboundPayment', function() { + it('create method', async function() { + const outboundPayment = await stripe.treasury.outboundPayments.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + amount: 10000, + currency: 'usd', + customer: 'cu_xxxxxxxxxxxxx', + destination_payment_method: 'pm_xxxxxxxxxxxxx', + description: 'OutboundPayment to a 3rd party', + }); + expect(outboundPayment).not.to.be.null; }); - it('retrieve method', async function() { - const location = await stripe.terminal.locations.retrieve( - 'tml_xxxxxxxxxxxxx' + it('cancel method', async function() { + const outboundPayment = await stripe.treasury.outboundPayments.cancel( + 'obp_xxxxxxxxxxxxx' ); - expect(location).not.to.be.null; + expect(outboundPayment).not.to.be.null; }); - it('update method', async function() { - const location = await stripe.terminal.locations.update( - 'tml_xxxxxxxxxxxxx', - {display_name: 'My First Store'} + it('retrieve method', async function() { + const outboundPayment = await stripe.treasury.outboundPayments.retrieve( + 'obp_xxxxxxxxxxxxx' ); - expect(location).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.terminal.locations.del('tml_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; + expect(outboundPayment).not.to.be.null; }); it('list method', async function() { - const locations = await stripe.terminal.locations.list({limit: 3}); - expect(locations).not.to.be.null; + const outboundPayments = await stripe.treasury.outboundPayments.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(outboundPayments).not.to.be.null; }); }); -describe('Terminal.Reader', function() { +describe('Treasury.CreditReversal', function() { it('create method', async function() { - const reader = await stripe.terminal.readers.create({ - registration_code: 'puppies-plug-could', - label: 'Blue Rabbit', - location: 'tml_1234', + const creditReversal = await stripe.treasury.creditReversals.create({ + received_credit: 'rc_xxxxxxxxxxxxx', }); - expect(reader).not.to.be.null; + expect(creditReversal).not.to.be.null; }); it('retrieve method', async function() { - const reader = await stripe.terminal.readers.retrieve( - 'tmr_P400-123-456-789' + const creditReversal = await stripe.treasury.creditReversals.retrieve( + 'credrev_xxxxxxxxxxxxx' ); - expect(reader).not.to.be.null; + expect(creditReversal).not.to.be.null; }); - it('update method', async function() { - const reader = await stripe.terminal.readers.update( - 'tmr_P400-123-456-789', - {label: 'Blue Rabbit'} - ); - expect(reader).not.to.be.null; + it('list method', async function() { + const creditReversals = await stripe.treasury.creditReversals.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(creditReversals).not.to.be.null; }); +}); - it('del method', async function() { - const deleted = await stripe.terminal.readers.del('tmr_P400-123-456-789'); - expect(deleted).not.to.be.null; +describe('Treasury.DebitReversal', function() { + it('create method', async function() { + const debitReversal = await stripe.treasury.debitReversals.create({ + received_debit: 'rd_xxxxxxxxxxxxx', + }); + expect(debitReversal).not.to.be.null; + }); + + it('retrieve method', async function() { + const debitReversal = await stripe.treasury.debitReversals.retrieve( + 'debrev_xxxxxxxxxxxxx' + ); + expect(debitReversal).not.to.be.null; }); it('list method', async function() { - const readers = await stripe.terminal.readers.list({limit: 3}); - expect(readers).not.to.be.null; + const debitReversals = await stripe.treasury.debitReversals.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(debitReversals).not.to.be.null; }); }); @@ -1935,220 +2756,98 @@ describe('Reporting.ReportType', function() { }); }); -describe('WebhookEndpoint', function() { +describe('Identity.VerificationSession', function() { it('create method', async function() { - const webhookEndpoint = await stripe.webhookEndpoints.create({ - url: 'https://example.com/my/webhook/endpoint', - enabled_events: ['charge.failed', 'charge.succeeded'], - }); - expect(webhookEndpoint).not.to.be.null; - }); - - it('retrieve method', async function() { - const webhookEndpoint = await stripe.webhookEndpoints.retrieve( - 'we_xxxxxxxxxxxxx' - ); - expect(webhookEndpoint).not.to.be.null; - }); - - it('update method', async function() { - const webhookEndpoint = await stripe.webhookEndpoints.update( - 'we_xxxxxxxxxxxxx', - {url: 'https://example.com/new_endpoint'} + const verificationSession = await stripe.identity.verificationSessions.create( + {type: 'document'} ); - expect(webhookEndpoint).not.to.be.null; - }); - - it('list method', async function() { - const webhookEndpoints = await stripe.webhookEndpoints.list({limit: 3}); - expect(webhookEndpoints).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.webhookEndpoints.del('we_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; - }); -}); - -describe('ShippingRate', function() { - it('create method', async function() { - const shippingRate = await stripe.shippingRates.create({ - display_name: 'Sample Shipper', - fixed_amount: {currency: 'usd', amount: 400}, - type: 'fixed_amount', - }); - expect(shippingRate).not.to.be.null; + expect(verificationSession).not.to.be.null; }); it('list method', async function() { - const shippingRates = await stripe.shippingRates.list(); - expect(shippingRates).not.to.be.null; - }); -}); - -describe('PaymentLink', function() { - it('create method', async function() { - const paymentLink = await stripe.paymentLinks.create({ - line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 1}], - }); - expect(paymentLink).not.to.be.null; - }); - - it('listLineItems method', async function() { - const lineItems = await stripe.paymentLinks.listLineItems('pl_xyz'); - expect(lineItems).not.to.be.null; - }); - - it('retrieve method', async function() { - const paymentLink = await stripe.paymentLinks.retrieve('pl_xyz'); - expect(paymentLink).not.to.be.null; - }); -}); - -describe('TestHelpers.TestClock', function() { - it('create method', async function() { - const testClock = await stripe.testHelpers.testClocks.create({ - frozen_time: 123, - name: 'cogsworth', - }); - expect(testClock).not.to.be.null; + const verificationSessions = await stripe.identity.verificationSessions.list( + {limit: 3} + ); + expect(verificationSessions).not.to.be.null; }); it('retrieve method', async function() { - const testClock = await stripe.testHelpers.testClocks.retrieve('clock_xyz'); - expect(testClock).not.to.be.null; + const verificationSession = await stripe.identity.verificationSessions.retrieve( + 'vs_xxxxxxxxxxxxx' + ); + expect(verificationSession).not.to.be.null; }); - it('list method', async function() { - const testClocks = await stripe.testHelpers.testClocks.list(); - expect(testClocks).not.to.be.null; + it('update method', async function() { + const verificationSession = await stripe.identity.verificationSessions.update( + 'vs_xxxxxxxxxxxxx', + {type: 'id_number'} + ); + expect(verificationSession).not.to.be.null; }); - it('del method', async function() { - const deleted = await stripe.testHelpers.testClocks.del('clock_xyz'); - expect(deleted).not.to.be.null; + it('cancel method', async function() { + const verificationSession = await stripe.identity.verificationSessions.cancel( + 'vs_xxxxxxxxxxxxx' + ); + expect(verificationSession).not.to.be.null; }); - it('advance method', async function() { - const testClock = await stripe.testHelpers.testClocks.advance('clock_xyz', { - frozen_time: 142, - }); - expect(testClock).not.to.be.null; + it('redact method', async function() { + const verificationSession = await stripe.identity.verificationSessions.redact( + 'vs_xxxxxxxxxxxxx' + ); + expect(verificationSession).not.to.be.null; }); }); -describe('Terminal.Configuration', function() { - it('list method', async function() { - const configurations = await stripe.terminal.configurations.list(); - expect(configurations).not.to.be.null; - }); - +describe('Identity.VerificationReport', function() { it('retrieve method', async function() { - const configuration = await stripe.terminal.configurations.retrieve( - 'uc_123' - ); - expect(configuration).not.to.be.null; - }); - - it('create method', async function() { - const configuration = await stripe.terminal.configurations.create(); - expect(configuration).not.to.be.null; - }); - - it('update method', async function() { - const configuration = await stripe.terminal.configurations.update( - 'uc_123', - {tipping: {usd: {fixed_amounts: [10]}}} + const verificationReport = await stripe.identity.verificationReports.retrieve( + 'vr_xxxxxxxxxxxxx' ); - expect(configuration).not.to.be.null; + expect(verificationReport).not.to.be.null; }); - it('del method', async function() { - const deleted = await stripe.terminal.configurations.del('uc_123'); - expect(deleted).not.to.be.null; + it('list method', async function() { + const verificationReports = await stripe.identity.verificationReports.list({ + limit: 3, + }); + expect(verificationReports).not.to.be.null; }); }); -describe('Order', function() { +describe('WebhookEndpoint', function() { it('create method', async function() { - const order = await stripe.orders.create({ - description: 'description', - currency: 'usd', - line_items: [{description: 'my line item'}], - }); - expect(order).not.to.be.null; - }); - - it('update method', async function() { - const order = await stripe.orders.update('order_xyz'); - expect(order).not.to.be.null; - }); - - it('listLineItems method', async function() { - const lineItems = await stripe.orders.listLineItems('order_xyz'); - expect(lineItems).not.to.be.null; - }); - - it('cancel method', async function() { - const order = await stripe.orders.cancel('order_xyz'); - expect(order).not.to.be.null; - }); - - it('reopen method', async function() { - const order = await stripe.orders.reopen('order_xyz'); - expect(order).not.to.be.null; - }); - - it('submit method', async function() { - const order = await stripe.orders.submit('order_xyz', { - expected_total: 100, + const webhookEndpoint = await stripe.webhookEndpoints.create({ + url: 'https://example.com/my/webhook/endpoint', + enabled_events: ['charge.failed', 'charge.succeeded'], }); - expect(order).not.to.be.null; - }); - - it('update method', async function() { - const order = await stripe.orders.update('order_xyz'); - expect(order).not.to.be.null; + expect(webhookEndpoint).not.to.be.null; }); -}); -describe('FinancialConnections.Account', function() { it('retrieve method', async function() { - const account = await stripe.financialConnections.accounts.retrieve( - 'fca_xyz' - ); - expect(account).not.to.be.null; - }); - - it('refresh method', async function() { - const account = await stripe.financialConnections.accounts.refresh( - 'fca_xyz', - {features: ['balance']} + const webhookEndpoint = await stripe.webhookEndpoints.retrieve( + 'we_xxxxxxxxxxxxx' ); - expect(account).not.to.be.null; + expect(webhookEndpoint).not.to.be.null; }); - it('disconnect method', async function() { - const account = await stripe.financialConnections.accounts.disconnect( - 'fca_xyz' + it('update method', async function() { + const webhookEndpoint = await stripe.webhookEndpoints.update( + 'we_xxxxxxxxxxxxx', + {url: 'https://example.com/new_endpoint'} ); - expect(account).not.to.be.null; + expect(webhookEndpoint).not.to.be.null; }); -}); -describe('FinancialConnections.Session', function() { - it('create method', async function() { - const session = await stripe.financialConnections.sessions.create({ - account_holder: {type: 'customer', customer: 'cus_123'}, - permissions: ['balances'], - }); - expect(session).not.to.be.null; + it('list method', async function() { + const webhookEndpoints = await stripe.webhookEndpoints.list({limit: 3}); + expect(webhookEndpoints).not.to.be.null; }); - it('retrieve method', async function() { - const session = await stripe.financialConnections.sessions.retrieve( - 'fcsess_xyz' - ); - expect(session).not.to.be.null; + it('del method', async function() { + const deleted = await stripe.webhookEndpoints.del('we_xxxxxxxxxxxxx'); + expect(deleted).not.to.be.null; }); }); diff --git a/types/2020-08-27/Accounts.d.ts b/types/2020-08-27/Accounts.d.ts index c0adc19916..7f4c8f212c 100644 --- a/types/2020-08-27/Accounts.d.ts +++ b/types/2020-08-27/Accounts.d.ts @@ -1078,7 +1078,7 @@ declare module 'stripe' { company?: AccountCreateParams.Company; /** - * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. + * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. */ country?: string; @@ -1870,12 +1870,12 @@ declare module 'stripe' { last_name?: string; /** - * The Kana varation of the individual's last name (Japan only). + * The Kana variation of the individual's last name (Japan only). */ last_name_kana?: string; /** - * The Kanji varation of the individual's last name (Japan only). + * The Kanji variation of the individual's last name (Japan only). */ last_name_kanji?: string; @@ -2960,12 +2960,12 @@ declare module 'stripe' { last_name?: string; /** - * The Kana varation of the individual's last name (Japan only). + * The Kana variation of the individual's last name (Japan only). */ last_name_kana?: string; /** - * The Kanji varation of the individual's last name (Japan only). + * The Kanji variation of the individual's last name (Japan only). */ last_name_kanji?: string; diff --git a/types/2020-08-27/BillingPortal/Configurations.d.ts b/types/2020-08-27/BillingPortal/Configurations.d.ts index f1ef2e4438..43743df1f8 100644 --- a/types/2020-08-27/BillingPortal/Configurations.d.ts +++ b/types/2020-08-27/BillingPortal/Configurations.d.ts @@ -322,7 +322,7 @@ declare module 'stripe' { /** * The types of customer updates that are supported. When empty, customers are not updateable. */ - allowed_updates: Stripe.Emptyable< + allowed_updates?: Stripe.Emptyable< Array >; diff --git a/types/2020-08-27/BillingPortal/Sessions.d.ts b/types/2020-08-27/BillingPortal/Sessions.d.ts index 8ab93c886f..4587533a8e 100644 --- a/types/2020-08-27/BillingPortal/Sessions.d.ts +++ b/types/2020-08-27/BillingPortal/Sessions.d.ts @@ -50,7 +50,7 @@ declare module 'stripe' { /** * The URL to redirect customers to when they click on the portal's link to return to your website. */ - return_url: string; + return_url: string | null; /** * The short-lived URL of the session that gives customers access to the customer portal. diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index e375b90611..654a2ade03 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -449,14 +449,34 @@ declare module 'stripe' { interface PaymentMethodOptions { acss_debit?: PaymentMethodOptions.AcssDebit; + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + alipay?: PaymentMethodOptions.Alipay; + au_becs_debit?: PaymentMethodOptions.AuBecsDebit; + + bacs_debit?: PaymentMethodOptions.BacsDebit; + boleto?: PaymentMethodOptions.Boleto; + eps?: PaymentMethodOptions.Eps; + + fpx?: PaymentMethodOptions.Fpx; + + giropay?: PaymentMethodOptions.Giropay; + + grabpay?: PaymentMethodOptions.Grabpay; + + klarna?: PaymentMethodOptions.Klarna; + konbini?: PaymentMethodOptions.Konbini; oxxo?: PaymentMethodOptions.Oxxo; + paynow?: PaymentMethodOptions.Paynow; + + sepa_debit?: PaymentMethodOptions.SepaDebit; + us_bank_account?: PaymentMethodOptions.UsBankAccount; } @@ -511,8 +531,14 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface AfterpayClearpay {} + interface Alipay {} + interface AuBecsDebit {} + + interface BacsDebit {} + 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. @@ -520,6 +546,16 @@ declare module 'stripe' { expires_after_days: number; } + interface Eps {} + + interface Fpx {} + + interface Giropay {} + + interface Grabpay {} + + interface Klarna {} + interface Konbini { /** * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. @@ -534,6 +570,10 @@ declare module 'stripe' { expires_after_days: number; } + interface Paynow {} + + interface SepaDebit {} + interface UsBankAccount { financial_connections?: UsBankAccount.FinancialConnections; @@ -1078,6 +1118,8 @@ declare module 'stripe' { /** * A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. * + * Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + * * Read more about the supported payment methods and their requirements in our [payment * method details guide](https://stripe.com/docs/payments/checkout/payment-methods). * diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index f1070a1a18..76eb3d16ed 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -835,6 +835,13 @@ declare module 'stripe' { | 'wechat_pay'; } + interface CustomerRetrievePaymentMethodParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + interface CustomerSearchParams { /** * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). @@ -948,6 +955,21 @@ declare module 'stripe' { options?: RequestOptions ): ApiListPromise; + /** + * Retrieves a PaymentMethod object. + */ + retrievePaymentMethod( + customerId: string, + id: string, + params?: CustomerRetrievePaymentMethodParams, + options?: RequestOptions + ): Promise>; + retrievePaymentMethod( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + /** * Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating diff --git a/types/2020-08-27/FinancialConnections/Accounts.d.ts b/types/2020-08-27/FinancialConnections/Accounts.d.ts index 2df9ce4e7e..1ffa56c970 100644 --- a/types/2020-08-27/FinancialConnections/Accounts.d.ts +++ b/types/2020-08-27/FinancialConnections/Accounts.d.ts @@ -247,6 +247,37 @@ declare module 'stripe' { expand?: Array; } + interface AccountListParams extends PaginationParams { + /** + * If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. + */ + account_holder?: AccountListParams.AccountHolder; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * If present, only return accounts that were collected as part of the given session. + */ + session?: string; + } + + namespace AccountListParams { + interface AccountHolder { + /** + * The ID of the Stripe account whose accounts will be retrieved. + */ + account?: string; + + /** + * The ID of the Stripe customer whose accounts will be retrieved. + */ + customer?: string; + } + } + interface AccountDisconnectParams { /** * Specifies which fields in the response should be expanded. @@ -254,6 +285,18 @@ declare module 'stripe' { expand?: Array; } + interface AccountListOwnersParams extends PaginationParams { + /** + * The ID of the ownership object to fetch owners from. + */ + ownership: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + interface AccountRefreshParams { /** * The list of account features that you would like to refresh. Either: `balance` or `ownership`. @@ -284,6 +327,17 @@ declare module 'stripe' { options?: RequestOptions ): Promise>; + /** + * Returns a list of Financial Connections Account objects. + */ + list( + params?: AccountListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + /** * Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). */ @@ -297,6 +351,15 @@ declare module 'stripe' { options?: RequestOptions ): Promise>; + /** + * Lists all owners for a given Account + */ + listOwners( + id: string, + params: AccountListOwnersParams, + options?: RequestOptions + ): ApiListPromise; + /** * Refreshes the data associated with a Financial Connections Account. */ diff --git a/types/2020-08-27/Issuing/Authorizations.d.ts b/types/2020-08-27/Issuing/Authorizations.d.ts index f076b1984d..04e6a0e4aa 100644 --- a/types/2020-08-27/Issuing/Authorizations.d.ts +++ b/types/2020-08-27/Issuing/Authorizations.d.ts @@ -104,6 +104,11 @@ declare module 'stripe' { */ transactions: Array; + /** + * [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). + */ + treasury?: Authorization.Treasury | null; + verification_data: Authorization.VerificationData; /** @@ -278,6 +283,23 @@ declare module 'stripe' { type Status = 'closed' | 'pending' | 'reversed'; + interface Treasury { + /** + * The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization + */ + received_credits: Array; + + /** + * The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization + */ + received_debits: Array; + + /** + * The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization + */ + transaction: string | null; + } + interface VerificationData { /** * Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. diff --git a/types/2020-08-27/Issuing/Cards.d.ts b/types/2020-08-27/Issuing/Cards.d.ts index 5b21d3fbd5..c937dfe53a 100644 --- a/types/2020-08-27/Issuing/Cards.d.ts +++ b/types/2020-08-27/Issuing/Cards.d.ts @@ -59,6 +59,11 @@ declare module 'stripe' { */ exp_year: number; + /** + * The financial account this card is attached to. + */ + financial_account?: string | null; + /** * The last 4 digits of the card number. */ @@ -1180,6 +1185,8 @@ declare module 'stripe' { */ expand?: Array; + financial_account?: string; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ diff --git a/types/2020-08-27/Issuing/Disputes.d.ts b/types/2020-08-27/Issuing/Disputes.d.ts index 81545332ee..342b5f756e 100644 --- a/types/2020-08-27/Issuing/Disputes.d.ts +++ b/types/2020-08-27/Issuing/Disputes.d.ts @@ -58,6 +58,11 @@ declare module 'stripe' { * The transaction being disputed. */ transaction: string | Stripe.Issuing.Transaction; + + /** + * [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + */ + treasury?: Dispute.Treasury | null; } namespace Dispute { @@ -316,6 +321,18 @@ declare module 'stripe' { } type Status = 'expired' | 'lost' | 'submitted' | 'unsubmitted' | 'won'; + + interface Treasury { + /** + * The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute + */ + debit_reversal: string | null; + + /** + * The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. + */ + received_debit: string; + } } interface DisputeCreateParams { @@ -338,6 +355,11 @@ declare module 'stripe' { * The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. */ transaction?: string; + + /** + * Params for disputes related to Treasury FinancialAccounts + */ + treasury?: DisputeCreateParams.Treasury; } namespace DisputeCreateParams { @@ -621,6 +643,13 @@ declare module 'stripe' { received_at?: Stripe.Emptyable; } } + + interface Treasury { + /** + * The ID of the ReceivedDebit to initiate an Issuings dispute for. + */ + received_debit: string; + } } interface DisputeRetrieveParams { diff --git a/types/2020-08-27/Issuing/Transactions.d.ts b/types/2020-08-27/Issuing/Transactions.d.ts index 9088fc0b47..aaae4eca2d 100644 --- a/types/2020-08-27/Issuing/Transactions.d.ts +++ b/types/2020-08-27/Issuing/Transactions.d.ts @@ -89,6 +89,11 @@ declare module 'stripe' { */ purchase_details: Transaction.PurchaseDetails | null; + /** + * [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + */ + treasury?: Transaction.Treasury | null; + /** * The nature of the transaction. */ @@ -296,6 +301,18 @@ declare module 'stripe' { } } + interface Treasury { + /** + * The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a refund + */ + received_credit: string | null; + + /** + * The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a capture + */ + received_debit: string | null; + } + type Type = 'capture' | 'refund'; type Wallet = 'apple_pay' | 'google_pay' | 'samsung_pay'; diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index 317473ad46..57321e49ef 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -38,6 +38,15 @@ declare module 'stripe' { */ billing_details: Order.BillingDetails | null; + /** + * The client secret of this Order. Used for client-side retrieval using a publishable key. + * + * The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + * + * Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. + */ + client_secret: string | null; + /** * Time at which the object was created. Measured in seconds since the Unix epoch. */ diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 82562d0f44..3bb43c7853 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -1614,7 +1614,7 @@ declare module 'stripe' { payment_method_options?: PaymentIntentCreateParams.PaymentMethodOptions; /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this is not provided, defaults to ["card"]. + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this is not provided, defaults to ["card"]. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). */ payment_method_types?: Array; @@ -3004,6 +3004,11 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -3042,6 +3047,17 @@ declare module 'stripe' { | 'transactions'; } + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; @@ -3202,7 +3218,7 @@ declare module 'stripe' { payment_method_options?: PaymentIntentUpdateParams.PaymentMethodOptions; /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). */ payment_method_types?: Array; @@ -4523,6 +4539,11 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -4561,6 +4582,17 @@ declare module 'stripe' { | 'transactions'; } + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; @@ -6179,6 +6211,11 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -6217,6 +6254,17 @@ declare module 'stripe' { | 'transactions'; } + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index 7b7d9e44f6..5c0f61c085 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -699,6 +699,11 @@ declare module 'stripe' { */ last4: string | null; + /** + * Contains information about US bank account networks that can be used. + */ + networks?: UsBankAccount.Networks | null; + /** * Routing number of the bank account. */ @@ -709,6 +714,22 @@ declare module 'stripe' { type AccountHolderType = 'company' | 'individual'; type AccountType = 'checking' | 'savings'; + + interface Networks { + /** + * The preferred network. + */ + preferred: string | null; + + /** + * All supported networks. + */ + supported: Array; + } + + namespace Networks { + type Supported = 'ach' | 'us_domestic_wire'; + } } interface WechatPay {} diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2020-08-27/SetupIntents.d.ts index 540b3f2b6e..26a7496ef5 100644 --- a/types/2020-08-27/SetupIntents.d.ts +++ b/types/2020-08-27/SetupIntents.d.ts @@ -21,6 +21,13 @@ declare module 'stripe' { */ application: string | Stripe.Application | null; + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + /** * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. */ @@ -50,6 +57,13 @@ declare module 'stripe' { */ description: string | null; + /** + * Indicates the directions of money movement for which this payment method is intended to be used. + * + * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + */ + flow_directions?: Array | null; + /** * The error encountered in the previous SetupIntent confirmation. */ @@ -124,6 +138,8 @@ declare module 'stripe' { | 'duplicate' | 'requested_by_customer'; + type FlowDirection = 'inbound' | 'outbound'; + interface LastSetupError { /** * For card errors, the ID of the failed charge. @@ -1246,6 +1262,11 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + /** * Verification method for the intent */ @@ -1273,6 +1294,17 @@ declare module 'stripe' { | 'transactions'; } + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -2001,6 +2033,11 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + /** * Verification method for the intent */ @@ -2028,6 +2065,17 @@ declare module 'stripe' { | 'transactions'; } + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } @@ -2847,6 +2895,11 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + /** * Verification method for the intent */ @@ -2874,6 +2927,17 @@ declare module 'stripe' { | 'transactions'; } + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } } diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index f645521de9..2a7e26ef64 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -259,6 +259,11 @@ declare module 'stripe' { * The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). */ payment_method_types: Array | null; + + /** + * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + */ + save_default_payment_method: PaymentSettings.SaveDefaultPaymentMethod | null; } namespace PaymentSettings { @@ -430,6 +435,8 @@ declare module 'stripe' { | 'sofort' | 'us_bank_account' | 'wechat_pay'; + + type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; } interface PendingInvoiceItemInterval { @@ -514,7 +521,7 @@ declare module 'stripe' { application_fee_percent?: number; /** - * Automatic tax settings for this subscription. + * Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. */ automatic_tax?: SubscriptionCreateParams.AutomaticTax; @@ -849,6 +856,11 @@ declare module 'stripe' { payment_method_types?: Stripe.Emptyable< Array >; + + /** + * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + */ + save_default_payment_method?: PaymentSettings.SaveDefaultPaymentMethod; } namespace PaymentSettings { @@ -1040,6 +1052,8 @@ declare module 'stripe' { | 'sofort' | 'us_bank_account' | 'wechat_pay'; + + type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; } interface PendingInvoiceItemInterval { @@ -1092,7 +1106,7 @@ declare module 'stripe' { application_fee_percent?: number; /** - * Automatic tax settings for this subscription. + * Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. */ automatic_tax?: SubscriptionUpdateParams.AutomaticTax; @@ -1464,6 +1478,11 @@ declare module 'stripe' { payment_method_types?: Stripe.Emptyable< Array >; + + /** + * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + */ + save_default_payment_method?: PaymentSettings.SaveDefaultPaymentMethod; } namespace PaymentSettings { @@ -1655,6 +1674,8 @@ declare module 'stripe' { | 'sofort' | 'us_bank_account' | 'wechat_pay'; + + type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; } interface PendingInvoiceItemInterval { diff --git a/types/2020-08-27/Terminal/Configurations.d.ts b/types/2020-08-27/Terminal/Configurations.d.ts index e68622a450..cf7cec56ff 100644 --- a/types/2020-08-27/Terminal/Configurations.d.ts +++ b/types/2020-08-27/Terminal/Configurations.d.ts @@ -51,6 +51,8 @@ declare module 'stripe' { chf?: Tipping.Chf; + czk?: Tipping.Czk; + dkk?: Tipping.Dkk; eur?: Tipping.Eur; @@ -124,6 +126,23 @@ declare module 'stripe' { smart_tip_threshold?: number; } + interface Czk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts: Array | null; + + /** + * Percentages displayed when collecting a tip + */ + percentages: Array | null; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + interface Dkk { /** * Fixed amounts displayed when collecting a tip @@ -369,6 +388,11 @@ declare module 'stripe' { */ chf?: Tipping.Chf; + /** + * Tipping configuration for CZK + */ + czk?: Tipping.Czk; + /** * Tipping configuration for DKK */ @@ -472,6 +496,23 @@ declare module 'stripe' { smart_tip_threshold?: number; } + interface Czk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + interface Dkk { /** * Fixed amounts displayed when collecting a tip @@ -708,6 +749,11 @@ declare module 'stripe' { */ chf?: Tipping.Chf; + /** + * Tipping configuration for CZK + */ + czk?: Tipping.Czk; + /** * Tipping configuration for DKK */ @@ -811,6 +857,23 @@ declare module 'stripe' { smart_tip_threshold?: number; } + interface Czk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + interface Dkk { /** * Fixed amounts displayed when collecting a tip diff --git a/types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts b/types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts new file mode 100644 index 0000000000..0cc45af537 --- /dev/null +++ b/types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts @@ -0,0 +1,108 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace TestHelpers { + namespace Treasury { + interface InboundTransferFailParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Details about a failed InboundTransfer. + */ + failure_details?: InboundTransferFailParams.FailureDetails; + } + + namespace InboundTransferFailParams { + interface FailureDetails { + /** + * Reason for the failure. + */ + code?: FailureDetails.Code; + } + + namespace FailureDetails { + type Code = + | 'account_closed' + | 'account_frozen' + | 'bank_account_restricted' + | 'bank_ownership_changed' + | 'debit_not_authorized' + | 'incorrect_account_holder_address' + | 'incorrect_account_holder_name' + | 'incorrect_account_holder_tax_id' + | 'insufficient_funds' + | 'invalid_account_number' + | 'invalid_currency' + | 'no_account' + | 'other'; + } + } + } + + namespace Treasury { + interface InboundTransferReturnInboundTransferParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } + + namespace Treasury { + interface InboundTransferSucceedParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } + + namespace Treasury { + class InboundTransfersResource { + /** + * Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. + */ + fail( + id: string, + params?: InboundTransferFailParams, + options?: RequestOptions + ): Promise>; + fail( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. + */ + returnInboundTransfer( + id: string, + params?: InboundTransferReturnInboundTransferParams, + options?: RequestOptions + ): Promise>; + returnInboundTransfer( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. + */ + succeed( + id: string, + params?: InboundTransferSucceedParams, + options?: RequestOptions + ): Promise>; + succeed( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } + } +} diff --git a/types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts b/types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts new file mode 100644 index 0000000000..b12ec8dded --- /dev/null +++ b/types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts @@ -0,0 +1,105 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace TestHelpers { + namespace Treasury { + interface OutboundPaymentFailParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } + + namespace Treasury { + interface OutboundPaymentPostParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } + + namespace Treasury { + interface OutboundPaymentReturnOutboundPaymentParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Optional hash to set the the return code. + */ + returned_details?: OutboundPaymentReturnOutboundPaymentParams.ReturnedDetails; + } + + namespace OutboundPaymentReturnOutboundPaymentParams { + interface ReturnedDetails { + /** + * The return code to be set on the OutboundPayment object. + */ + code?: ReturnedDetails.Code; + } + + namespace ReturnedDetails { + type Code = + | 'account_closed' + | 'account_frozen' + | 'bank_account_restricted' + | 'bank_ownership_changed' + | 'declined' + | 'incorrect_account_holder_name' + | 'invalid_account_number' + | 'invalid_currency' + | 'no_account' + | 'other'; + } + } + } + + namespace Treasury { + class OutboundPaymentsResource { + /** + * Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. + */ + fail( + id: string, + params?: OutboundPaymentFailParams, + options?: RequestOptions + ): Promise>; + fail( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. + */ + post( + id: string, + params?: OutboundPaymentPostParams, + options?: RequestOptions + ): Promise>; + post( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. + */ + returnOutboundPayment( + id: string, + params?: OutboundPaymentReturnOutboundPaymentParams, + options?: RequestOptions + ): Promise>; + returnOutboundPayment( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } + } +} diff --git a/types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts b/types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts new file mode 100644 index 0000000000..cbce3d8b30 --- /dev/null +++ b/types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts @@ -0,0 +1,105 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace TestHelpers { + namespace Treasury { + interface OutboundTransferFailParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } + + namespace Treasury { + interface OutboundTransferPostParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } + + namespace Treasury { + interface OutboundTransferReturnOutboundTransferParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Details about a returned OutboundTransfer. + */ + returned_details?: OutboundTransferReturnOutboundTransferParams.ReturnedDetails; + } + + namespace OutboundTransferReturnOutboundTransferParams { + interface ReturnedDetails { + /** + * Reason for the return. + */ + code?: ReturnedDetails.Code; + } + + namespace ReturnedDetails { + type Code = + | 'account_closed' + | 'account_frozen' + | 'bank_account_restricted' + | 'bank_ownership_changed' + | 'declined' + | 'incorrect_account_holder_name' + | 'invalid_account_number' + | 'invalid_currency' + | 'no_account' + | 'other'; + } + } + } + + namespace Treasury { + class OutboundTransfersResource { + /** + * Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. + */ + fail( + id: string, + params?: OutboundTransferFailParams, + options?: RequestOptions + ): Promise>; + fail( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. + */ + post( + id: string, + params?: OutboundTransferPostParams, + options?: RequestOptions + ): Promise>; + post( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. + */ + returnOutboundTransfer( + id: string, + params?: OutboundTransferReturnOutboundTransferParams, + options?: RequestOptions + ): Promise>; + returnOutboundTransfer( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } + } +} diff --git a/types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts b/types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts new file mode 100644 index 0000000000..1c8f5a39da --- /dev/null +++ b/types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace TestHelpers { + namespace Treasury { + interface ReceivedCreditCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The FinancialAccount to send funds to. + */ + financial_account: string; + + /** + * The rails used for the object. + */ + network: ReceivedCreditCreateParams.Network; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Initiating payment method details for the object. + */ + initiating_payment_method_details?: ReceivedCreditCreateParams.InitiatingPaymentMethodDetails; + } + + namespace ReceivedCreditCreateParams { + interface InitiatingPaymentMethodDetails { + /** + * The source type. + */ + type: 'us_bank_account'; + + /** + * Optional fields for `us_bank_account`. + */ + us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount; + } + + namespace InitiatingPaymentMethodDetails { + interface UsBankAccount { + /** + * The bank account holder's name. + */ + account_holder_name?: string; + + /** + * The bank account number. + */ + account_number?: string; + + /** + * The bank account's routing number. + */ + routing_number?: string; + } + } + + type Network = 'ach' | 'us_domestic_wire'; + } + } + + namespace Treasury { + class ReceivedCreditsResource { + /** + * Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. + */ + create( + params: ReceivedCreditCreateParams, + options?: RequestOptions + ): Promise>; + } + } + } + } +} diff --git a/types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts b/types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts new file mode 100644 index 0000000000..cd9c3b6b94 --- /dev/null +++ b/types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace TestHelpers { + namespace Treasury { + interface ReceivedDebitCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The FinancialAccount to pull funds from. + */ + financial_account: string; + + /** + * The rails used for the object. + */ + network: 'ach'; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Initiating payment method details for the object. + */ + initiating_payment_method_details?: ReceivedDebitCreateParams.InitiatingPaymentMethodDetails; + } + + namespace ReceivedDebitCreateParams { + interface InitiatingPaymentMethodDetails { + /** + * The source type. + */ + type: 'us_bank_account'; + + /** + * Optional fields for `us_bank_account`. + */ + us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount; + } + + namespace InitiatingPaymentMethodDetails { + interface UsBankAccount { + /** + * The bank account holder's name. + */ + account_holder_name?: string; + + /** + * The bank account number. + */ + account_number?: string; + + /** + * The bank account's routing number. + */ + routing_number?: string; + } + } + } + } + + namespace Treasury { + class ReceivedDebitsResource { + /** + * Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. + */ + create( + params: ReceivedDebitCreateParams, + options?: RequestOptions + ): Promise>; + } + } + } + } +} diff --git a/types/2020-08-27/Tokens.d.ts b/types/2020-08-27/Tokens.d.ts index 63bb76cfc2..61c31e6dce 100644 --- a/types/2020-08-27/Tokens.d.ts +++ b/types/2020-08-27/Tokens.d.ts @@ -351,12 +351,12 @@ declare module 'stripe' { last_name?: string; /** - * The Kana varation of the individual's last name (Japan only). + * The Kana variation of the individual's last name (Japan only). */ last_name_kana?: string; /** - * The Kanji varation of the individual's last name (Japan only). + * The Kanji variation of the individual's last name (Japan only). */ last_name_kanji?: string; diff --git a/types/2020-08-27/Treasury/CreditReversals.d.ts b/types/2020-08-27/Treasury/CreditReversals.d.ts new file mode 100644 index 0000000000..f456290452 --- /dev/null +++ b/types/2020-08-27/Treasury/CreditReversals.d.ts @@ -0,0 +1,168 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The CreditReversal object. + */ + interface CreditReversal { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.credit_reversal'; + + /** + * Amount (in cents) transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The FinancialAccount to reverse funds from. + */ + financial_account: string; + + /** + * A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + */ + hosted_regulatory_receipt_url: string | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Stripe.Metadata; + + /** + * The rails used to reverse the funds. + */ + network: CreditReversal.Network; + + /** + * The ReceivedCredit being reversed. + */ + received_credit: string; + + /** + * Status of the CreditReversal + */ + status: CreditReversal.Status; + + status_transitions: CreditReversal.StatusTransitions; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction | null; + } + + namespace CreditReversal { + type Network = 'ach' | 'stripe'; + + type Status = 'canceled' | 'posted' | 'processing'; + + interface StatusTransitions { + /** + * Timestamp describing when the CreditReversal changed status to `posted` + */ + posted_at: number | null; + } + } + + interface CreditReversalCreateParams { + /** + * The ReceivedCredit to reverse. + */ + received_credit: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + } + + interface CreditReversalRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CreditReversalListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return CreditReversals for the ReceivedCredit ID. + */ + received_credit?: string; + + /** + * Only return CreditReversals for a given status. + */ + status?: CreditReversalListParams.Status; + } + + namespace CreditReversalListParams { + type Status = 'canceled' | 'posted' | 'processing'; + } + + class CreditReversalsResource { + /** + * Reverses a ReceivedCredit and creates a CreditReversal object. + */ + create( + params: CreditReversalCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list + */ + retrieve( + id: string, + params?: CreditReversalRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of CreditReversals. + */ + list( + params: CreditReversalListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2020-08-27/Treasury/DebitReversals.d.ts b/types/2020-08-27/Treasury/DebitReversals.d.ts new file mode 100644 index 0000000000..22eceed13a --- /dev/null +++ b/types/2020-08-27/Treasury/DebitReversals.d.ts @@ -0,0 +1,187 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The DebitReversal object. + */ + interface DebitReversal { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.debit_reversal'; + + /** + * Amount (in cents) transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The FinancialAccount to reverse funds from. + */ + financial_account: string | null; + + /** + * A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + */ + hosted_regulatory_receipt_url: string | null; + + /** + * Other flows linked to a DebitReversal. + */ + linked_flows: DebitReversal.LinkedFlows | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Stripe.Metadata; + + /** + * The rails used to reverse the funds. + */ + network: DebitReversal.Network; + + /** + * The ReceivedDebit being reversed. + */ + received_debit: string; + + /** + * Status of the DebitReversal + */ + status: DebitReversal.Status; + + status_transitions: DebitReversal.StatusTransitions; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction | null; + } + + namespace DebitReversal { + interface LinkedFlows { + /** + * Set if there is an Issuing dispute associated with the DebitReversal. + */ + issuing_dispute: string | null; + } + + type Network = 'ach' | 'card'; + + type Status = 'failed' | 'processing' | 'succeeded'; + + interface StatusTransitions { + /** + * Timestamp describing when the DebitReversal changed status to `completed`. + */ + completed_at: number | null; + } + } + + interface DebitReversalCreateParams { + /** + * The ReceivedDebit to reverse. + */ + received_debit: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + } + + interface DebitReversalRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface DebitReversalListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return DebitReversals for the ReceivedDebit ID. + */ + received_debit?: string; + + /** + * Only return DebitReversals for a given resolution. + */ + resolution?: DebitReversalListParams.Resolution; + + /** + * Only return DebitReversals for a given status. + */ + status?: DebitReversalListParams.Status; + } + + namespace DebitReversalListParams { + type Resolution = 'lost' | 'won'; + + type Status = 'canceled' | 'completed' | 'processing'; + } + + class DebitReversalsResource { + /** + * Reverses a ReceivedDebit and creates a DebitReversal object. + */ + create( + params: DebitReversalCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a DebitReversal object. + */ + retrieve( + id: string, + params?: DebitReversalRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of DebitReversals. + */ + list( + params: DebitReversalListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts b/types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts new file mode 100644 index 0000000000..0fcef80e5f --- /dev/null +++ b/types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts @@ -0,0 +1,622 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The FinancialAccountFeatures object. + */ + interface FinancialAccountFeatures { + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.financial_account_features'; + + /** + * Toggle settings for enabling/disabling a feature + */ + card_issuing?: FinancialAccountFeatures.CardIssuing; + + /** + * Toggle settings for enabling/disabling a feature + */ + deposit_insurance?: FinancialAccountFeatures.DepositInsurance; + + /** + * Settings related to Financial Addresses features on a Financial Account + */ + financial_addresses?: FinancialAccountFeatures.FinancialAddresses; + + /** + * InboundTransfers contains inbound transfers features for a FinancialAccount. + */ + inbound_transfers?: FinancialAccountFeatures.InboundTransfers; + + /** + * Toggle settings for enabling/disabling a feature + */ + intra_stripe_flows?: FinancialAccountFeatures.IntraStripeFlows; + + /** + * Settings related to Outbound Payments features on a Financial Account + */ + outbound_payments?: FinancialAccountFeatures.OutboundPayments; + + /** + * OutboundTransfers contains outbound transfers features for a FinancialAccount. + */ + outbound_transfers?: FinancialAccountFeatures.OutboundTransfers; + } + + namespace FinancialAccountFeatures { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: CardIssuing.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace CardIssuing { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: DepositInsurance.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace DepositInsurance { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + + interface FinancialAddresses { + /** + * Toggle settings for enabling/disabling a feature + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: Aba.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace Aba { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + } + + interface InboundTransfers { + /** + * Toggle settings for enabling/disabling a feature + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: Ach.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace Ach { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: IntraStripeFlows.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace IntraStripeFlows { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + + interface OutboundPayments { + /** + * Toggle settings for enabling/disabling a feature + */ + ach?: OutboundPayments.Ach; + + /** + * Toggle settings for enabling/disabling a feature + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: Ach.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace Ach { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: UsDomesticWire.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace UsDomesticWire { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + } + + interface OutboundTransfers { + /** + * Toggle settings for enabling/disabling a feature + */ + ach?: OutboundTransfers.Ach; + + /** + * Toggle settings for enabling/disabling a feature + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: Ach.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace Ach { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + + /** + * Whether the Feature is operational. + */ + status: UsDomesticWire.Status; + + /** + * Additional details; includes at least one entry when the status is not `active`. + */ + status_details: Array; + } + + namespace UsDomesticWire { + type Status = 'active' | 'pending' | 'restricted'; + + interface StatusDetail { + /** + * Represents the reason why the status is `pending` or `restricted`. + */ + code: StatusDetail.Code; + + /** + * Represents what the user should do, if anything, to activate the Feature. + */ + resolution: StatusDetail.Resolution | null; + + /** + * The `platform_restrictions` that are restricting this Feature. + */ + restriction?: StatusDetail.Restriction; + } + + namespace StatusDetail { + type Code = + | 'activating' + | 'capability_not_requested' + | 'financial_account_closed' + | 'rejected_other' + | 'rejected_unsupported_business' + | 'requirements_past_due' + | 'requirements_pending_verification' + | 'restricted_by_platform' + | 'restricted_other'; + + type Resolution = + | 'contact_stripe' + | 'provide_information' + | 'remove_restriction'; + + type Restriction = 'inbound_flows' | 'outbound_flows'; + } + } + } + } + } + } +} diff --git a/types/2020-08-27/Treasury/FinancialAccounts.d.ts b/types/2020-08-27/Treasury/FinancialAccounts.d.ts new file mode 100644 index 0000000000..cf4a68f2e2 --- /dev/null +++ b/types/2020-08-27/Treasury/FinancialAccounts.d.ts @@ -0,0 +1,833 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The FinancialAccount object. + */ + interface FinancialAccount { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.financial_account'; + + /** + * The array of paths to active Features in the Features hash. + */ + active_features: Array; + + /** + * Balance information for the FinancialAccount + */ + balance: FinancialAccount.Balance; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country: string; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. + * Stripe or the platform can control Features via the requested field. + */ + features?: Stripe.Treasury.FinancialAccountFeatures; + + /** + * The set of credentials that resolve to a FinancialAccount. + */ + financial_addresses: Array; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Stripe.Metadata | null; + + /** + * The array of paths to pending Features in the Features hash. + */ + pending_features: Array; + + /** + * The set of functionalities that the platform can restrict on the FinancialAccount. + */ + platform_restrictions: FinancialAccount.PlatformRestrictions | null; + + /** + * The array of paths to restricted Features in the Features hash. + */ + restricted_features: Array; + + /** + * The enum specifying what state the account is in. + */ + status: FinancialAccount.Status; + + status_details: FinancialAccount.StatusDetails; + + /** + * The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + */ + supported_currencies: Array; + } + + namespace FinancialAccount { + type ActiveFeature = + | 'card_issuing' + | 'deposit_insurance' + | 'financial_addresses.aba' + | 'inbound_transfers.ach' + | 'intra_stripe_flows' + | 'outbound_payments.ach' + | 'outbound_payments.us_domestic_wire' + | 'outbound_transfers.ach' + | 'outbound_transfers.us_domestic_wire' + | 'remote_deposit_capture'; + + interface Balance { + /** + * Funds the user can spend right now. + */ + cash: { + [key: string]: number; + }; + + /** + * Funds not spendable yet, but will become available at a later time. + */ + inbound_pending: { + [key: string]: number; + }; + + /** + * Funds in the account, but not spendable because they are being held for pending outbound flows. + */ + outbound_pending: { + [key: string]: number; + }; + } + + interface FinancialAddress { + /** + * ABA Records contain U.S. bank account details per the ABA format. + */ + aba?: FinancialAddress.Aba; + + /** + * The list of networks that the address supports + */ + supported_networks?: Array; + + /** + * The type of financial address + */ + type: 'aba'; + } + + namespace FinancialAddress { + interface Aba { + /** + * The name of the person or business that owns the bank account. + */ + account_holder_name: string; + + /** + * The account number. + */ + account_number: string | null; + + /** + * The last four characters of the account number. + */ + account_number_last4: string; + + /** + * Name of the bank. + */ + bank_name: string; + + /** + * Routing number for the account. + */ + routing_number: string; + } + + type SupportedNetwork = 'ach' | 'us_domestic_wire'; + } + + type PendingFeature = + | 'card_issuing' + | 'deposit_insurance' + | 'financial_addresses.aba' + | 'inbound_transfers.ach' + | 'intra_stripe_flows' + | 'outbound_payments.ach' + | 'outbound_payments.us_domestic_wire' + | 'outbound_transfers.ach' + | 'outbound_transfers.us_domestic_wire' + | 'remote_deposit_capture'; + + interface PlatformRestrictions { + /** + * Restricts all inbound money movement. + */ + inbound_flows: PlatformRestrictions.InboundFlows | null; + + /** + * Restricts all outbound money movement. + */ + outbound_flows: PlatformRestrictions.OutboundFlows | null; + } + + namespace PlatformRestrictions { + type InboundFlows = 'restricted' | 'unrestricted'; + + type OutboundFlows = 'restricted' | 'unrestricted'; + } + + type RestrictedFeature = + | 'card_issuing' + | 'deposit_insurance' + | 'financial_addresses.aba' + | 'inbound_transfers.ach' + | 'intra_stripe_flows' + | 'outbound_payments.ach' + | 'outbound_payments.us_domestic_wire' + | 'outbound_transfers.ach' + | 'outbound_transfers.us_domestic_wire' + | 'remote_deposit_capture'; + + type Status = 'closed' | 'open'; + + interface StatusDetails { + /** + * Details related to the closure of this FinancialAccount + */ + closed: StatusDetails.Closed | null; + } + + namespace StatusDetails { + interface Closed { + /** + * The array that contains reasons for a FinancialAccount closure. + */ + reasons: Array; + } + + namespace Closed { + type Reason = 'account_rejected' | 'closed_by_platform' | 'other'; + } + } + } + + interface FinancialAccountCreateParams { + /** + * The currencies the FinancialAccount can hold a balance in. + */ + supported_currencies: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. + */ + features?: FinancialAccountCreateParams.Features; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The set of functionalities that the platform can restrict on the FinancialAccount. + */ + platform_restrictions?: FinancialAccountCreateParams.PlatformRestrictions; + } + + namespace FinancialAccountCreateParams { + interface Features { + /** + * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + */ + deposit_insurance?: Features.DepositInsurance; + + /** + * Contains Features that add FinancialAddresses to the FinancialAccount. + */ + financial_addresses?: Features.FinancialAddresses; + + /** + * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + */ + inbound_transfers?: Features.InboundTransfers; + + /** + * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + */ + intra_stripe_flows?: Features.IntraStripeFlows; + + /** + * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + */ + outbound_payments?: Features.OutboundPayments; + + /** + * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + */ + outbound_transfers?: Features.OutboundTransfers; + } + + namespace Features { + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface FinancialAddresses { + /** + * Adds an ABA FinancialAddress to the FinancialAccount. + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface InboundTransfers { + /** + * Enables ACH Debits via the InboundTransfers API. + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface OutboundPayments { + /** + * Enables ACH transfers via the OutboundPayments API. + */ + ach?: OutboundPayments.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundPayments API. + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface OutboundTransfers { + /** + * Enables ACH transfers via the OutboundTransfers API. + */ + ach?: OutboundTransfers.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundTransfers API. + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + } + + interface PlatformRestrictions { + /** + * Restricts all inbound money movement. + */ + inbound_flows?: PlatformRestrictions.InboundFlows; + + /** + * Restricts all outbound money movement. + */ + outbound_flows?: PlatformRestrictions.OutboundFlows; + } + + namespace PlatformRestrictions { + type InboundFlows = 'restricted' | 'unrestricted'; + + type OutboundFlows = 'restricted' | 'unrestricted'; + } + } + + interface FinancialAccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancialAccountUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. + */ + features?: FinancialAccountUpdateParams.Features; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The set of functionalities that the platform can restrict on the FinancialAccount. + */ + platform_restrictions?: FinancialAccountUpdateParams.PlatformRestrictions; + } + + namespace FinancialAccountUpdateParams { + interface Features { + /** + * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + */ + deposit_insurance?: Features.DepositInsurance; + + /** + * Contains Features that add FinancialAddresses to the FinancialAccount. + */ + financial_addresses?: Features.FinancialAddresses; + + /** + * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + */ + inbound_transfers?: Features.InboundTransfers; + + /** + * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + */ + intra_stripe_flows?: Features.IntraStripeFlows; + + /** + * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + */ + outbound_payments?: Features.OutboundPayments; + + /** + * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + */ + outbound_transfers?: Features.OutboundTransfers; + } + + namespace Features { + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface FinancialAddresses { + /** + * Adds an ABA FinancialAddress to the FinancialAccount. + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface InboundTransfers { + /** + * Enables ACH Debits via the InboundTransfers API. + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface OutboundPayments { + /** + * Enables ACH transfers via the OutboundPayments API. + */ + ach?: OutboundPayments.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundPayments API. + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface OutboundTransfers { + /** + * Enables ACH transfers via the OutboundTransfers API. + */ + ach?: OutboundTransfers.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundTransfers API. + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + } + + interface PlatformRestrictions { + /** + * Restricts all inbound money movement. + */ + inbound_flows?: PlatformRestrictions.InboundFlows; + + /** + * Restricts all outbound money movement. + */ + outbound_flows?: PlatformRestrictions.OutboundFlows; + } + + namespace PlatformRestrictions { + type InboundFlows = 'restricted' | 'unrestricted'; + + type OutboundFlows = 'restricted' | 'unrestricted'; + } + } + + interface FinancialAccountListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancialAccountRetrieveFeaturesParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancialAccountUpdateFeaturesParams { + /** + * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + */ + deposit_insurance?: FinancialAccountUpdateFeaturesParams.DepositInsurance; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Contains Features that add FinancialAddresses to the FinancialAccount. + */ + financial_addresses?: FinancialAccountUpdateFeaturesParams.FinancialAddresses; + + /** + * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + */ + inbound_transfers?: FinancialAccountUpdateFeaturesParams.InboundTransfers; + + /** + * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + */ + intra_stripe_flows?: FinancialAccountUpdateFeaturesParams.IntraStripeFlows; + + /** + * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + */ + outbound_payments?: FinancialAccountUpdateFeaturesParams.OutboundPayments; + + /** + * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + */ + outbound_transfers?: FinancialAccountUpdateFeaturesParams.OutboundTransfers; + } + + namespace FinancialAccountUpdateFeaturesParams { + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface FinancialAddresses { + /** + * Adds an ABA FinancialAddress to the FinancialAccount. + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface InboundTransfers { + /** + * Enables ACH Debits via the InboundTransfers API. + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface OutboundPayments { + /** + * Enables ACH transfers via the OutboundPayments API. + */ + ach?: OutboundPayments.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundPayments API. + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface OutboundTransfers { + /** + * Enables ACH transfers via the OutboundTransfers API. + */ + ach?: OutboundTransfers.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundTransfers API. + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + } + + class FinancialAccountsResource { + /** + * Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + */ + create( + params: FinancialAccountCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a FinancialAccount. + */ + retrieve( + id: string, + params?: FinancialAccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the details of a FinancialAccount. + */ + update( + id: string, + params?: FinancialAccountUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of FinancialAccounts. + */ + list( + params?: FinancialAccountListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Retrieves Features information associated with the FinancialAccount. + */ + retrieveFeatures( + id: string, + params?: FinancialAccountRetrieveFeaturesParams, + options?: RequestOptions + ): Promise>; + retrieveFeatures( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the Features associated with a FinancialAccount. + */ + updateFeatures( + id: string, + params?: FinancialAccountUpdateFeaturesParams, + options?: RequestOptions + ): Promise>; + updateFeatures( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/Treasury/InboundTransfers.d.ts b/types/2020-08-27/Treasury/InboundTransfers.d.ts new file mode 100644 index 0000000000..d4659a610f --- /dev/null +++ b/types/2020-08-27/Treasury/InboundTransfers.d.ts @@ -0,0 +1,349 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The InboundTransfer object. + */ + interface InboundTransfer { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.inbound_transfer'; + + /** + * Amount (in cents) transferred. + */ + amount: number; + + /** + * Returns `true` if the InboundTransfer is able to be canceled. + */ + cancelable: boolean; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * Details about this InboundTransfer's failure. Only set when status is `failed`. + */ + failure_details: InboundTransfer.FailureDetails | null; + + /** + * The FinancialAccount that received the funds. + */ + financial_account: string; + + /** + * A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + */ + hosted_regulatory_receipt_url: string | null; + + linked_flows: InboundTransfer.LinkedFlows; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Stripe.Metadata; + + /** + * The origin payment method to be debited for an InboundTransfer. + */ + origin_payment_method: string; + + /** + * Details about the PaymentMethod for an InboundTransfer. + */ + origin_payment_method_details: InboundTransfer.OriginPaymentMethodDetails | null; + + /** + * Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. + */ + returned: boolean | null; + + /** + * Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`. + */ + statement_descriptor: string; + + /** + * Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. + */ + status: InboundTransfer.Status; + + status_transitions: InboundTransfer.StatusTransitions; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction | null; + } + + namespace InboundTransfer { + interface FailureDetails { + /** + * Reason for the failure. + */ + code: FailureDetails.Code; + } + + namespace FailureDetails { + type Code = + | 'account_closed' + | 'account_frozen' + | 'bank_account_restricted' + | 'bank_ownership_changed' + | 'debit_not_authorized' + | 'incorrect_account_holder_address' + | 'incorrect_account_holder_name' + | 'incorrect_account_holder_tax_id' + | 'insufficient_funds' + | 'invalid_account_number' + | 'invalid_currency' + | 'no_account' + | 'other'; + } + + interface LinkedFlows { + /** + * If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. + */ + received_debit: string | null; + } + + interface OriginPaymentMethodDetails { + billing_details: OriginPaymentMethodDetails.BillingDetails; + + /** + * The type of the payment method used in the InboundTransfer. + */ + type: 'us_bank_account'; + + us_bank_account?: OriginPaymentMethodDetails.UsBankAccount; + } + + namespace OriginPaymentMethodDetails { + interface BillingDetails { + address: Stripe.Address; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + } + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type: UsBankAccount.AccountHolderType | null; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type: UsBankAccount.AccountType | null; + + /** + * Name of the bank associated with the bank account. + */ + bank_name: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four digits of the bank account number. + */ + last4: string | null; + + /** + * The US bank account network used to debit funds. + */ + network: 'ach'; + + /** + * Routing number of the bank account. + */ + routing_number: string | null; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + } + + type Status = 'canceled' | 'failed' | 'processing' | 'succeeded'; + + interface StatusTransitions { + /** + * Timestamp describing when an InboundTransfer changed status to `canceled`. + */ + canceled_at?: number | null; + + /** + * Timestamp describing when an InboundTransfer changed status to `failed`. + */ + failed_at: number | null; + + /** + * Timestamp describing when an InboundTransfer changed status to `succeeded`. + */ + succeeded_at: number | null; + } + } + + interface InboundTransferCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The FinancialAccount to send funds to. + */ + financial_account: string; + + /** + * The origin payment method to be debited for the InboundTransfer. + */ + origin_payment_method: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The complete description that appears on your customers' statements. Maximum 10 characters. + */ + statement_descriptor?: string; + } + + interface InboundTransferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InboundTransferListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. + */ + status?: InboundTransferListParams.Status; + } + + namespace InboundTransferListParams { + type Status = 'canceled' | 'failed' | 'processing' | 'succeeded'; + } + + interface InboundTransferCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class InboundTransfersResource { + /** + * Creates an InboundTransfer. + */ + create( + params: InboundTransferCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing InboundTransfer. + */ + retrieve( + id: string, + params?: InboundTransferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of InboundTransfers sent from the specified FinancialAccount. + */ + list( + params: InboundTransferListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Cancels an InboundTransfer. + */ + cancel( + id: string, + params?: InboundTransferCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/Treasury/OutboundPayments.d.ts b/types/2020-08-27/Treasury/OutboundPayments.d.ts new file mode 100644 index 0000000000..a7aa6015bf --- /dev/null +++ b/types/2020-08-27/Treasury/OutboundPayments.d.ts @@ -0,0 +1,550 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The OutboundPayment object. + */ + interface OutboundPayment { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.outbound_payment'; + + /** + * Amount (in cents) transferred. + */ + amount: number; + + /** + * Returns `true` if the object can be canceled, and `false` otherwise. + */ + cancelable: boolean; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * ID of the customer to whom an OutboundPayment is sent. + */ + customer: string | null; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. + */ + destination_payment_method: string | null; + + /** + * Details about the PaymentMethod for an OutboundPayment. + */ + destination_payment_method_details: OutboundPayment.DestinationPaymentMethodDetails | null; + + /** + * Details about the end user. + */ + end_user_details: OutboundPayment.EndUserDetails | null; + + /** + * The date when funds are expected to arrive in the destination account. + */ + expected_arrival_date: number; + + /** + * The FinancialAccount that funds were pulled from. + */ + financial_account: string; + + /** + * A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + */ + hosted_regulatory_receipt_url: string | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Stripe.Metadata; + + /** + * Details about a returned OutboundPayment. Only set when the status is `returned`. + */ + returned_details: OutboundPayment.ReturnedDetails | null; + + /** + * The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + */ + statement_descriptor: string; + + /** + * Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. An OutboundPayment is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. + */ + status: OutboundPayment.Status; + + status_transitions: OutboundPayment.StatusTransitions; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction; + } + + namespace OutboundPayment { + interface DestinationPaymentMethodDetails { + billing_details: DestinationPaymentMethodDetails.BillingDetails; + + financial_account?: DestinationPaymentMethodDetails.FinancialAccount; + + /** + * The type of the payment method used in the OutboundPayment. + */ + type: DestinationPaymentMethodDetails.Type; + + us_bank_account?: DestinationPaymentMethodDetails.UsBankAccount; + } + + namespace DestinationPaymentMethodDetails { + interface BillingDetails { + address: Stripe.Address; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + } + + interface FinancialAccount { + /** + * Token of the FinancialAccount. + */ + id: string; + + /** + * The rails used to send funds. + */ + network: 'stripe'; + } + + type Type = 'financial_account' | 'us_bank_account'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type: UsBankAccount.AccountHolderType | null; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type: UsBankAccount.AccountType | null; + + /** + * Name of the bank associated with the bank account. + */ + bank_name: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four digits of the bank account number. + */ + last4: string | null; + + /** + * The US bank account network used to send funds. + */ + network: UsBankAccount.Network; + + /** + * Routing number of the bank account. + */ + routing_number: string | null; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + + type Network = 'ach' | 'us_domestic_wire'; + } + } + + interface EndUserDetails { + /** + * IP address of the user initiating the OutboundPayment. Set if `present` is set to `true`. IP address collection is required for risk and compliance reasons. This will be used to help determine if the OutboundPayment is authorized or should be blocked. + */ + ip_address: string | null; + + /** + * `true`` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. + */ + present: boolean; + } + + interface ReturnedDetails { + /** + * Reason for the return. + */ + code: ReturnedDetails.Code; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction; + } + + namespace ReturnedDetails { + type Code = + | 'account_closed' + | 'account_frozen' + | 'bank_account_restricted' + | 'bank_ownership_changed' + | 'declined' + | 'incorrect_account_holder_name' + | 'invalid_account_number' + | 'invalid_currency' + | 'no_account' + | 'other'; + } + + type Status = + | 'canceled' + | 'failed' + | 'posted' + | 'processing' + | 'returned'; + + interface StatusTransitions { + /** + * Timestamp describing when an OutboundPayment changed status to `canceled`. + */ + canceled_at: number | null; + + /** + * Timestamp describing when an OutboundPayment changed status to `failed`. + */ + failed_at: number | null; + + /** + * Timestamp describing when an OutboundPayment changed status to `posted`. + */ + posted_at: number | null; + + /** + * Timestamp describing when an OutboundPayment changed status to `returned`. + */ + returned_at: number | null; + } + } + + interface OutboundPaymentCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The FinancialAccount to pull funds from. + */ + financial_account: string; + + /** + * ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. + */ + destination_payment_method?: string; + + /** + * Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with `destination_payment_method`. + */ + destination_payment_method_data?: OutboundPaymentCreateParams.DestinationPaymentMethodData; + + /** + * Payment method-specific configuration for this OutboundPayment. + */ + destination_payment_method_options?: OutboundPaymentCreateParams.DestinationPaymentMethodOptions; + + /** + * End user details. + */ + end_user_details?: OutboundPaymentCreateParams.EndUserDetails; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. The default value is `payment`. + */ + statement_descriptor?: string; + } + + namespace OutboundPaymentCreateParams { + interface DestinationPaymentMethodData { + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: DestinationPaymentMethodData.BillingDetails; + + /** + * Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + */ + financial_account?: string; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: DestinationPaymentMethodData.Type; + + /** + * Required hash if type is set to `us_bank_account`. + */ + us_bank_account?: DestinationPaymentMethodData.UsBankAccount; + } + + namespace DestinationPaymentMethodData { + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + namespace BillingDetails { + interface Address extends Omit { + line1?: string; + } + } + + type Type = 'financial_account' | 'us_bank_account'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + } + + interface DestinationPaymentMethodOptions { + /** + * Optional fields for `us_bank_account`. + */ + us_bank_account?: Stripe.Emptyable< + DestinationPaymentMethodOptions.UsBankAccount + >; + } + + namespace DestinationPaymentMethodOptions { + interface UsBankAccount { + /** + * The US bank account network that must be used for this OutboundPayment. If not set, we will default to the PaymentMethod's preferred network. + */ + network?: UsBankAccount.Network; + } + + namespace UsBankAccount { + type Network = 'ach' | 'us_domestic_wire'; + } + } + + interface EndUserDetails { + /** + * IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. + */ + ip_address?: string; + + /** + * `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. + */ + present: boolean; + } + } + + interface OutboundPaymentRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OutboundPaymentListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Only return OutboundPayments sent to this customer. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. + */ + status?: OutboundPaymentListParams.Status; + } + + namespace OutboundPaymentListParams { + type Status = + | 'canceled' + | 'failed' + | 'posted' + | 'processing' + | 'returned'; + } + + interface OutboundPaymentCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class OutboundPaymentsResource { + /** + * Creates an OutboundPayment. + */ + create( + params: OutboundPaymentCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. + */ + retrieve( + id: string, + params?: OutboundPaymentRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of OutboundPayments sent from the specified FinancialAccount. + */ + list( + params: OutboundPaymentListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Cancel an OutboundPayment. + */ + cancel( + id: string, + params?: OutboundPaymentCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/Treasury/OutboundTransfers.d.ts b/types/2020-08-27/Treasury/OutboundTransfers.d.ts new file mode 100644 index 0000000000..626ff0a547 --- /dev/null +++ b/types/2020-08-27/Treasury/OutboundTransfers.d.ts @@ -0,0 +1,385 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The OutboundTransfer object. + */ + interface OutboundTransfer { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.outbound_transfer'; + + /** + * Amount (in cents) transferred. + */ + amount: number; + + /** + * Returns `true` if the object can be canceled, and `false` otherwise. + */ + cancelable: boolean; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The PaymentMethod used as the payment instrument for an OutboundTransfer. + */ + destination_payment_method: string; + + destination_payment_method_details: OutboundTransfer.DestinationPaymentMethodDetails; + + /** + * The date when funds are expected to arrive in the destination account. + */ + expected_arrival_date: number; + + /** + * The FinancialAccount that funds were pulled from. + */ + financial_account: string; + + /** + * A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + */ + hosted_regulatory_receipt_url: string | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Stripe.Metadata; + + /** + * Details about a returned OutboundTransfer. Only set when the status is `returned`. + */ + returned_details: OutboundTransfer.ReturnedDetails | null; + + /** + * Information about the OutboundTransfer to be sent to the recipient account. + */ + statement_descriptor: string; + + /** + * Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. + */ + status: OutboundTransfer.Status; + + status_transitions: OutboundTransfer.StatusTransitions; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction; + } + + namespace OutboundTransfer { + interface DestinationPaymentMethodDetails { + billing_details: DestinationPaymentMethodDetails.BillingDetails; + + /** + * The type of the payment method used in the OutboundTransfer. + */ + type: 'us_bank_account'; + + us_bank_account?: DestinationPaymentMethodDetails.UsBankAccount; + } + + namespace DestinationPaymentMethodDetails { + interface BillingDetails { + address: Stripe.Address; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + } + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type: UsBankAccount.AccountHolderType | null; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type: UsBankAccount.AccountType | null; + + /** + * Name of the bank associated with the bank account. + */ + bank_name: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four digits of the bank account number. + */ + last4: string | null; + + /** + * The US bank account network used to send funds. + */ + network: UsBankAccount.Network; + + /** + * Routing number of the bank account. + */ + routing_number: string | null; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + + type Network = 'ach' | 'us_domestic_wire'; + } + } + + interface ReturnedDetails { + /** + * Reason for the return. + */ + code: ReturnedDetails.Code; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction; + } + + namespace ReturnedDetails { + type Code = + | 'account_closed' + | 'account_frozen' + | 'bank_account_restricted' + | 'bank_ownership_changed' + | 'declined' + | 'incorrect_account_holder_name' + | 'invalid_account_number' + | 'invalid_currency' + | 'no_account' + | 'other'; + } + + type Status = + | 'canceled' + | 'failed' + | 'posted' + | 'processing' + | 'returned'; + + interface StatusTransitions { + /** + * Timestamp describing when an OutboundTransfer changed status to `canceled` + */ + canceled_at: number | null; + + /** + * Timestamp describing when an OutboundTransfer changed status to `failed` + */ + failed_at: number | null; + + /** + * Timestamp describing when an OutboundTransfer changed status to `posted` + */ + posted_at: number | null; + + /** + * Timestamp describing when an OutboundTransfer changed status to `returned` + */ + returned_at: number | null; + } + } + + interface OutboundTransferCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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). + */ + currency: string; + + /** + * The PaymentMethod to use as the payment instrument for the OutboundTransfer. + */ + destination_payment_method: string; + + /** + * The FinancialAccount to pull funds from. + */ + financial_account: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Hash describing payment method configuration details. + */ + destination_payment_method_options?: OutboundTransferCreateParams.DestinationPaymentMethodOptions; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. + */ + statement_descriptor?: string; + } + + namespace OutboundTransferCreateParams { + interface DestinationPaymentMethodOptions { + /** + * Optional fields for `us_bank_account`. + */ + us_bank_account?: Stripe.Emptyable< + DestinationPaymentMethodOptions.UsBankAccount + >; + } + + namespace DestinationPaymentMethodOptions { + interface UsBankAccount { + /** + * Designate the OutboundTransfer as using a US bank account network configuration. + */ + network?: UsBankAccount.Network; + } + + namespace UsBankAccount { + type Network = 'ach' | 'us_domestic_wire'; + } + } + } + + interface OutboundTransferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OutboundTransferListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. + */ + status?: OutboundTransferListParams.Status; + } + + namespace OutboundTransferListParams { + type Status = + | 'canceled' + | 'failed' + | 'posted' + | 'processing' + | 'returned'; + } + + interface OutboundTransferCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class OutboundTransfersResource { + /** + * Creates an OutboundTransfer. + */ + create( + params: OutboundTransferCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. + */ + retrieve( + id: string, + params?: OutboundTransferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of OutboundTransfers sent from the specified FinancialAccount. + */ + list( + params: OutboundTransferListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * An OutboundTransfer can be canceled if the funds have not yet been paid out. + */ + cancel( + id: string, + params?: OutboundTransferCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/Treasury/ReceivedCredits.d.ts b/types/2020-08-27/Treasury/ReceivedCredits.d.ts new file mode 100644 index 0000000000..dac1b3ebe7 --- /dev/null +++ b/types/2020-08-27/Treasury/ReceivedCredits.d.ts @@ -0,0 +1,303 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The ReceivedCredit object. + */ + interface ReceivedCredit { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.received_credit'; + + /** + * Amount (in cents) transferred. + */ + amount: number; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string; + + /** + * Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. + */ + failure_code: ReceivedCredit.FailureCode | null; + + /** + * The FinancialAccount that received the funds. + */ + financial_account: string | null; + + initiating_payment_method_details: ReceivedCredit.InitiatingPaymentMethodDetails; + + linked_flows: ReceivedCredit.LinkedFlows; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The rails used to send the funds. + */ + network: ReceivedCredit.Network; + + /** + * Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. + */ + status: ReceivedCredit.Status; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction | null; + } + + namespace ReceivedCredit { + type FailureCode = 'account_closed' | 'account_frozen' | 'other'; + + interface InitiatingPaymentMethodDetails { + /** + * Set when `type` is `balance`. + */ + balance?: 'payments'; + + billing_details: InitiatingPaymentMethodDetails.BillingDetails; + + financial_account?: InitiatingPaymentMethodDetails.FinancialAccount; + + /** + * Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + */ + issuing_card?: string; + + /** + * Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. + */ + type: InitiatingPaymentMethodDetails.Type; + + us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount; + } + + namespace InitiatingPaymentMethodDetails { + interface BillingDetails { + address: Stripe.Address; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + } + + interface FinancialAccount { + /** + * The FinancialAccount ID. + */ + id: string; + + /** + * The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + */ + network: 'stripe'; + } + + type Type = + | 'balance' + | 'financial_account' + | 'issuing_card' + | 'stripe' + | 'us_bank_account'; + + interface UsBankAccount { + /** + * Bank name. + */ + bank_name: string | null; + + /** + * The last four digits of the bank account number. + */ + last4: string | null; + + /** + * The routing number for the bank account. + */ + routing_number: string | null; + } + } + + interface LinkedFlows { + /** + * The CreditReversal created as a result of this ReceivedCredit being reversed. + */ + credit_reversal: string | null; + + /** + * Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + */ + issuing_authorization: string | null; + + /** + * Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. + */ + issuing_transaction: string | null; + + /** + * ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the merchant. Examples of source flows include OutboundPayments, payouts, or CreditReversals. + */ + source_flow: string | null; + + /** + * The expandable object of the source flow. + */ + source_flow_details: LinkedFlows.SourceFlowDetails | null; + + /** + * The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). + */ + source_flow_type: string | null; + } + + namespace LinkedFlows { + interface SourceFlowDetails { + /** + * You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + */ + credit_reversal?: Stripe.Treasury.CreditReversal; + + /** + * Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + * + * Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + */ + outbound_payment?: Stripe.Treasury.OutboundPayment; + + /** + * A `Payout` object is created when you receive funds from Stripe, or when you + * initiate a payout to either a bank account or debit card of a [connected + * Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, + * as well as list all payouts. Payouts are made on [varying + * schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and + * industry. + * + * Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). + */ + payout?: Stripe.Payout; + + /** + * The type of the source flow that originated the ReceivedCredit. + */ + type: SourceFlowDetails.Type; + } + + namespace SourceFlowDetails { + type Type = + | 'credit_reversal' + | 'other' + | 'outbound_payment' + | 'payout'; + } + } + + type Network = 'ach' | 'card' | 'stripe' | 'us_domestic_wire'; + + type Status = 'failed' | 'succeeded'; + } + + interface ReceivedCreditRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReceivedCreditListParams extends PaginationParams { + /** + * The FinancialAccount that received the funds. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return ReceivedCredits described by the flow. + */ + linked_flows?: ReceivedCreditListParams.LinkedFlows; + + /** + * Only return ReceivedCredits that have the given status: `succeeded` or `failed`. + */ + status?: ReceivedCreditListParams.Status; + } + + namespace ReceivedCreditListParams { + interface LinkedFlows { + /** + * The source flow type. + */ + source_flow_type: LinkedFlows.SourceFlowType; + } + + namespace LinkedFlows { + type SourceFlowType = + | 'credit_reversal' + | 'other' + | 'outbound_payment' + | 'payout'; + } + + type Status = 'failed' | 'succeeded'; + } + + class ReceivedCreditsResource { + /** + * Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. + */ + retrieve( + id: string, + params?: ReceivedCreditRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of ReceivedCredits. + */ + list( + params: ReceivedCreditListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2020-08-27/Treasury/ReceivedDebits.d.ts b/types/2020-08-27/Treasury/ReceivedDebits.d.ts new file mode 100644 index 0000000000..38a8d44493 --- /dev/null +++ b/types/2020-08-27/Treasury/ReceivedDebits.d.ts @@ -0,0 +1,231 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The ReceivedDebit object. + */ + interface ReceivedDebit { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.received_debit'; + + /** + * Amount (in cents) transferred. + */ + amount: number; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string; + + /** + * Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. + */ + failure_code: ReceivedDebit.FailureCode | null; + + /** + * The FinancialAccount that funds were pulled from. + */ + financial_account: string | null; + + initiating_payment_method_details?: ReceivedDebit.InitiatingPaymentMethodDetails; + + linked_flows: ReceivedDebit.LinkedFlows; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The network used for the ReceivedDebit. + */ + network: ReceivedDebit.Network; + + /** + * Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. + */ + status: ReceivedDebit.Status; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction | null; + } + + namespace ReceivedDebit { + type FailureCode = + | 'account_closed' + | 'account_frozen' + | 'insufficient_funds' + | 'other'; + + interface InitiatingPaymentMethodDetails { + /** + * Set when `type` is `balance`. + */ + balance?: 'payments'; + + billing_details: InitiatingPaymentMethodDetails.BillingDetails; + + financial_account?: InitiatingPaymentMethodDetails.FinancialAccount; + + /** + * Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + */ + issuing_card?: string; + + /** + * Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. + */ + type: InitiatingPaymentMethodDetails.Type; + + us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount; + } + + namespace InitiatingPaymentMethodDetails { + interface BillingDetails { + address: Stripe.Address; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + } + + interface FinancialAccount { + /** + * The FinancialAccount ID. + */ + id: string; + + /** + * The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + */ + network: 'stripe'; + } + + type Type = + | 'balance' + | 'financial_account' + | 'issuing_card' + | 'stripe' + | 'us_bank_account'; + + interface UsBankAccount { + /** + * Bank name. + */ + bank_name: string | null; + + /** + * The last four digits of the bank account number. + */ + last4: string | null; + + /** + * The routing number for the bank account. + */ + routing_number: string | null; + } + } + + interface LinkedFlows { + /** + * Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. + */ + inbound_transfer: string | null; + + /** + * Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + */ + issuing_authorization: string | null; + + /** + * Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. + */ + issuing_transaction: string | null; + } + + type Network = 'ach' | 'card' | 'stripe'; + + type Status = 'failed' | 'succeeded'; + } + + interface ReceivedDebitRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReceivedDebitListParams extends PaginationParams { + /** + * The FinancialAccount that funds were pulled from. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return ReceivedDebits that have the given status: `succeeded` or `failed`. + */ + status?: ReceivedDebitListParams.Status; + } + + namespace ReceivedDebitListParams { + type Status = 'failed' | 'succeeded'; + } + + class ReceivedDebitsResource { + /** + * Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list + */ + retrieve( + id: string, + params?: ReceivedDebitRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of ReceivedDebits. + */ + list( + params: ReceivedDebitListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2020-08-27/Treasury/TransactionEntries.d.ts b/types/2020-08-27/Treasury/TransactionEntries.d.ts new file mode 100644 index 0000000000..9aabdfe784 --- /dev/null +++ b/types/2020-08-27/Treasury/TransactionEntries.d.ts @@ -0,0 +1,257 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The TransactionEntry object. + */ + interface TransactionEntry { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.transaction_entry'; + + /** + * Change to a FinancialAccount's balance + */ + balance_impact: TransactionEntry.BalanceImpact; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * When the TransactionEntry will impact the FinancialAccount's balance. + */ + effective_at: number; + + /** + * The FinancialAccount associated with this object. + */ + financial_account: string; + + /** + * Token of the flow associated with the TransactionEntry. + */ + flow: string | null; + + /** + * Details of the flow associated with the TransactionEntry. + */ + flow_details: TransactionEntry.FlowDetails | null; + + /** + * Type of the flow associated with the TransactionEntry. + */ + flow_type: TransactionEntry.FlowType; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The Transaction associated with this object. + */ + transaction: string | Stripe.Treasury.Transaction; + + /** + * The specific money movement that generated the TransactionEntry. + */ + type: TransactionEntry.Type; + } + + namespace TransactionEntry { + interface BalanceImpact { + /** + * The change made to funds the user can spend right now. + */ + cash: number; + + /** + * The change made to funds that are not spendable yet, but will become available at a later time. + */ + inbound_pending: number; + + /** + * The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + */ + outbound_pending: number; + } + + interface FlowDetails { + /** + * You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + */ + credit_reversal?: Stripe.Treasury.CreditReversal; + + /** + * You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + */ + debit_reversal?: Stripe.Treasury.DebitReversal; + + /** + * Use InboundTransfers to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + */ + inbound_transfer?: Stripe.Treasury.InboundTransfer; + + /** + * When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + * object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + * purchase to be completed successfully. + * + * Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations). + */ + issuing_authorization?: Stripe.Issuing.Authorization; + + /** + * Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + * + * Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + */ + outbound_payment?: Stripe.Treasury.OutboundPayment; + + /** + * Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + * + * Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + */ + outbound_transfer?: Stripe.Treasury.OutboundTransfer; + + /** + * ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + */ + received_credit?: Stripe.Treasury.ReceivedCredit; + + /** + * ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + */ + received_debit?: Stripe.Treasury.ReceivedDebit; + + /** + * Type of the flow that created the Transaction. Set to the same value as `flow_type`. + */ + type: FlowDetails.Type; + } + + namespace FlowDetails { + type Type = + | 'credit_reversal' + | 'debit_reversal' + | 'inbound_transfer' + | 'issuing_authorization' + | 'other' + | 'outbound_payment' + | 'outbound_transfer' + | 'received_credit' + | 'received_debit'; + } + + type FlowType = + | 'credit_reversal' + | 'debit_reversal' + | 'inbound_transfer' + | 'issuing_authorization' + | 'other' + | 'outbound_payment' + | 'outbound_transfer' + | 'received_credit' + | 'received_debit'; + + type Type = + | 'credit_reversal' + | 'credit_reversal_posting' + | 'debit_reversal' + | 'inbound_transfer' + | 'inbound_transfer_return' + | 'issuing_authorization_hold' + | 'issuing_authorization_release' + | 'other' + | 'outbound_payment' + | 'outbound_payment_cancellation' + | 'outbound_payment_failure' + | 'outbound_payment_posting' + | 'outbound_payment_return' + | 'outbound_transfer' + | 'outbound_transfer_cancellation' + | 'outbound_transfer_failure' + | 'outbound_transfer_posting' + | 'outbound_transfer_return' + | 'received_credit' + | 'received_debit'; + } + + interface TransactionEntryRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionEntryListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + created?: Stripe.RangeQueryParam | number; + + effective_at?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. + */ + order_by?: TransactionEntryListParams.OrderBy; + + /** + * Only return TransactionEntries associated with this Transaction. + */ + transaction?: string; + } + + namespace TransactionEntryListParams { + type OrderBy = 'created' | 'effective_at'; + } + + class TransactionEntriesResource { + /** + * Retrieves a TransactionEntry object. + */ + retrieve( + id: string, + params?: TransactionEntryRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a list of TransactionEntry objects. + */ + list( + params: TransactionEntryListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2020-08-27/Treasury/Transactions.d.ts b/types/2020-08-27/Treasury/Transactions.d.ts new file mode 100644 index 0000000000..4c5ef1b63b --- /dev/null +++ b/types/2020-08-27/Treasury/Transactions.d.ts @@ -0,0 +1,268 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + /** + * The Transaction object. + */ + interface Transaction { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'treasury.transaction'; + + /** + * Amount (in cents) transferred. + */ + amount: number; + + /** + * Change to a FinancialAccount's balance + */ + balance_impact: Transaction.BalanceImpact; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + 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). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string; + + /** + * A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. + */ + entries: ApiList | null; + + /** + * The FinancialAccount associated with this object. + */ + financial_account: string; + + /** + * ID of the flow that created the Transaction. + */ + flow: string | null; + + /** + * Details of the flow that created the Transaction. + */ + flow_details: Transaction.FlowDetails | null; + + /** + * Type of the flow that created the Transaction. + */ + flow_type: Transaction.FlowType; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Status of the Transaction. + */ + status: Transaction.Status; + + status_transitions: Transaction.StatusTransitions; + } + + namespace Transaction { + interface BalanceImpact { + /** + * The change made to funds the user can spend right now. + */ + cash: number; + + /** + * The change made to funds that are not spendable yet, but will become available at a later time. + */ + inbound_pending: number; + + /** + * The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + */ + outbound_pending: number; + } + + interface FlowDetails { + /** + * You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + */ + credit_reversal?: Stripe.Treasury.CreditReversal; + + /** + * You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + */ + debit_reversal?: Stripe.Treasury.DebitReversal; + + /** + * Use InboundTransfers to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + */ + inbound_transfer?: Stripe.Treasury.InboundTransfer; + + /** + * When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + * object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + * purchase to be completed successfully. + * + * Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations). + */ + issuing_authorization?: Stripe.Issuing.Authorization; + + /** + * Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + * + * Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + */ + outbound_payment?: Stripe.Treasury.OutboundPayment; + + /** + * Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + * + * Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + */ + outbound_transfer?: Stripe.Treasury.OutboundTransfer; + + /** + * ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + */ + received_credit?: Stripe.Treasury.ReceivedCredit; + + /** + * ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + */ + received_debit?: Stripe.Treasury.ReceivedDebit; + + /** + * Type of the flow that created the Transaction. Set to the same value as `flow_type`. + */ + type: FlowDetails.Type; + } + + namespace FlowDetails { + type Type = + | 'credit_reversal' + | 'debit_reversal' + | 'inbound_transfer' + | 'issuing_authorization' + | 'other' + | 'outbound_payment' + | 'outbound_transfer' + | 'received_credit' + | 'received_debit'; + } + + type FlowType = + | 'credit_reversal' + | 'debit_reversal' + | 'inbound_transfer' + | 'issuing_authorization' + | 'other' + | 'outbound_payment' + | 'outbound_transfer' + | 'received_credit' + | 'received_debit'; + + type Status = 'open' | 'posted' | 'void'; + + interface StatusTransitions { + /** + * Timestamp describing when the Transaction changed status to `posted`. + */ + posted_at: number | null; + + /** + * Timestamp describing when the Transaction changed status to `void`. + */ + void_at: number | null; + } + } + + interface TransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. + */ + order_by?: TransactionListParams.OrderBy; + + /** + * Only return Transactions that have the given status: `open`, `posted`, or `void`. + */ + status?: TransactionListParams.Status; + + /** + * A filter for the `status_transitions.posted_at` timestamp. When using this filter, `status=posted` and `order_by=posted_at` must also be specified. + */ + status_transitions?: TransactionListParams.StatusTransitions; + } + + namespace TransactionListParams { + type OrderBy = 'created' | 'posted_at'; + + type Status = 'open' | 'posted' | 'void'; + + interface StatusTransitions { + /** + * Returns Transactions with `posted_at` within the specified range. + */ + posted_at?: Stripe.RangeQueryParam | number; + } + } + + class TransactionsResource { + /** + * Retrieves the details of an existing Transaction. + */ + retrieve( + id: string, + params?: TransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a list of Transaction objects. + */ + list( + params: TransactionListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2020-08-27/WebhookEndpoints.d.ts index 864a4583dd..a42bef2c92 100644 --- a/types/2020-08-27/WebhookEndpoints.d.ts +++ b/types/2020-08-27/WebhookEndpoints.d.ts @@ -412,7 +412,36 @@ declare module 'stripe' { | 'transfer.failed' | 'transfer.paid' | 'transfer.reversed' - | 'transfer.updated'; + | 'transfer.updated' + | 'treasury.credit_reversal.created' + | 'treasury.credit_reversal.posted' + | 'treasury.debit_reversal.completed' + | 'treasury.debit_reversal.created' + | 'treasury.debit_reversal.initial_credit_granted' + | 'treasury.financial_account.closed' + | 'treasury.financial_account.created' + | 'treasury.financial_account.features_status_updated' + | 'treasury.inbound_transfer.canceled' + | 'treasury.inbound_transfer.created' + | 'treasury.inbound_transfer.failed' + | 'treasury.inbound_transfer.succeeded' + | 'treasury.outbound_payment.canceled' + | 'treasury.outbound_payment.created' + | 'treasury.outbound_payment.expected_arrival_date_updated' + | 'treasury.outbound_payment.failed' + | 'treasury.outbound_payment.posted' + | 'treasury.outbound_payment.returned' + | 'treasury.outbound_transfer.canceled' + | 'treasury.outbound_transfer.created' + | 'treasury.outbound_transfer.expected_arrival_date_updated' + | 'treasury.outbound_transfer.failed' + | 'treasury.outbound_transfer.posted' + | 'treasury.outbound_transfer.returned' + | 'treasury.received_credit.created' + | 'treasury.received_credit.failed' + | 'treasury.received_credit.reversed' + | 'treasury.received_credit.succeeded' + | 'treasury.received_debit.created'; } interface WebhookEndpointRetrieveParams { @@ -642,7 +671,36 @@ declare module 'stripe' { | 'transfer.failed' | 'transfer.paid' | 'transfer.reversed' - | 'transfer.updated'; + | 'transfer.updated' + | 'treasury.credit_reversal.created' + | 'treasury.credit_reversal.posted' + | 'treasury.debit_reversal.completed' + | 'treasury.debit_reversal.created' + | 'treasury.debit_reversal.initial_credit_granted' + | 'treasury.financial_account.closed' + | 'treasury.financial_account.created' + | 'treasury.financial_account.features_status_updated' + | 'treasury.inbound_transfer.canceled' + | 'treasury.inbound_transfer.created' + | 'treasury.inbound_transfer.failed' + | 'treasury.inbound_transfer.succeeded' + | 'treasury.outbound_payment.canceled' + | 'treasury.outbound_payment.created' + | 'treasury.outbound_payment.expected_arrival_date_updated' + | 'treasury.outbound_payment.failed' + | 'treasury.outbound_payment.posted' + | 'treasury.outbound_payment.returned' + | 'treasury.outbound_transfer.canceled' + | 'treasury.outbound_transfer.created' + | 'treasury.outbound_transfer.expected_arrival_date_updated' + | 'treasury.outbound_transfer.failed' + | 'treasury.outbound_transfer.posted' + | 'treasury.outbound_transfer.returned' + | 'treasury.received_credit.created' + | 'treasury.received_credit.failed' + | 'treasury.received_credit.reversed' + | 'treasury.received_credit.succeeded' + | 'treasury.received_debit.created'; } interface WebhookEndpointListParams extends PaginationParams { diff --git a/types/2020-08-27/index.d.ts b/types/2020-08-27/index.d.ts index 5afc19d52b..6604db30ec 100644 --- a/types/2020-08-27/index.d.ts +++ b/types/2020-08-27/index.d.ts @@ -105,10 +105,26 @@ /// /// /// +/// +/// +/// +/// +/// /// /// /// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -228,6 +244,25 @@ declare module 'stripe' { terminal: { readers: Stripe.TestHelpers.Terminal.ReadersResource; }; + treasury: { + inboundTransfers: Stripe.TestHelpers.Treasury.InboundTransfersResource; + outboundPayments: Stripe.TestHelpers.Treasury.OutboundPaymentsResource; + outboundTransfers: Stripe.TestHelpers.Treasury.OutboundTransfersResource; + receivedCredits: Stripe.TestHelpers.Treasury.ReceivedCreditsResource; + receivedDebits: Stripe.TestHelpers.Treasury.ReceivedDebitsResource; + }; + }; + treasury: { + creditReversals: Stripe.Treasury.CreditReversalsResource; + debitReversals: Stripe.Treasury.DebitReversalsResource; + financialAccounts: Stripe.Treasury.FinancialAccountsResource; + inboundTransfers: Stripe.Treasury.InboundTransfersResource; + outboundPayments: Stripe.Treasury.OutboundPaymentsResource; + outboundTransfers: Stripe.Treasury.OutboundTransfersResource; + receivedCredits: Stripe.Treasury.ReceivedCreditsResource; + receivedDebits: Stripe.Treasury.ReceivedDebitsResource; + transactions: Stripe.Treasury.TransactionsResource; + transactionEntries: Stripe.Treasury.TransactionEntriesResource; }; /** * API Errors From 76576f938f28e5b3fd8b4721fdd9192102cd7aff Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 19 May 2022 17:04:21 -0700 Subject: [PATCH 12/25] Bump version to 9.2.0 --- CHANGELOG.md | 16 ++++++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b875b4f6a5..03390a39ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # CHANGELOG +## 9.2.0 - 2022-05-19 +* [#1422](https://github.com/stripe/stripe-node/pull/1422) API Updates + * Add support for new `Treasury` APIs: `CreditReversal`, `DebitReversal`, `FinancialAccountFeatures`, `FinancialAccount`, `FlowDetails`, `InboundTransfer`, `OutboundPayment`, `OutboundTransfer`, `ReceivedCredit`, `ReceivedDebit`, `TransactionEntry`, and `Transaction` + * Add support for `treasury` on `Issuing.Authorization`, `Issuing.Dispute`, `Issuing.Transaction`, and `IssuingDisputeCreateParams` + * Add support for `retrieve_payment_method` method on resource `Customer` + * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account` + * Change `BillingPortalConfigurationCreateParams.features.customer_update.allowed_updates` to be optional + * Change type of `BillingPortal.Session.return_url` from `string` to `nullable(string)` + * Add support for `afterpay_clearpay`, `au_becs_debit`, `bacs_debit`, `eps`, `fpx`, `giropay`, `grabpay`, `klarna`, `paynow`, and `sepa_debit` on `Checkout.Session.payment_method_options` + * Add support for `financial_account` on `Issuing.Card` and `IssuingCardCreateParams` + * Add support for `client_secret` on `Order` + * Add support for `networks` on `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `PaymentMethod.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, and `SetupIntentUpdateParams.payment_method_options.us_bank_account` + * Add support for `attach_to_self` and `flow_directions` on `SetupIntent` + * Add support for `save_default_payment_method` on `Subscription.payment_settings`, `SubscriptionCreateParams.payment_settings`, and `SubscriptionUpdateParams.payment_settings` + * Add support for `czk` on `Terminal.Configuration.tipping`, `TerminalConfigurationCreateParams.tipping`, and `TerminalConfigurationUpdateParams.tipping` + ## 9.1.0 - 2022-05-11 * [#1420](https://github.com/stripe/stripe-node/pull/1420) API Updates * Add support for `description` on `CheckoutSessionCreateParams.subscription_data`, `SubscriptionCreateParams`, `SubscriptionUpdateParams`, and `Subscription` diff --git a/VERSION b/VERSION index 47da986f86..deeb3d66ef 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.1.0 +9.2.0 diff --git a/package.json b/package.json index c35f5ad16a..993ecc3fbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.1.0", + "version": "9.2.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 53e9d654e9fef734e6f0fd7c01b03c90af659965 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Mon, 23 May 2022 12:49:32 -0700 Subject: [PATCH 13/25] Codegen for openapi v146 (#1430) --- OPENAPI_VERSION | 1 + lib/resources.js | 3 + lib/resources/Apps/Secrets.js | 31 ++ .../resources/generated_examples_test.spec.js | 27 ++ types/2020-08-27/Apps/Secrets.d.ts | 241 +++++++++++++++ types/2020-08-27/Charges.d.ts | 8 + types/2020-08-27/Customers.d.ts | 2 + types/2020-08-27/Invoices.d.ts | 3 + types/2020-08-27/Mandates.d.ts | 4 + types/2020-08-27/Orders.d.ts | 72 +++++ types/2020-08-27/PaymentIntents.d.ts | 282 ++++++++++++++++++ types/2020-08-27/PaymentMethods.d.ts | 52 ++++ types/2020-08-27/SetupAttempts.d.ts | 4 + types/2020-08-27/SetupIntents.d.ts | 93 ++++++ types/2020-08-27/Subscriptions.d.ts | 3 + types/2020-08-27/index.d.ts | 4 + 16 files changed, 830 insertions(+) create mode 100644 OPENAPI_VERSION create mode 100644 lib/resources/Apps/Secrets.js create mode 100644 types/2020-08-27/Apps/Secrets.d.ts diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION new file mode 100644 index 0000000000..19a48dddde --- /dev/null +++ b/OPENAPI_VERSION @@ -0,0 +1 @@ +v146 \ No newline at end of file diff --git a/lib/resources.js b/lib/resources.js index ed98980bd5..16dae7b232 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -55,6 +55,9 @@ module.exports = { Topups: require('./resources/Topups'), Transfers: require('./resources/Transfers'), WebhookEndpoints: require('./resources/WebhookEndpoints'), + Apps: resourceNamespace('apps', { + Secrets: require('./resources/Apps/Secrets'), + }), BillingPortal: resourceNamespace('billingPortal', { Configurations: require('./resources/BillingPortal/Configurations'), Sessions: require('./resources/BillingPortal/Sessions'), diff --git a/lib/resources/Apps/Secrets.js b/lib/resources/Apps/Secrets.js new file mode 100644 index 0000000000..238037508f --- /dev/null +++ b/lib/resources/Apps/Secrets.js @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'apps/secrets', + + create: stripeMethod({ + method: 'POST', + path: '', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + + deleteWhere: stripeMethod({ + method: 'POST', + path: '/delete', + }), + + find: stripeMethod({ + method: 'GET', + path: '/find', + }), +}); diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 3e05a0d5b5..3e6f355919 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -850,6 +850,33 @@ describe('Treasury.ReceivedDebit', function() { }); }); +describe('Apps.Secret', function() { + it('create method', async function() { + const secret = await stripe.apps.secrets.create({ + name: 'sec_123', + payload: 'very secret string', + scope: {type: 'account'}, + }); + expect(secret).not.to.be.null; + }); + + it('find method', async function() { + const secret = await stripe.apps.secrets.find({ + name: 'sec_123', + scope: {type: 'account'}, + }); + expect(secret).not.to.be.null; + }); + + it('deleteWhere method', async function() { + const secret = await stripe.apps.secrets.deleteWhere({ + name: 'sec_123', + scope: {type: 'account'}, + }); + expect(secret).not.to.be.null; + }); +}); + describe('Charge', function() { it('create method', async function() { const charge = await stripe.charges.create({ diff --git a/types/2020-08-27/Apps/Secrets.d.ts b/types/2020-08-27/Apps/Secrets.d.ts new file mode 100644 index 0000000000..d274df3c9e --- /dev/null +++ b/types/2020-08-27/Apps/Secrets.d.ts @@ -0,0 +1,241 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Apps { + /** + * The Secret object. + */ + interface Secret { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'apps.secret'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * If true, indicates that this secret has been deleted + */ + deleted?: boolean; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * The plaintext secret value to be stored. + */ + payload: string | null; + + scope: Secret.Scope; + } + + namespace Secret { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID, if type is set to "user" + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretCreateParams { + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * The plaintext secret value to be stored. + */ + payload: string; + + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretCreateParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretCreateParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretListParams extends PaginationParams { + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretListParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretListParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretDeleteWhereParams { + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretDeleteWhereParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretDeleteWhereParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretFindParams { + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretFindParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretFindParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + class SecretsResource { + /** + * Create or replace a secret in the secret store. + */ + create( + params: SecretCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * List all secrets stored on the given scope. + */ + list( + params: SecretListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes a secret from the secret store by name and scope. + */ + deleteWhere( + params: SecretDeleteWhereParams, + options?: RequestOptions + ): Promise>; + + /** + * Finds a secret in the secret store by name and scope. + */ + find( + params: SecretFindParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2020-08-27/Charges.d.ts b/types/2020-08-27/Charges.d.ts index bca649c06c..5223d7e409 100644 --- a/types/2020-08-27/Charges.d.ts +++ b/types/2020-08-27/Charges.d.ts @@ -388,6 +388,8 @@ declare module 'stripe' { acss_debit?: PaymentMethodDetails.AcssDebit; + affirm?: PaymentMethodDetails.Affirm; + afterpay_clearpay?: PaymentMethodDetails.AfterpayClearpay; alipay?: PaymentMethodDetails.Alipay; @@ -422,6 +424,8 @@ declare module 'stripe' { konbini?: PaymentMethodDetails.Konbini; + link?: PaymentMethodDetails.Link; + multibanco?: PaymentMethodDetails.Multibanco; oxxo?: PaymentMethodDetails.Oxxo; @@ -543,6 +547,8 @@ declare module 'stripe' { transit_number: string | null; } + interface Affirm {} + interface AfterpayClearpay { /** * Order identifier shown to the merchant in Afterpay's online portal. @@ -1469,6 +1475,8 @@ declare module 'stripe' { } } + interface Link {} + interface Multibanco { /** * Entity number associated with this Multibanco payment. diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index 76eb3d16ed..02e56eade7 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -810,6 +810,7 @@ declare module 'stripe' { namespace CustomerListPaymentMethodsParams { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -826,6 +827,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index 5ac7c9c39d..03d7766fc6 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -745,6 +745,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'konbini' + | 'link' | 'paynow' | 'sepa_credit_transfer' | 'sepa_debit' @@ -1193,6 +1194,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'konbini' + | 'link' | 'paynow' | 'sepa_credit_transfer' | 'sepa_debit' @@ -1533,6 +1535,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'konbini' + | 'link' | 'paynow' | 'sepa_credit_transfer' | 'sepa_debit' diff --git a/types/2020-08-27/Mandates.d.ts b/types/2020-08-27/Mandates.d.ts index e9a9d5055b..a6ad83a9d2 100644 --- a/types/2020-08-27/Mandates.d.ts +++ b/types/2020-08-27/Mandates.d.ts @@ -91,6 +91,8 @@ declare module 'stripe' { card?: PaymentMethodDetails.Card; + link?: PaymentMethodDetails.Link; + sepa_debit?: PaymentMethodDetails.SepaDebit; /** @@ -162,6 +164,8 @@ declare module 'stripe' { interface Card {} + interface Link {} + interface SepaDebit { /** * The unique reference of the mandate. diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index 57321e49ef..53d5318033 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -1161,6 +1161,11 @@ declare module 'stripe' { */ klarna?: PaymentMethodOptions.Klarna; + /** + * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + */ + link?: PaymentMethodOptions.Link; + /** * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. */ @@ -1464,6 +1469,37 @@ declare module 'stripe' { | 'sv-SE'; } + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + interface Oxxo { /** * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. @@ -2145,6 +2181,11 @@ declare module 'stripe' { */ klarna?: Stripe.Emptyable; + /** + * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + */ + link?: Stripe.Emptyable; + /** * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. */ @@ -2448,6 +2489,37 @@ declare module 'stripe' { | 'sv-SE'; } + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + interface Oxxo { /** * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 3bb43c7853..bd1bd66593 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -727,6 +727,8 @@ declare module 'stripe' { interface PaymentMethodOptions { acss_debit?: PaymentMethodOptions.AcssDebit; + affirm?: PaymentMethodOptions.Affirm; + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; alipay?: PaymentMethodOptions.Alipay; @@ -761,6 +763,8 @@ declare module 'stripe' { konbini?: PaymentMethodOptions.Konbini; + link?: PaymentMethodOptions.Link; + oxxo?: PaymentMethodOptions.Oxxo; p24?: PaymentMethodOptions.P24; @@ -829,6 +833,22 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + interface AfterpayClearpay { /** * Controls when the funds will be captured from the customer's account. @@ -1277,6 +1297,31 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Token used for persistent Link logins. + */ + persistent_token: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Link.SetupFutureUsage; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + interface Oxxo { /** * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. @@ -1738,6 +1783,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodData.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -1818,6 +1868,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodData.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -1882,6 +1937,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -2084,6 +2141,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -2144,6 +2203,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -2158,6 +2218,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -2208,6 +2269,11 @@ declare module 'stripe' { */ acss_debit?: Stripe.Emptyable; + /** + * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + */ + affirm?: Stripe.Emptyable; + /** * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. */ @@ -2297,6 +2363,11 @@ declare module 'stripe' { */ konbini?: Stripe.Emptyable; + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: Stripe.Emptyable; + /** * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. */ @@ -2393,6 +2464,28 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + interface AfterpayClearpay { /** * Controls when the funds will be captured from the customer's account. @@ -2894,6 +2987,37 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + interface Oxxo { /** * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. @@ -3273,6 +3397,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodData.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -3353,6 +3482,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodData.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -3417,6 +3551,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -3619,6 +3755,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -3679,6 +3817,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -3693,6 +3832,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -3743,6 +3883,11 @@ declare module 'stripe' { */ acss_debit?: Stripe.Emptyable; + /** + * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + */ + affirm?: Stripe.Emptyable; + /** * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. */ @@ -3832,6 +3977,11 @@ declare module 'stripe' { */ konbini?: Stripe.Emptyable; + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: Stripe.Emptyable; + /** * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. */ @@ -3928,6 +4078,28 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + interface AfterpayClearpay { /** * Controls when the funds will be captured from the customer's account. @@ -4429,6 +4601,37 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + interface Oxxo { /** * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. @@ -4945,6 +5148,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodData.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -5025,6 +5233,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodData.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -5089,6 +5302,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -5291,6 +5506,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -5351,6 +5568,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -5365,6 +5583,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -5415,6 +5634,11 @@ declare module 'stripe' { */ acss_debit?: Stripe.Emptyable; + /** + * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + */ + affirm?: Stripe.Emptyable; + /** * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. */ @@ -5504,6 +5728,11 @@ declare module 'stripe' { */ konbini?: Stripe.Emptyable; + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: Stripe.Emptyable; + /** * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. */ @@ -5600,6 +5829,28 @@ declare module 'stripe' { type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + interface AfterpayClearpay { /** * Controls when the funds will be captured from the customer's account. @@ -6101,6 +6352,37 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + interface Oxxo { /** * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index 5c0f61c085..069274436f 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -18,6 +18,8 @@ declare module 'stripe' { acss_debit?: PaymentMethod.AcssDebit; + affirm?: PaymentMethod.Affirm; + afterpay_clearpay?: PaymentMethod.AfterpayClearpay; alipay?: PaymentMethod.Alipay; @@ -64,6 +66,8 @@ declare module 'stripe' { konbini?: PaymentMethod.Konbini; + link?: PaymentMethod.Link; + /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ @@ -122,6 +126,8 @@ declare module 'stripe' { transit_number: string | null; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -548,6 +554,18 @@ declare module 'stripe' { interface Konbini {} + interface Link { + /** + * Account owner's email address. + */ + email: string | null; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + interface Oxxo {} interface P24 { @@ -643,6 +661,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -660,6 +679,7 @@ declare module 'stripe' { | 'interac_present' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -741,6 +761,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodCreateParams.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodCreateParams.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -836,6 +861,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodCreateParams.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodCreateParams.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -905,6 +935,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -1133,6 +1165,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -1193,6 +1227,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -1208,6 +1243,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -1265,6 +1301,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodUpdateParams.AcssDebit; + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + affirm?: PaymentMethodUpdateParams.Affirm; + /** * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. */ @@ -1290,6 +1331,11 @@ declare module 'stripe' { */ expand?: Array; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodUpdateParams.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -1309,6 +1355,8 @@ declare module 'stripe' { namespace PaymentMethodUpdateParams { interface AcssDebit {} + interface Affirm {} + interface AuBecsDebit {} interface BacsDebit {} @@ -1353,6 +1401,8 @@ declare module 'stripe' { exp_year?: number; } + interface Link {} + interface SepaDebit {} interface UsBankAccount { @@ -1387,6 +1437,7 @@ declare module 'stripe' { namespace PaymentMethodListParams { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -1403,6 +1454,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' diff --git a/types/2020-08-27/SetupAttempts.d.ts b/types/2020-08-27/SetupAttempts.d.ts index 9989074730..65145527ad 100644 --- a/types/2020-08-27/SetupAttempts.d.ts +++ b/types/2020-08-27/SetupAttempts.d.ts @@ -87,6 +87,8 @@ declare module 'stripe' { ideal?: PaymentMethodDetails.Ideal; + link?: PaymentMethodDetails.Link; + sepa_debit?: PaymentMethodDetails.SepaDebit; sofort?: PaymentMethodDetails.Sofort; @@ -283,6 +285,8 @@ declare module 'stripe' { | 'TRIONL2U'; } + interface Link {} + interface SepaDebit {} interface Sofort { diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2020-08-27/SetupIntents.d.ts index 26a7496ef5..d4d3651ace 100644 --- a/types/2020-08-27/SetupIntents.d.ts +++ b/types/2020-08-27/SetupIntents.d.ts @@ -300,6 +300,8 @@ declare module 'stripe' { card?: PaymentMethodOptions.Card; + link?: PaymentMethodOptions.Link; + sepa_debit?: PaymentMethodOptions.SepaDebit; us_bank_account?: PaymentMethodOptions.UsBankAccount; @@ -435,6 +437,13 @@ declare module 'stripe' { type RequestThreeDSecure = 'any' | 'automatic' | 'challenge_only'; } + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token: string | null; + } + interface SepaDebit { mandate_options?: SepaDebit.MandateOptions; } @@ -617,6 +626,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodData.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -697,6 +711,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodData.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -761,6 +780,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -963,6 +984,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -1023,6 +1046,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -1037,6 +1061,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -1092,6 +1117,11 @@ declare module 'stripe' { */ card?: PaymentMethodOptions.Card; + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: PaymentMethodOptions.Link; + /** * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. */ @@ -1245,6 +1275,13 @@ declare module 'stripe' { type RequestThreeDSecure = 'any' | 'automatic'; } + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + interface SepaDebit { /** * Additional fields for Mandate creation @@ -1388,6 +1425,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodData.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -1468,6 +1510,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodData.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -1532,6 +1579,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -1734,6 +1783,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -1794,6 +1845,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -1808,6 +1860,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -1863,6 +1916,11 @@ declare module 'stripe' { */ card?: PaymentMethodOptions.Card; + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: PaymentMethodOptions.Link; + /** * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. */ @@ -2016,6 +2074,13 @@ declare module 'stripe' { type RequestThreeDSecure = 'any' | 'automatic'; } + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + interface SepaDebit { /** * Additional fields for Mandate creation @@ -2250,6 +2315,11 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodData.AcssDebit; + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + /** * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. */ @@ -2330,6 +2400,11 @@ declare module 'stripe' { */ konbini?: PaymentMethodData.Konbini; + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -2394,6 +2469,8 @@ declare module 'stripe' { transit_number: string; } + interface Affirm {} + interface AfterpayClearpay {} interface Alipay {} @@ -2596,6 +2673,8 @@ declare module 'stripe' { interface Konbini {} + interface Link {} + interface Oxxo {} interface P24 { @@ -2656,6 +2735,7 @@ declare module 'stripe' { type Type = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' @@ -2670,6 +2750,7 @@ declare module 'stripe' { | 'ideal' | 'klarna' | 'konbini' + | 'link' | 'oxxo' | 'p24' | 'paynow' @@ -2725,6 +2806,11 @@ declare module 'stripe' { */ card?: PaymentMethodOptions.Card; + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: PaymentMethodOptions.Link; + /** * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. */ @@ -2878,6 +2964,13 @@ declare module 'stripe' { type RequestThreeDSecure = 'any' | 'automatic'; } + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + interface SepaDebit { /** * Additional fields for Mandate creation diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index 2a7e26ef64..e53404cec5 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -429,6 +429,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'konbini' + | 'link' | 'paynow' | 'sepa_credit_transfer' | 'sepa_debit' @@ -1046,6 +1047,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'konbini' + | 'link' | 'paynow' | 'sepa_credit_transfer' | 'sepa_debit' @@ -1668,6 +1670,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'konbini' + | 'link' | 'paynow' | 'sepa_credit_transfer' | 'sepa_debit' diff --git a/types/2020-08-27/index.d.ts b/types/2020-08-27/index.d.ts index 6604db30ec..0cea652d02 100644 --- a/types/2020-08-27/index.d.ts +++ b/types/2020-08-27/index.d.ts @@ -13,6 +13,7 @@ /// /// /// +/// /// /// /// @@ -198,6 +199,9 @@ declare module 'stripe' { /** * Namespaced Resources */ + apps: { + secrets: Stripe.Apps.SecretsResource; + }; billingPortal: { configurations: Stripe.BillingPortal.ConfigurationsResource; sessions: Stripe.BillingPortal.SessionsResource; From d8ef8ec0d751bed52869b6db24208595086d49cc Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 23 May 2022 12:56:51 -0700 Subject: [PATCH 14/25] Bump version to 9.3.0 --- CHANGELOG.md | 11 +++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03390a39ac..6b886e5bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # CHANGELOG +## 9.3.0 - 2022-05-23 +* [#1430](https://github.com/stripe/stripe-node/pull/1430) API Updates + * Add support for new resource `Apps.Secret` + * Add support for `affirm` on `Charge.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` + * Add support for `link` on `Charge.payment_method_details`, `Mandate.payment_method_details`, `OrderCreateParams.payment.settings.payment_method_options`, `OrderUpdateParams.payment.settings.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupAttempt.payment_method_details`, `SetupIntent.payment_method_options`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentConfirmParams.payment_method_options`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentCreateParams.payment_method_options`, `SetupIntentUpdateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_options` + * Add support for new values `affirm` and `link` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type` + * Add support for new value `link` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]` + * Add support for new values `affirm` and `link` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type` + * Add support for new values `affirm` and `link` on enum `PaymentMethodCreateParams.type` + * Add support for new values `affirm` and `link` on enum `PaymentMethod.type` + ## 9.2.0 - 2022-05-19 * [#1422](https://github.com/stripe/stripe-node/pull/1422) API Updates * Add support for new `Treasury` APIs: `CreditReversal`, `DebitReversal`, `FinancialAccountFeatures`, `FinancialAccount`, `FlowDetails`, `InboundTransfer`, `OutboundPayment`, `OutboundTransfer`, `ReceivedCredit`, `ReceivedDebit`, `TransactionEntry`, and `Transaction` diff --git a/VERSION b/VERSION index deeb3d66ef..b13d146a7b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.2.0 +9.3.0 diff --git a/package.json b/package.json index 993ecc3fbb..83d3cbbc88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.2.0", + "version": "9.3.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From ae76904debdad8821e4147ae9640f98bff2fc2cc Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Mon, 23 May 2022 15:45:46 -0700 Subject: [PATCH 15/25] Codegen for openapi v147 (#1431) --- OPENAPI_VERSION | 2 +- types/2020-08-27/Accounts.d.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 19a48dddde..618c1d9c13 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v146 \ No newline at end of file +v147 \ No newline at end of file diff --git a/types/2020-08-27/Accounts.d.ts b/types/2020-08-27/Accounts.d.ts index 7f4c8f212c..474063fa57 100644 --- a/types/2020-08-27/Accounts.d.ts +++ b/types/2020-08-27/Accounts.d.ts @@ -291,6 +291,11 @@ declare module 'stripe' { */ transfers?: Capabilities.Transfers; + /** + * The status of the banking capability, or whether the account can have bank accounts. + */ + treasury?: Capabilities.Treasury; + /** * The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. */ @@ -352,6 +357,8 @@ declare module 'stripe' { type Transfers = 'active' | 'inactive' | 'pending'; + type Treasury = 'active' | 'inactive' | 'pending'; + type UsBankAccountAchPayments = 'active' | 'inactive' | 'pending'; } @@ -1326,6 +1333,11 @@ declare module 'stripe' { */ transfers?: Capabilities.Transfers; + /** + * The treasury capability. + */ + treasury?: Capabilities.Treasury; + /** * The us_bank_account_ach_payments capability. */ @@ -1522,6 +1534,13 @@ declare module 'stripe' { requested?: boolean; } + interface Treasury { + /** + * 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 UsBankAccountAchPayments { /** * 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. @@ -2453,6 +2472,11 @@ declare module 'stripe' { */ transfers?: Capabilities.Transfers; + /** + * The treasury capability. + */ + treasury?: Capabilities.Treasury; + /** * The us_bank_account_ach_payments capability. */ @@ -2649,6 +2673,13 @@ declare module 'stripe' { requested?: boolean; } + interface Treasury { + /** + * 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 UsBankAccountAchPayments { /** * 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. From 798f44b42dfba7d336895f12f045fe9536ceb2d1 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 23 May 2022 15:55:53 -0700 Subject: [PATCH 16/25] Bump version to 9.4.0 --- CHANGELOG.md | 4 ++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b886e5bb2..727701763e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 9.4.0 - 2022-05-23 +* [#1431](https://github.com/stripe/stripe-node/pull/1431) API Updates + * Add support for `treasury` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` + ## 9.3.0 - 2022-05-23 * [#1430](https://github.com/stripe/stripe-node/pull/1430) API Updates * Add support for new resource `Apps.Secret` diff --git a/VERSION b/VERSION index b13d146a7b..8148c55948 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.3.0 +9.4.0 diff --git a/package.json b/package.json index 83d3cbbc88..11876dc63b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.3.0", + "version": "9.4.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From ff15721228b6028ffa5bb1fbffa9d901f1ea7a33 Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Wed, 25 May 2022 11:13:45 -0400 Subject: [PATCH 17/25] docs: Update HttpClient documentation to remove experimental status. (#1432) --- lib/net/HttpClient.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/net/HttpClient.js b/lib/net/HttpClient.js index 053ab0d8e7..b309ce7d9d 100644 --- a/lib/net/HttpClient.js +++ b/lib/net/HttpClient.js @@ -1,8 +1,13 @@ 'use strict'; /** - * Encapsulates the logic for issuing a request to the Stripe API. This is an - * experimental interface and is not yet stable. + * Encapsulates the logic for issuing a request to the Stripe API. + * + * A custom HTTP client should should implement: + * 1. A response class which extends HttpClientResponse and wraps around their + * own internal representation of a response. + * 2. A client class which extends HttpClient and implements all methods, + * returning their own response class when making requests. */ class HttpClient { /** The client name used for diagnostics. */ From cc0867caa2be5a660bb61da082a0be03f45f1cb7 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 26 May 2022 13:23:28 -0700 Subject: [PATCH 18/25] Codegen for openapi v149 (#1434) --- OPENAPI_VERSION | 2 +- types/2020-08-27/Accounts.d.ts | 72 +++++++++++++++++++ types/2020-08-27/Checkout/Sessions.d.ts | 1 + types/2020-08-27/PaymentIntents.d.ts | 5 ++ types/2020-08-27/Persons.d.ts | 15 ++++ types/2020-08-27/SubscriptionSchedules.d.ts | 6 +- types/2020-08-27/Terminal/Configurations.d.ts | 6 +- types/2020-08-27/Tokens.d.ts | 10 +++ .../Treasury/FinancialAccounts.d.ts | 36 ++++++++++ 9 files changed, 148 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 618c1d9c13..78b0e479e8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v147 \ No newline at end of file +v149 \ No newline at end of file diff --git a/types/2020-08-27/Accounts.d.ts b/types/2020-08-27/Accounts.d.ts index 474063fa57..1ef99ed08b 100644 --- a/types/2020-08-27/Accounts.d.ts +++ b/types/2020-08-27/Accounts.d.ts @@ -161,6 +161,11 @@ declare module 'stripe' { */ acss_debit_payments?: Capabilities.AcssDebitPayments; + /** + * The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. + */ + affirm_payments?: Capabilities.AffirmPayments; + /** * The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. */ @@ -251,6 +256,11 @@ declare module 'stripe' { */ legacy_payments?: Capabilities.LegacyPayments; + /** + * The status of the link_payments capability of the account, or whether the account can directly process Link charges. + */ + link_payments?: Capabilities.LinkPayments; + /** * The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. */ @@ -305,6 +315,8 @@ declare module 'stripe' { namespace Capabilities { type AcssDebitPayments = 'active' | 'inactive' | 'pending'; + type AffirmPayments = 'active' | 'inactive' | 'pending'; + type AfterpayClearpayPayments = 'active' | 'inactive' | 'pending'; type AuBecsDebitPayments = 'active' | 'inactive' | 'pending'; @@ -341,6 +353,8 @@ declare module 'stripe' { type LegacyPayments = 'active' | 'inactive' | 'pending'; + type LinkPayments = 'active' | 'inactive' | 'pending'; + type OxxoPayments = 'active' | 'inactive' | 'pending'; type P24Payments = 'active' | 'inactive' | 'pending'; @@ -1203,6 +1217,11 @@ declare module 'stripe' { */ acss_debit_payments?: Capabilities.AcssDebitPayments; + /** + * The affirm_payments capability. + */ + affirm_payments?: Capabilities.AffirmPayments; + /** * The afterpay_clearpay_payments capability. */ @@ -1293,6 +1312,11 @@ declare module 'stripe' { */ legacy_payments?: Capabilities.LegacyPayments; + /** + * The link_payments capability. + */ + link_payments?: Capabilities.LinkPayments; + /** * The oxxo_payments capability. */ @@ -1352,6 +1376,13 @@ declare module 'stripe' { requested?: boolean; } + interface AffirmPayments { + /** + * 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 AfterpayClearpayPayments { /** * 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. @@ -1478,6 +1509,13 @@ declare module 'stripe' { requested?: boolean; } + interface LinkPayments { + /** + * 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 OxxoPayments { /** * 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. @@ -1883,6 +1921,11 @@ declare module 'stripe' { */ id_number?: string; + /** + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + /** * The individual's last name. */ @@ -2342,6 +2385,11 @@ declare module 'stripe' { */ acss_debit_payments?: Capabilities.AcssDebitPayments; + /** + * The affirm_payments capability. + */ + affirm_payments?: Capabilities.AffirmPayments; + /** * The afterpay_clearpay_payments capability. */ @@ -2432,6 +2480,11 @@ declare module 'stripe' { */ legacy_payments?: Capabilities.LegacyPayments; + /** + * The link_payments capability. + */ + link_payments?: Capabilities.LinkPayments; + /** * The oxxo_payments capability. */ @@ -2491,6 +2544,13 @@ declare module 'stripe' { requested?: boolean; } + interface AffirmPayments { + /** + * 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 AfterpayClearpayPayments { /** * 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. @@ -2617,6 +2677,13 @@ declare module 'stripe' { requested?: boolean; } + interface LinkPayments { + /** + * 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 OxxoPayments { /** * 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. @@ -2985,6 +3052,11 @@ declare module 'stripe' { */ id_number?: string; + /** + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + /** * The individual's last name. */ diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index 654a2ade03..1cf7d75986 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -1770,6 +1770,7 @@ declare module 'stripe' { type PaymentMethodType = | 'acss_debit' + | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index bd1bd66593..0b3cc5bc24 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -462,6 +462,11 @@ declare module 'stripe' { DisplayBankTransferInstructions.FinancialAddress >; + /** + * A link to a hosted page that guides your customer through completing the transfer. + */ + hosted_instructions_url?: string | null; + /** * A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. */ diff --git a/types/2020-08-27/Persons.d.ts b/types/2020-08-27/Persons.d.ts index e2758a3c0e..6289b55107 100644 --- a/types/2020-08-27/Persons.d.ts +++ b/types/2020-08-27/Persons.d.ts @@ -82,6 +82,11 @@ declare module 'stripe' { */ id_number_provided?: boolean; + /** + * Whether the person's `id_number_secondary` was provided. + */ + id_number_secondary_provided?: boolean; + /** * The person's last name. */ @@ -646,6 +651,11 @@ declare module 'stripe' { */ id_number?: string; + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + /** * The person's last name. */ @@ -922,6 +932,11 @@ declare module 'stripe' { */ id_number?: string; + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + /** * The person's last name. */ diff --git a/types/2020-08-27/SubscriptionSchedules.d.ts b/types/2020-08-27/SubscriptionSchedules.d.ts index 389ebaaa41..700222b68e 100644 --- a/types/2020-08-27/SubscriptionSchedules.d.ts +++ b/types/2020-08-27/SubscriptionSchedules.d.ts @@ -595,7 +595,7 @@ declare module 'stripe' { metadata?: Stripe.MetadataParam; /** - * If a subscription schedule will create prorations when transitioning to this phase. Possible values are `create_prorations` or `none`, and the default value is `create_prorations`. See [Prorations](https://stripe.com/docs/billing/subscriptions/prorations). + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. */ proration_behavior?: Phase.ProrationBehavior; @@ -847,7 +847,7 @@ declare module 'stripe' { phases?: Array; /** - * If the update changes the current phase, indicates if the changes should be prorated. Possible values are `create_prorations` or `none`, and the default value is `create_prorations`. + * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. */ proration_behavior?: SubscriptionScheduleUpdateParams.ProrationBehavior; } @@ -1015,7 +1015,7 @@ declare module 'stripe' { metadata?: Stripe.MetadataParam; /** - * If a subscription schedule will create prorations when transitioning to this phase. Possible values are `create_prorations` or `none`, and the default value is `create_prorations`. See [Prorations](https://stripe.com/docs/billing/subscriptions/prorations). + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. */ proration_behavior?: Phase.ProrationBehavior; diff --git a/types/2020-08-27/Terminal/Configurations.d.ts b/types/2020-08-27/Terminal/Configurations.d.ts index cf7cec56ff..97951b1a5d 100644 --- a/types/2020-08-27/Terminal/Configurations.d.ts +++ b/types/2020-08-27/Terminal/Configurations.d.ts @@ -1107,7 +1107,11 @@ declare module 'stripe' { id: string, params?: ConfigurationUpdateParams, options?: RequestOptions - ): Promise>; + ): Promise< + Stripe.Response< + Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration + > + >; /** * Returns a list of Configuration objects. diff --git a/types/2020-08-27/Tokens.d.ts b/types/2020-08-27/Tokens.d.ts index 61c31e6dce..3069d1b496 100644 --- a/types/2020-08-27/Tokens.d.ts +++ b/types/2020-08-27/Tokens.d.ts @@ -345,6 +345,11 @@ declare module 'stripe' { */ id_number?: string; + /** + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + /** * The individual's last name. */ @@ -602,6 +607,11 @@ declare module 'stripe' { */ id_number?: string; + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + /** * The person's last name. */ diff --git a/types/2020-08-27/Treasury/FinancialAccounts.d.ts b/types/2020-08-27/Treasury/FinancialAccounts.d.ts index cf4a68f2e2..dab6fd0550 100644 --- a/types/2020-08-27/Treasury/FinancialAccounts.d.ts +++ b/types/2020-08-27/Treasury/FinancialAccounts.d.ts @@ -264,6 +264,11 @@ declare module 'stripe' { namespace FinancialAccountCreateParams { interface Features { + /** + * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + */ + card_issuing?: Features.CardIssuing; + /** * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. */ @@ -296,6 +301,13 @@ declare module 'stripe' { } namespace Features { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + interface DepositInsurance { /** * Whether the FinancialAccount should have the Feature. @@ -449,6 +461,11 @@ declare module 'stripe' { namespace FinancialAccountUpdateParams { interface Features { + /** + * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + */ + card_issuing?: Features.CardIssuing; + /** * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. */ @@ -481,6 +498,13 @@ declare module 'stripe' { } namespace Features { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + interface DepositInsurance { /** * Whether the FinancialAccount should have the Feature. @@ -620,6 +644,11 @@ declare module 'stripe' { } interface FinancialAccountUpdateFeaturesParams { + /** + * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + */ + card_issuing?: FinancialAccountUpdateFeaturesParams.CardIssuing; + /** * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. */ @@ -657,6 +686,13 @@ declare module 'stripe' { } namespace FinancialAccountUpdateFeaturesParams { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + interface DepositInsurance { /** * Whether the FinancialAccount should have the Feature. From 702c1f166dd809de342e6e2ad957e32a9963cd30 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 26 May 2022 13:33:51 -0700 Subject: [PATCH 19/25] Bump version to 9.5.0 --- CHANGELOG.md | 11 +++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 727701763e..646d5f80d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # CHANGELOG +## 9.5.0 - 2022-05-26 +* [#1434](https://github.com/stripe/stripe-node/pull/1434) API Updates + * Add support for `affirm_payments` and `link_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` + * Add support for `id_number_secondary` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person` + * Add support for new value `affirm` on enum `CheckoutSessionCreateParams.payment_method_types[]` + * Add support for `hosted_instructions_url` on `PaymentIntent.next_action.display_bank_transfer_instructions` + * Add support for `id_number_secondary_provided` on `Person` + * Add support for `card_issuing` on `TreasuryFinancialAccountCreateParams.features`, `TreasuryFinancialAccountUpdateFeaturesParams`, and `TreasuryFinancialAccountUpdateParams.features` + +* [#1432](https://github.com/stripe/stripe-node/pull/1432) docs: Update HttpClient documentation to remove experimental status. + ## 9.4.0 - 2022-05-23 * [#1431](https://github.com/stripe/stripe-node/pull/1431) API Updates * Add support for `treasury` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` diff --git a/VERSION b/VERSION index 8148c55948..d223b45108 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.4.0 +9.5.0 diff --git a/package.json b/package.json index 11876dc63b..3802eba964 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.4.0", + "version": "9.5.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 14902978401a5403feba7adfdd49c753b9159307 Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:10:13 -0400 Subject: [PATCH 20/25] API Updates (#1439) --- OPENAPI_VERSION | 2 +- types/2020-08-27/Charges.d.ts | 28 +++- types/2020-08-27/Checkout/Sessions.d.ts | 4 +- types/2020-08-27/CreditNoteLineItems.d.ts | 12 +- types/2020-08-27/CreditNotes.d.ts | 24 ++-- .../CustomerBalanceTransactions.d.ts | 2 +- types/2020-08-27/Customers.d.ts | 4 +- types/2020-08-27/FeeRefunds.d.ts | 2 +- types/2020-08-27/FundingInstructions.d.ts | 37 ++++- types/2020-08-27/InvoiceItems.d.ts | 20 +-- types/2020-08-27/InvoiceLineItems.d.ts | 14 +- types/2020-08-27/Invoices.d.ts | 24 ++-- types/2020-08-27/Orders.d.ts | 36 ++--- types/2020-08-27/PaymentIntents.d.ts | 131 +++++++++++++++--- types/2020-08-27/PaymentMethods.d.ts | 24 ++++ types/2020-08-27/Plans.d.ts | 4 +- types/2020-08-27/Prices.d.ts | 6 +- types/2020-08-27/Products.d.ts | 4 +- types/2020-08-27/Quotes.d.ts | 8 +- types/2020-08-27/SetupIntents.d.ts | 53 +++++++ types/2020-08-27/SubscriptionItems.d.ts | 8 +- types/2020-08-27/SubscriptionSchedules.d.ts | 16 +-- types/2020-08-27/Subscriptions.d.ts | 22 +-- types/2020-08-27/Terminal/Readers.d.ts | 4 +- types/2020-08-27/TransferReversals.d.ts | 2 +- types/2020-08-27/Transfers.d.ts | 2 +- 26 files changed, 352 insertions(+), 141 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 78b0e479e8..fff14d8c4a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v149 \ No newline at end of file +v150 \ No newline at end of file diff --git a/types/2020-08-27/Charges.d.ts b/types/2020-08-27/Charges.d.ts index 5223d7e409..901e7be817 100644 --- a/types/2020-08-27/Charges.d.ts +++ b/types/2020-08-27/Charges.d.ts @@ -172,6 +172,11 @@ declare module 'stripe' { */ payment_method_details: Charge.PaymentMethodDetails | null; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: Charge.RadarOptions; + /** * This is the email address that the receipt for this charge was sent to. */ @@ -1450,7 +1455,7 @@ declare module 'stripe' { /** * Preferred language of the Klarna authorization page that the customer is redirected to. - * Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, or `en-FR` + * Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `en-AU`, or `en-NZ` */ preferred_locale: string | null; } @@ -1715,6 +1720,13 @@ declare module 'stripe' { } } + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface Shipping { address?: Stripe.Address; @@ -1763,7 +1775,7 @@ declare module 'stripe' { application_fee?: number; /** - * A fee in %s that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + * A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). */ application_fee_amount?: number; @@ -1804,6 +1816,11 @@ declare module 'stripe' { */ on_behalf_of?: string; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: ChargeCreateParams.RadarOptions; + /** * The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). */ @@ -1853,6 +1870,13 @@ declare module 'stripe' { amount?: number; } + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface Shipping { /** * Shipping address. diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index 1cf7d75986..c41fc52dd5 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -1361,12 +1361,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A non-negative integer in %s representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + * A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/CreditNoteLineItems.d.ts b/types/2020-08-27/CreditNoteLineItems.d.ts index 7193b3ceb5..6699de1d56 100644 --- a/types/2020-08-27/CreditNoteLineItems.d.ts +++ b/types/2020-08-27/CreditNoteLineItems.d.ts @@ -124,12 +124,12 @@ declare module 'stripe' { invoice: string; /** - * The integer amount in %s representing the total amount of the credit note. + * The integer amount in cents (or local equivalent) representing the total amount of the credit note. */ amount?: number; /** - * The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. */ credit_amount?: number; @@ -154,7 +154,7 @@ declare module 'stripe' { metadata?: Stripe.MetadataParam; /** - * The integer amount in %s representing the amount that is credited outside of Stripe. + * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. */ out_of_band_amount?: number; @@ -169,7 +169,7 @@ declare module 'stripe' { refund?: string; /** - * The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. */ refund_amount?: number; } @@ -207,12 +207,12 @@ declare module 'stripe' { type: Line.Type; /** - * The integer unit amount in %s of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/CreditNotes.d.ts b/types/2020-08-27/CreditNotes.d.ts index 5bf1d68413..4dc25d18ec 100644 --- a/types/2020-08-27/CreditNotes.d.ts +++ b/types/2020-08-27/CreditNotes.d.ts @@ -183,12 +183,12 @@ declare module 'stripe' { invoice: string; /** - * The integer amount in %s representing the total amount of the credit note. + * The integer amount in cents (or local equivalent) representing the total amount of the credit note. */ amount?: number; /** - * The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. */ credit_amount?: number; @@ -213,7 +213,7 @@ declare module 'stripe' { metadata?: Stripe.MetadataParam; /** - * The integer amount in %s representing the amount that is credited outside of Stripe. + * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. */ out_of_band_amount?: number; @@ -228,7 +228,7 @@ declare module 'stripe' { refund?: string; /** - * The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. */ refund_amount?: number; } @@ -266,12 +266,12 @@ declare module 'stripe' { type: Line.Type; /** - * The integer unit amount in %s of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -335,12 +335,12 @@ declare module 'stripe' { invoice: string; /** - * The integer amount in %s representing the total amount of the credit note. + * The integer amount in cents (or local equivalent) representing the total amount of the credit note. */ amount?: number; /** - * The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. */ credit_amount?: number; @@ -365,7 +365,7 @@ declare module 'stripe' { metadata?: Stripe.MetadataParam; /** - * The integer amount in %s representing the amount that is credited outside of Stripe. + * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. */ out_of_band_amount?: number; @@ -380,7 +380,7 @@ declare module 'stripe' { refund?: string; /** - * The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. */ refund_amount?: number; } @@ -418,12 +418,12 @@ declare module 'stripe' { type: Line.Type; /** - * The integer unit amount in %s of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/CustomerBalanceTransactions.d.ts b/types/2020-08-27/CustomerBalanceTransactions.d.ts index 5aba9aec90..7cf006274f 100644 --- a/types/2020-08-27/CustomerBalanceTransactions.d.ts +++ b/types/2020-08-27/CustomerBalanceTransactions.d.ts @@ -87,7 +87,7 @@ declare module 'stripe' { interface CustomerBalanceTransactionCreateParams { /** - * The integer amount in **%s** to apply to the customer's credit balance. + * The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. */ amount: number; diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index 02e56eade7..6a2196bbb3 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -278,7 +278,7 @@ declare module 'stripe' { address?: Stripe.Emptyable; /** - * An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + * An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. */ balance?: number; @@ -543,7 +543,7 @@ declare module 'stripe' { address?: Stripe.Emptyable; /** - * An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + * An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. */ balance?: number; diff --git a/types/2020-08-27/FeeRefunds.d.ts b/types/2020-08-27/FeeRefunds.d.ts index 5289144cb0..1c8f53ecd3 100644 --- a/types/2020-08-27/FeeRefunds.d.ts +++ b/types/2020-08-27/FeeRefunds.d.ts @@ -49,7 +49,7 @@ declare module 'stripe' { interface FeeRefundCreateParams { /** - * A positive integer, in _%s_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. + * A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. */ amount?: number; diff --git a/types/2020-08-27/FundingInstructions.d.ts b/types/2020-08-27/FundingInstructions.d.ts index 7c045d2b8b..f028676cdb 100644 --- a/types/2020-08-27/FundingInstructions.d.ts +++ b/types/2020-08-27/FundingInstructions.d.ts @@ -70,7 +70,42 @@ declare module 'stripe' { type Type = 'iban' | 'zengin'; - interface Zengin {} + interface Zengin { + /** + * The account holder name + */ + account_holder_name: string | null; + + /** + * The account number + */ + account_number: string | null; + + /** + * The bank account type. In Japan, this can only be `futsu` or `toza`. + */ + account_type: string | null; + + /** + * The bank code of the account + */ + bank_code: string | null; + + /** + * The bank name of the account + */ + bank_name: string | null; + + /** + * The branch code of the account + */ + branch_code: string | null; + + /** + * The branch name of the account + */ + branch_name: string | null; + } } type Type = 'eu_bank_transfer' | 'jp_bank_transfer'; diff --git a/types/2020-08-27/InvoiceItems.d.ts b/types/2020-08-27/InvoiceItems.d.ts index 344dce8940..1f2920dad8 100644 --- a/types/2020-08-27/InvoiceItems.d.ts +++ b/types/2020-08-27/InvoiceItems.d.ts @@ -162,7 +162,7 @@ declare module 'stripe' { customer: string; /** - * The integer amount in %s of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. + * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. */ amount?: number; @@ -232,12 +232,12 @@ declare module 'stripe' { tax_rates?: Array; /** - * The integer unit amount in %s of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -284,12 +284,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -308,7 +308,7 @@ declare module 'stripe' { interface InvoiceItemUpdateParams { /** - * The integer amount in %s of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. */ amount?: number; @@ -363,12 +363,12 @@ declare module 'stripe' { tax_rates?: Stripe.Emptyable>; /** - * The integer unit amount in %s of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -415,12 +415,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/InvoiceLineItems.d.ts b/types/2020-08-27/InvoiceLineItems.d.ts index 5bf61fe6db..2dd00e93f9 100644 --- a/types/2020-08-27/InvoiceLineItems.d.ts +++ b/types/2020-08-27/InvoiceLineItems.d.ts @@ -448,7 +448,7 @@ declare module 'stripe' { interface InvoiceItem { /** - * The integer amount in %s of previewed invoice item. + * The integer amount in cents (or local equivalent) of previewed invoice item. */ amount?: number; @@ -508,12 +508,12 @@ declare module 'stripe' { tax_rates?: Stripe.Emptyable>; /** - * The integer unit amount in %s of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -560,12 +560,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -661,12 +661,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index 03d7766fc6..2cd3038008 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -697,7 +697,7 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { /** - * The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. */ type: string | null; } @@ -879,7 +879,7 @@ declare module 'stripe' { account_tax_ids?: Stripe.Emptyable>; /** - * A fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). */ application_fee_amount?: number; @@ -1139,7 +1139,7 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { /** - * The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. */ type?: string; } @@ -1235,7 +1235,7 @@ declare module 'stripe' { account_tax_ids?: Stripe.Emptyable>; /** - * A fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). */ application_fee_amount?: number; @@ -1480,7 +1480,7 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { /** - * The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. */ type?: string; } @@ -1910,7 +1910,7 @@ declare module 'stripe' { interface InvoiceItem { /** - * The integer amount in %s of previewed invoice item. + * The integer amount in cents (or local equivalent) of previewed invoice item. */ amount?: number; @@ -1970,12 +1970,12 @@ declare module 'stripe' { tax_rates?: Stripe.Emptyable>; /** - * The integer unit amount in %s of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -2022,12 +2022,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -2123,12 +2123,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index 53d5318033..70fc77d805 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -413,25 +413,9 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The bank transfer type that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ - type: BankTransfer.Type | null; - } - - namespace BankTransfer { - type Type = - | 'eu_bank_account' - | 'eu_bank_transfer' - | 'gb_bank_account' - | 'gb_bank_transfer' - | 'id_bank_account' - | 'id_bank_transfer' - | 'jp_bank_account' - | 'jp_bank_transfer' - | 'mx_bank_account' - | 'mx_bank_transfer' - | 'us_bank_account' - | 'us_bank_transfer'; + type: 'jp_bank_transfer' | null; } } @@ -1059,12 +1043,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -1387,7 +1371,7 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ type: 'jp_bank_transfer'; } @@ -1443,6 +1427,7 @@ declare module 'stripe' { | 'de-AT' | 'de-DE' | 'en-AT' + | 'en-AU' | 'en-BE' | 'en-DE' | 'en-DK' @@ -1454,6 +1439,7 @@ declare module 'stripe' { | 'en-IT' | 'en-NL' | 'en-NO' + | 'en-NZ' | 'en-SE' | 'en-US' | 'es-ES' @@ -2075,12 +2061,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -2407,7 +2393,7 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ type: 'jp_bank_transfer'; } @@ -2463,6 +2449,7 @@ declare module 'stripe' { | 'de-AT' | 'de-DE' | 'en-AT' + | 'en-AU' | 'en-BE' | 'en-DE' | 'en-DK' @@ -2474,6 +2461,7 @@ declare module 'stripe' { | 'en-IT' | 'en-NL' | 'en-NO' + | 'en-NZ' | 'en-SE' | 'en-US' | 'es-ES' diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 0b3cc5bc24..89ef100193 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -465,7 +465,7 @@ declare module 'stripe' { /** * A link to a hosted page that guides your customer through completing the transfer. */ - hosted_instructions_url?: string | null; + hosted_instructions_url: string | null; /** * A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. @@ -501,7 +501,42 @@ declare module 'stripe' { type Type = 'iban' | 'zengin'; - interface Zengin {} + interface Zengin { + /** + * The account holder name + */ + account_holder_name: string | null; + + /** + * The account number + */ + account_number: string | null; + + /** + * The bank account type. In Japan, this can only be `futsu` or `toza`. + */ + account_type: string | null; + + /** + * The bank code of the account + */ + bank_code: string | null; + + /** + * The bank name of the account + */ + bank_name: string | null; + + /** + * The branch code of the account + */ + branch_code: string | null; + + /** + * The branch name of the account + */ + branch_name: string | null; + } } } @@ -1167,25 +1202,9 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The bank transfer type that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ - type: BankTransfer.Type | null; - } - - namespace BankTransfer { - type Type = - | 'eu_bank_account' - | 'eu_bank_transfer' - | 'gb_bank_account' - | 'gb_bank_transfer' - | 'id_bank_account' - | 'id_bank_transfer' - | 'jp_bank_account' - | 'jp_bank_transfer' - | 'mx_bank_account' - | 'mx_bank_transfer' - | 'us_bank_account' - | 'us_bank_transfer'; + type: 'jp_bank_transfer' | null; } } @@ -1668,6 +1687,11 @@ declare module 'stripe' { */ payment_method_types?: Array; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentIntentCreateParams.RadarOptions; + /** * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). */ @@ -1898,6 +1922,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -2188,6 +2217,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. @@ -2823,7 +2859,7 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ type: 'jp_bank_transfer'; } @@ -2933,6 +2969,7 @@ declare module 'stripe' { | 'de-AT' | 'de-DE' | 'en-AT' + | 'en-AU' | 'en-BE' | 'en-DE' | 'en-DK' @@ -2944,6 +2981,7 @@ declare module 'stripe' { | 'en-IT' | 'en-NL' | 'en-NO' + | 'en-NZ' | 'en-SE' | 'en-US' | 'es-ES' @@ -3220,6 +3258,13 @@ declare module 'stripe' { } } + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + type SetupFutureUsage = 'off_session' | 'on_session'; interface Shipping { @@ -3512,6 +3557,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -3802,6 +3852,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. @@ -4437,7 +4494,7 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ type: 'jp_bank_transfer'; } @@ -4547,6 +4604,7 @@ declare module 'stripe' { | 'de-AT' | 'de-DE' | 'en-AT' + | 'en-AU' | 'en-BE' | 'en-DE' | 'en-DK' @@ -4558,6 +4616,7 @@ declare module 'stripe' { | 'en-IT' | 'en-NL' | 'en-NO' + | 'en-NZ' | 'en-SE' | 'en-US' | 'es-ES' @@ -5024,6 +5083,11 @@ declare module 'stripe' { */ payment_method_options?: PaymentIntentConfirmParams.PaymentMethodOptions; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentIntentConfirmParams.RadarOptions; + /** * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). */ @@ -5263,6 +5327,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -5553,6 +5622,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. @@ -6188,7 +6264,7 @@ declare module 'stripe' { requested_address_types?: Array<'zengin'>; /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. */ type: 'jp_bank_transfer'; } @@ -6298,6 +6374,7 @@ declare module 'stripe' { | 'de-AT' | 'de-DE' | 'en-AT' + | 'en-AU' | 'en-BE' | 'en-DE' | 'en-DK' @@ -6309,6 +6386,7 @@ declare module 'stripe' { | 'en-IT' | 'en-NL' | 'en-NO' + | 'en-NZ' | 'en-SE' | 'en-US' | 'es-ES' @@ -6585,6 +6663,13 @@ declare module 'stripe' { } } + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + type SetupFutureUsage = 'off_session' | 'on_session'; interface Shipping { diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index 069274436f..2528a40749 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -84,6 +84,11 @@ declare module 'stripe' { paynow?: PaymentMethod.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethod.RadarOptions; + sepa_debit?: PaymentMethod.SepaDebit; sofort?: PaymentMethod.Sofort; @@ -606,6 +611,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * Bank code of bank associated with the bank account. @@ -891,6 +903,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodCreateParams.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodCreateParams.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -1207,6 +1224,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. diff --git a/types/2020-08-27/Plans.d.ts b/types/2020-08-27/Plans.d.ts index 5f913658dc..c03e2f0f9d 100644 --- a/types/2020-08-27/Plans.d.ts +++ b/types/2020-08-27/Plans.d.ts @@ -206,7 +206,7 @@ declare module 'stripe' { aggregate_usage?: PlanCreateParams.AggregateUsage; /** - * A positive integer in %s (or 0 for a free plan) representing how much to charge on a recurring basis. + * A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. */ amount?: number; @@ -336,7 +336,7 @@ declare module 'stripe' { unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; diff --git a/types/2020-08-27/Prices.d.ts b/types/2020-08-27/Prices.d.ts index 92eb16ccb0..589ad5744e 100644 --- a/types/2020-08-27/Prices.d.ts +++ b/types/2020-08-27/Prices.d.ts @@ -293,12 +293,12 @@ declare module 'stripe' { transform_quantity?: PriceCreateParams.TransformQuantity; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -403,7 +403,7 @@ declare module 'stripe' { unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; diff --git a/types/2020-08-27/Products.d.ts b/types/2020-08-27/Products.d.ts index 56cf520f20..d896c0c276 100644 --- a/types/2020-08-27/Products.d.ts +++ b/types/2020-08-27/Products.d.ts @@ -273,12 +273,12 @@ declare module 'stripe' { tax_behavior?: DefaultPriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/Quotes.d.ts b/types/2020-08-27/Quotes.d.ts index 1d9daf0030..b89bc07587 100644 --- a/types/2020-08-27/Quotes.d.ts +++ b/types/2020-08-27/Quotes.d.ts @@ -698,12 +698,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -937,12 +937,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2020-08-27/SetupIntents.d.ts index d4d3651ace..708a19e526 100644 --- a/types/2020-08-27/SetupIntents.d.ts +++ b/types/2020-08-27/SetupIntents.d.ts @@ -369,6 +369,11 @@ declare module 'stripe' { */ mandate_options: Card.MandateOptions | null; + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. + */ + network: Card.Network | null; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. */ @@ -434,6 +439,18 @@ declare module 'stripe' { type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; } + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + type RequestThreeDSecure = 'any' | 'automatic' | 'challenge_only'; } @@ -736,6 +753,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -1026,6 +1048,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. @@ -1535,6 +1564,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -1825,6 +1859,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. @@ -2425,6 +2466,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + /** * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. */ @@ -2715,6 +2761,13 @@ declare module 'stripe' { interface Paynow {} + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + interface SepaDebit { /** * IBAN of the bank account. diff --git a/types/2020-08-27/SubscriptionItems.d.ts b/types/2020-08-27/SubscriptionItems.d.ts index 7d5fe94359..48455bb53c 100644 --- a/types/2020-08-27/SubscriptionItems.d.ts +++ b/types/2020-08-27/SubscriptionItems.d.ts @@ -210,12 +210,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -360,12 +360,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/SubscriptionSchedules.d.ts b/types/2020-08-27/SubscriptionSchedules.d.ts index 700222b68e..a5495e5eda 100644 --- a/types/2020-08-27/SubscriptionSchedules.d.ts +++ b/types/2020-08-27/SubscriptionSchedules.d.ts @@ -656,12 +656,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -763,12 +763,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -1081,12 +1081,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -1188,12 +1188,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index e53404cec5..f5fef27758 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -381,7 +381,7 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { /** - * The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. */ type: string | null; } @@ -705,12 +705,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -808,12 +808,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -992,7 +992,7 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { /** - * The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. */ type?: string; } @@ -1295,12 +1295,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -1415,12 +1415,12 @@ declare module 'stripe' { tax_behavior?: PriceData.TaxBehavior; /** - * A positive integer in %s (or 0 for a free price) representing how much to charge. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. */ unit_amount?: number; /** - * Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. */ unit_amount_decimal?: string; } @@ -1615,7 +1615,7 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { /** - * The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + * The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. */ type?: string; } diff --git a/types/2020-08-27/Terminal/Readers.d.ts b/types/2020-08-27/Terminal/Readers.d.ts index 7f74c420a6..f33c841438 100644 --- a/types/2020-08-27/Terminal/Readers.d.ts +++ b/types/2020-08-27/Terminal/Readers.d.ts @@ -30,7 +30,7 @@ declare module 'stripe' { device_sw_version: string | null; /** - * Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, or `verifone_P400`. + * Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. */ device_type: Reader.DeviceType; @@ -192,6 +192,7 @@ declare module 'stripe' { | 'bbpos_chipper2x' | 'bbpos_wisepad3' | 'bbpos_wisepos_e' + | 'simulated_wisepos_e' | 'stripe_m2' | 'verifone_P400'; } @@ -294,6 +295,7 @@ declare module 'stripe' { | 'bbpos_chipper2x' | 'bbpos_wisepad3' | 'bbpos_wisepos_e' + | 'simulated_wisepos_e' | 'stripe_m2' | 'verifone_P400'; diff --git a/types/2020-08-27/TransferReversals.d.ts b/types/2020-08-27/TransferReversals.d.ts index d9e8d5dd74..ba70766572 100644 --- a/types/2020-08-27/TransferReversals.d.ts +++ b/types/2020-08-27/TransferReversals.d.ts @@ -59,7 +59,7 @@ declare module 'stripe' { interface TransferReversalCreateParams { /** - * A positive integer in %s representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. + * A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. */ amount?: number; diff --git a/types/2020-08-27/Transfers.d.ts b/types/2020-08-27/Transfers.d.ts index 82bc413a8d..67d52d7657 100644 --- a/types/2020-08-27/Transfers.d.ts +++ b/types/2020-08-27/Transfers.d.ts @@ -104,7 +104,7 @@ declare module 'stripe' { destination: string; /** - * A positive integer in %s representing how much to transfer. + * A positive integer in cents (or local equivalent) representing how much to transfer. */ amount?: number; From 66993bb34bca0a407995903853c93fa2be915f42 Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Wed, 1 Jun 2022 15:17:17 -0400 Subject: [PATCH 21/25] Bump version to 9.6.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 646d5f80d1..bef758ba13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # CHANGELOG +## 9.6.0 - 2022-06-01 +* [#1439](https://github.com/stripe/stripe-node/pull/1439) API Updates + * Add support for `radar_options` on `ChargeCreateParams`, `Charge`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` + * Add support for `account_holder_name`, `account_number`, `account_type`, `bank_code`, `bank_name`, `branch_code`, and `branch_name` on `FundingInstructions.bank_transfer.financial_addresses[].zengin` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].zengin` + * Add support for new values `en-AU` and `en-NZ` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale` + * Change type of `Order.payment.settings.payment_method_options.customer_balance.bank_transfer.type` and `PaymentIntent.payment_method_options.customer_balance.bank_transfer.type` from `enum` to `literal('jp_bank_transfer')` + * This is technically breaking in Typescript, but now accurately represents the behavior that was allowed by the server. We haven't historically treated breaking Typescript changes as requiring a major. + * Change `PaymentIntent.next_action.display_bank_transfer_instructions.hosted_instructions_url` to be required + * Add support for `network` on `SetupIntent.payment_method_options.card` + * Add support for new value `simulated_wisepos_e` on enums `Terminal.Reader.device_type` and `TerminalReaderListParams.device_type` + + ## 9.5.0 - 2022-05-26 * [#1434](https://github.com/stripe/stripe-node/pull/1434) API Updates * Add support for `affirm_payments` and `link_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` diff --git a/VERSION b/VERSION index d223b45108..7b0680f4e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.5.0 +9.6.0 diff --git a/package.json b/package.json index 3802eba964..2778d0e339 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.5.0", + "version": "9.6.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From d0f14ef53a88bd49899df9366424ebb0368872ea Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Mon, 6 Jun 2022 09:58:30 -0700 Subject: [PATCH 22/25] Update README.md (#1440) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2cd98e471..c11b713602 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Stripe Node.js Library [![Version](https://img.shields.io/npm/v/stripe.svg)](https://www.npmjs.org/package/stripe) -[![Build Status](https://travis-ci.org/stripe/stripe-node.svg?branch=master)](https://travis-ci.org/stripe/stripe-node) +[![Build Status](https://github.com/stripe/stripe-node/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-node/actions?query=branch%3Amaster) [![Downloads](https://img.shields.io/npm/dm/stripe.svg)](https://www.npmjs.com/package/stripe) [![Try on RunKit](https://badge.runkitcdn.com/stripe.svg)](https://runkit.com/npm/stripe) From 553986dcc0e06e7f5ae2335e49066cc34e26f9e0 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 8 Jun 2022 08:06:18 -0700 Subject: [PATCH 23/25] Codegen for openapi v152 (#1441) --- OPENAPI_VERSION | 2 +- .../resources/generated_examples_test.spec.js | 14 + types/2020-08-27/Checkout/Sessions.d.ts | 621 +++++++++++++++++- types/2020-08-27/InvoiceLineItems.d.ts | 6 +- types/2020-08-27/Invoices.d.ts | 12 +- types/2020-08-27/PaymentIntents.d.ts | 6 +- types/2020-08-27/PaymentMethods.d.ts | 2 +- types/2020-08-27/SetupAttempts.d.ts | 16 + types/2020-08-27/SetupIntents.d.ts | 47 +- types/2020-08-27/SubscriptionItems.d.ts | 18 +- types/2020-08-27/Subscriptions.d.ts | 22 +- types/2020-08-27/Treasury/ReceivedDebits.d.ts | 2 +- 12 files changed, 703 insertions(+), 65 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index fff14d8c4a..0b9a2a89f2 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v150 \ No newline at end of file +v152 \ 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 3e6f355919..662d631532 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -877,6 +877,20 @@ describe('Apps.Secret', function() { }); }); +describe('CashBalance', function() { + it('retrieveCashBalance method', async function() { + const cashBalance = await stripe.customers.retrieveCashBalance('cus_123'); + expect(cashBalance).not.to.be.null; + }); + + it('updateCashBalance method', async function() { + const cashBalance = await stripe.customers.updateCashBalance('cus_123', { + settings: {reconciliation_mode: 'manual'}, + }); + expect(cashBalance).not.to.be.null; + }); +}); + describe('Charge', function() { it('create method', async function() { const charge = await stripe.charges.create({ diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index c41fc52dd5..6bb148087e 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -449,6 +449,8 @@ declare module 'stripe' { interface PaymentMethodOptions { acss_debit?: PaymentMethodOptions.AcssDebit; + affirm?: PaymentMethodOptions.Affirm; + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; alipay?: PaymentMethodOptions.Alipay; @@ -457,8 +459,12 @@ declare module 'stripe' { bacs_debit?: PaymentMethodOptions.BacsDebit; + bancontact?: PaymentMethodOptions.Bancontact; + boleto?: PaymentMethodOptions.Boleto; + card?: PaymentMethodOptions.Card; + eps?: PaymentMethodOptions.Eps; fpx?: PaymentMethodOptions.Fpx; @@ -467,16 +473,22 @@ declare module 'stripe' { grabpay?: PaymentMethodOptions.Grabpay; + ideal?: PaymentMethodOptions.Ideal; + klarna?: PaymentMethodOptions.Klarna; konbini?: PaymentMethodOptions.Konbini; oxxo?: PaymentMethodOptions.Oxxo; + p24?: PaymentMethodOptions.P24; + paynow?: PaymentMethodOptions.Paynow; sepa_debit?: PaymentMethodOptions.SepaDebit; + sofort?: PaymentMethodOptions.Sofort; + us_bank_account?: PaymentMethodOptions.UsBankAccount; } @@ -486,6 +498,15 @@ declare module 'stripe' { mandate_options?: AcssDebit.MandateOptions; + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AcssDebit.SetupFutureUsage; + /** * Bank account verification method. */ @@ -528,39 +549,200 @@ declare module 'stripe' { type TransactionType = 'business' | 'personal'; } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } - interface AfterpayClearpay {} + interface Affirm { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface AfterpayClearpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface AuBecsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } - interface Alipay {} + interface BacsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: BacsDebit.SetupFutureUsage; + } - interface AuBecsDebit {} + namespace BacsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } - interface BacsDebit {} + interface Bancontact { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } 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. */ expires_after_days: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Boleto.SetupFutureUsage; } - interface Eps {} + namespace Boleto { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } - interface Fpx {} + interface Card { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Card.SetupFutureUsage; + } - interface Giropay {} + namespace Card { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } - interface Grabpay {} + interface Eps { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } - interface Klarna {} + interface Fpx { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Giropay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Grabpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Klarna { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Klarna.SetupFutureUsage; + } + + namespace Klarna { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } interface Konbini { /** * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. */ expires_after_days: number | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; } interface Oxxo { @@ -568,15 +750,77 @@ declare module 'stripe' { * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. */ expires_after_days: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; } - interface Paynow {} + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } - interface SepaDebit {} + interface Paynow { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface SepaDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: SepaDebit.SetupFutureUsage; + } + + namespace SepaDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } interface UsBankAccount { financial_connections?: UsBankAccount.FinancialConnections; + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: UsBankAccount.SetupFutureUsage; + /** * Bank account verification method. */ @@ -604,6 +848,8 @@ declare module 'stripe' { | 'transactions'; } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + type VerificationMethod = 'automatic' | 'instant'; } } @@ -1605,16 +1851,76 @@ declare module 'stripe' { */ acss_debit?: PaymentMethodOptions.AcssDebit; + /** + * contains details about the Affirm payment method options. + */ + affirm?: PaymentMethodOptions.Affirm; + + /** + * contains details about the Afterpay Clearpay payment method options. + */ + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + /** * contains details about the Alipay payment method options. */ alipay?: PaymentMethodOptions.Alipay; + /** + * contains details about the AU Becs Debit payment method options. + */ + au_becs_debit?: PaymentMethodOptions.AuBecsDebit; + + /** + * contains details about the Bacs Debit payment method options. + */ + bacs_debit?: PaymentMethodOptions.BacsDebit; + + /** + * contains details about the Bancontact payment method options. + */ + bancontact?: PaymentMethodOptions.Bancontact; + /** * contains details about the Boleto payment method options. */ boleto?: PaymentMethodOptions.Boleto; + /** + * contains details about the Card payment method options. + */ + card?: PaymentMethodOptions.Card; + + /** + * contains details about the EPS payment method options. + */ + eps?: PaymentMethodOptions.Eps; + + /** + * contains details about the EPS payment method options. + */ + fpx?: PaymentMethodOptions.Fpx; + + /** + * contains details about the Giropay payment method options. + */ + giropay?: PaymentMethodOptions.Giropay; + + /** + * contains details about the Grabpay payment method options. + */ + grabpay?: PaymentMethodOptions.Grabpay; + + /** + * contains details about the Ideal payment method options. + */ + ideal?: PaymentMethodOptions.Ideal; + + /** + * contains details about the Klarna payment method options. + */ + klarna?: PaymentMethodOptions.Klarna; + /** * contains details about the Konbini payment method options. */ @@ -1625,6 +1931,26 @@ declare module 'stripe' { */ oxxo?: PaymentMethodOptions.Oxxo; + /** + * contains details about the P24 payment method options. + */ + p24?: PaymentMethodOptions.P24; + + /** + * contains details about the PayNow payment method options. + */ + paynow?: PaymentMethodOptions.Paynow; + + /** + * contains details about the Sepa Debit payment method options. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * contains details about the Sofort payment method options. + */ + sofort?: PaymentMethodOptions.Sofort; + /** * contains details about the Us Bank Account payment method options. */ @@ -1648,6 +1974,15 @@ declare module 'stripe' { */ mandate_options?: AcssDebit.MandateOptions; + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AcssDebit.SetupFutureUsage; + /** * Verification method for the intent */ @@ -1694,16 +2029,180 @@ declare module 'stripe' { type TransactionType = 'business' | 'personal'; } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; } - interface Alipay {} + interface Affirm { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface AfterpayClearpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface AuBecsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface BacsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: BacsDebit.SetupFutureUsage; + } + + namespace BacsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Bancontact { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } 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. */ expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Boleto.SetupFutureUsage; + } + + namespace Boleto { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Card { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type SetupFutureUsage = 'off_session' | 'on_session'; + } + + interface Eps { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Fpx { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Giropay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Grabpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Klarna { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; } interface Konbini { @@ -1711,6 +2210,15 @@ declare module 'stripe' { * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. */ expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; } interface Oxxo { @@ -1718,6 +2226,73 @@ declare module 'stripe' { * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. */ expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paynow { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface SepaDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: SepaDebit.SetupFutureUsage; + } + + namespace SepaDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; } interface UsBankAccount { @@ -1726,6 +2301,15 @@ declare module 'stripe' { */ financial_connections?: UsBankAccount.FinancialConnections; + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: UsBankAccount.SetupFutureUsage; + /** * Verification method for the intent */ @@ -1735,7 +2319,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; } @@ -1748,6 +2332,8 @@ declare module 'stripe' { | 'transactions'; } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + type VerificationMethod = 'automatic' | 'instant'; } @@ -1761,6 +2347,15 @@ declare module 'stripe' { * The client type that the end customer will pay from */ client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; } namespace WechatPay { diff --git a/types/2020-08-27/InvoiceLineItems.d.ts b/types/2020-08-27/InvoiceLineItems.d.ts index 2dd00e93f9..665986bfe5 100644 --- a/types/2020-08-27/InvoiceLineItems.d.ts +++ b/types/2020-08-27/InvoiceLineItems.d.ts @@ -270,11 +270,7 @@ declare module 'stripe' { >; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - * - * Prorations can be disabled by passing `none`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. */ subscription_proration_behavior?: InvoiceLineItemListUpcomingParams.SubscriptionProrationBehavior; diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index 2cd3038008..635b03104e 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -44,7 +44,7 @@ declare module 'stripe' { amount_paid: number; /** - * The amount remaining, in %s, that is due. + * The difference between amount_due and amount_paid, in %s. */ amount_remaining: number; @@ -1162,7 +1162,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; } @@ -1503,7 +1503,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; } @@ -1732,11 +1732,7 @@ declare module 'stripe' { >; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - * - * Prorations can be disabled by passing `none`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. */ subscription_proration_behavior?: InvoiceRetrieveUpcomingParams.SubscriptionProrationBehavior; diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 89ef100193..69aee0bf0f 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -3196,7 +3196,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; @@ -4831,7 +4831,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; @@ -6601,7 +6601,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index 2528a40749..c097a0ff0b 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -734,7 +734,7 @@ declare module 'stripe' { /** * Contains information about US bank account networks that can be used. */ - networks?: UsBankAccount.Networks | null; + networks: UsBankAccount.Networks | null; /** * Routing number of the bank account. diff --git a/types/2020-08-27/SetupAttempts.d.ts b/types/2020-08-27/SetupAttempts.d.ts index 65145527ad..574d2155aa 100644 --- a/types/2020-08-27/SetupAttempts.d.ts +++ b/types/2020-08-27/SetupAttempts.d.ts @@ -21,6 +21,13 @@ declare module 'stripe' { */ application: string | Stripe.Application | null; + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + /** * Time at which the object was created. Measured in seconds since the Unix epoch. */ @@ -31,6 +38,13 @@ declare module 'stripe' { */ customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; + /** + * Indicates the directions of money movement for which this payment method is intended to be used. + * + * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + */ + flow_directions: Array | null; + /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ @@ -70,6 +84,8 @@ declare module 'stripe' { } namespace SetupAttempt { + type FlowDirection = 'inbound' | 'outbound'; + interface PaymentMethodDetails { acss_debit?: PaymentMethodDetails.AcssDebit; diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2020-08-27/SetupIntents.d.ts index 708a19e526..6af1f2f0c7 100644 --- a/types/2020-08-27/SetupIntents.d.ts +++ b/types/2020-08-27/SetupIntents.d.ts @@ -62,7 +62,7 @@ declare module 'stripe' { * * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. */ - flow_directions?: Array | null; + flow_directions: Array | null; /** * The error encountered in the previous SetupIntent confirmation. @@ -513,6 +513,13 @@ declare module 'stripe' { } interface SetupIntentCreateParams { + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + /** * Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required. */ @@ -535,6 +542,13 @@ declare module 'stripe' { */ expand?: Array; + /** + * Indicates the directions of money movement for which this payment method is intended to be used. + * + * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + */ + flow_directions?: Array; + /** * This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). */ @@ -588,6 +602,8 @@ declare module 'stripe' { } namespace SetupIntentCreateParams { + type FlowDirection = 'inbound' | 'outbound'; + interface MandateData { /** * This hash contains details about the customer acceptance of the Mandate. @@ -1342,7 +1358,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; @@ -1403,6 +1419,13 @@ declare module 'stripe' { } interface SetupIntentUpdateParams { + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + /** * ID of the Customer this SetupIntent belongs to, if one exists. * @@ -1420,6 +1443,13 @@ declare module 'stripe' { */ expand?: Array; + /** + * Indicates the directions of money movement for which this payment method is intended to be used. + * + * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + */ + flow_directions?: Array; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -1448,6 +1478,8 @@ declare module 'stripe' { } namespace SetupIntentUpdateParams { + type FlowDirection = 'inbound' | 'outbound'; + interface PaymentMethodData { /** * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. @@ -2153,7 +2185,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; @@ -2188,6 +2220,13 @@ declare module 'stripe' { } interface SetupIntentListParams extends PaginationParams { + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + /** * A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. */ @@ -3055,7 +3094,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; diff --git a/types/2020-08-27/SubscriptionItems.d.ts b/types/2020-08-27/SubscriptionItems.d.ts index 48455bb53c..d94a851fbb 100644 --- a/types/2020-08-27/SubscriptionItems.d.ts +++ b/types/2020-08-27/SubscriptionItems.d.ts @@ -150,11 +150,7 @@ declare module 'stripe' { price_data?: SubscriptionItemCreateParams.PriceData; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - * - * Prorations can be disabled by passing `none`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. */ proration_behavior?: SubscriptionItemCreateParams.ProrationBehavior; @@ -300,11 +296,7 @@ declare module 'stripe' { price_data?: SubscriptionItemUpdateParams.PriceData; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - * - * Prorations can be disabled by passing `none`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. */ proration_behavior?: SubscriptionItemUpdateParams.ProrationBehavior; @@ -412,11 +404,7 @@ declare module 'stripe' { clear_usage?: boolean; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - * - * Prorations can be disabled by passing `none`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. */ proration_behavior?: SubscriptionItemDeleteParams.ProrationBehavior; diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index f5fef27758..5ddd032b8b 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -33,7 +33,7 @@ declare module 'stripe' { automatic_tax: Subscription.AutomaticTax; /** - * Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + * Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. */ billing_cycle_anchor: number; @@ -458,7 +458,7 @@ declare module 'stripe' { interface PendingUpdate { /** - * If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + * If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. */ billing_cycle_anchor: number | null; @@ -532,7 +532,7 @@ declare module 'stripe' { backdate_start_date?: number; /** - * A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + * A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. */ billing_cycle_anchor?: number; @@ -637,9 +637,7 @@ declare module 'stripe' { promotion_code?: string; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. Valid values are `create_prorations` or `none`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. Prorations can be disabled by passing `none`. If no value is passed, the default is `create_prorations`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. */ proration_behavior?: SubscriptionCreateParams.ProrationBehavior; @@ -1015,7 +1013,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; } @@ -1113,7 +1111,7 @@ declare module 'stripe' { automatic_tax?: SubscriptionUpdateParams.AutomaticTax; /** - * Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + * Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). */ billing_cycle_anchor?: SubscriptionUpdateParams.BillingCycleAnchor; @@ -1225,11 +1223,7 @@ declare module 'stripe' { promotion_code?: string; /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`. - * - * Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. - * - * Prorations can be disabled by passing `none`. + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. */ proration_behavior?: SubscriptionUpdateParams.ProrationBehavior; @@ -1638,7 +1632,7 @@ declare module 'stripe' { namespace UsBankAccount { interface FinancialConnections { /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`. + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. */ permissions?: Array; } diff --git a/types/2020-08-27/Treasury/ReceivedDebits.d.ts b/types/2020-08-27/Treasury/ReceivedDebits.d.ts index 38a8d44493..7824a0a815 100644 --- a/types/2020-08-27/Treasury/ReceivedDebits.d.ts +++ b/types/2020-08-27/Treasury/ReceivedDebits.d.ts @@ -161,7 +161,7 @@ declare module 'stripe' { inbound_transfer: string | null; /** - * Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + * Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. */ issuing_authorization: string | null; From e0fe7f8473a9d2e5c893464c8bb97c6c57ffec8b Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Wed, 8 Jun 2022 11:54:47 -0400 Subject: [PATCH 24/25] Add test for cash balance methods. (#1438) From e393e1e9e94675650680c977c33de5830464c42a Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 8 Jun 2022 09:11:27 -0700 Subject: [PATCH 25/25] Bump version to 9.7.0 --- CHANGELOG.md | 85 +++++++++++++++++++++++++++++----------------------- VERSION | 2 +- package.json | 2 +- 3 files changed, 49 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bef758ba13..73b6769b63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,26 +1,35 @@ # CHANGELOG +## 9.7.0 - 2022-06-08 +* [#1441](https://github.com/stripe/stripe-node/pull/1441) API Updates + * Add support for `affirm`, `bancontact`, `card`, `ideal`, `p24`, and `sofort` on `Checkout.Session.payment_method_options` and `CheckoutSessionCreateParams.payment_method_options` + * Add support for `afterpay_clearpay`, `au_becs_debit`, `bacs_debit`, `eps`, `fpx`, `giropay`, `grabpay`, `klarna`, `paynow`, and `sepa_debit` on `CheckoutSessionCreateParams.payment_method_options` + * Add support for `setup_future_usage` on `Checkout.Session.payment_method_options.*` and `CheckoutSessionCreateParams.payment_method_options.*`, + * Change `PaymentMethod.us_bank_account.networks` and `SetupIntent.flow_directions` to be required + * Add support for `attach_to_self` on `SetupAttempt`, `SetupIntentCreateParams`, `SetupIntentListParams`, and `SetupIntentUpdateParams` + * Add support for `flow_directions` on `SetupAttempt`, `SetupIntentCreateParams`, and `SetupIntentUpdateParams` + ## 9.6.0 - 2022-06-01 * [#1439](https://github.com/stripe/stripe-node/pull/1439) API Updates - * Add support for `radar_options` on `ChargeCreateParams`, `Charge`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` - * Add support for `account_holder_name`, `account_number`, `account_type`, `bank_code`, `bank_name`, `branch_code`, and `branch_name` on `FundingInstructions.bank_transfer.financial_addresses[].zengin` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].zengin` - * Add support for new values `en-AU` and `en-NZ` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale` - * Change type of `Order.payment.settings.payment_method_options.customer_balance.bank_transfer.type` and `PaymentIntent.payment_method_options.customer_balance.bank_transfer.type` from `enum` to `literal('jp_bank_transfer')` - * This is technically breaking in Typescript, but now accurately represents the behavior that was allowed by the server. We haven't historically treated breaking Typescript changes as requiring a major. - * Change `PaymentIntent.next_action.display_bank_transfer_instructions.hosted_instructions_url` to be required - * Add support for `network` on `SetupIntent.payment_method_options.card` - * Add support for new value `simulated_wisepos_e` on enums `Terminal.Reader.device_type` and `TerminalReaderListParams.device_type` - + * Add support for `radar_options` on `ChargeCreateParams`, `Charge`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` + * Add support for `account_holder_name`, `account_number`, `account_type`, `bank_code`, `bank_name`, `branch_code`, and `branch_name` on `FundingInstructions.bank_transfer.financial_addresses[].zengin` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].zengin` + * Add support for new values `en-AU` and `en-NZ` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale` + * Change type of `Order.payment.settings.payment_method_options.customer_balance.bank_transfer.type` and `PaymentIntent.payment_method_options.customer_balance.bank_transfer.type` from `enum` to `literal('jp_bank_transfer')` + * This is technically breaking in Typescript, but now accurately represents the behavior that was allowed by the server. We haven't historically treated breaking Typescript changes as requiring a major. + * Change `PaymentIntent.next_action.display_bank_transfer_instructions.hosted_instructions_url` to be required + * Add support for `network` on `SetupIntent.payment_method_options.card` + * Add support for new value `simulated_wisepos_e` on enums `Terminal.Reader.device_type` and `TerminalReaderListParams.device_type` + ## 9.5.0 - 2022-05-26 * [#1434](https://github.com/stripe/stripe-node/pull/1434) API Updates - * Add support for `affirm_payments` and `link_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` - * Add support for `id_number_secondary` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person` - * Add support for new value `affirm` on enum `CheckoutSessionCreateParams.payment_method_types[]` - * Add support for `hosted_instructions_url` on `PaymentIntent.next_action.display_bank_transfer_instructions` - * Add support for `id_number_secondary_provided` on `Person` - * Add support for `card_issuing` on `TreasuryFinancialAccountCreateParams.features`, `TreasuryFinancialAccountUpdateFeaturesParams`, and `TreasuryFinancialAccountUpdateParams.features` - + * Add support for `affirm_payments` and `link_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` + * Add support for `id_number_secondary` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person` + * Add support for new value `affirm` on enum `CheckoutSessionCreateParams.payment_method_types[]` + * Add support for `hosted_instructions_url` on `PaymentIntent.next_action.display_bank_transfer_instructions` + * Add support for `id_number_secondary_provided` on `Person` + * Add support for `card_issuing` on `TreasuryFinancialAccountCreateParams.features`, `TreasuryFinancialAccountUpdateFeaturesParams`, and `TreasuryFinancialAccountUpdateParams.features` + * [#1432](https://github.com/stripe/stripe-node/pull/1432) docs: Update HttpClient documentation to remove experimental status. ## 9.4.0 - 2022-05-23 @@ -41,18 +50,18 @@ ## 9.2.0 - 2022-05-19 * [#1422](https://github.com/stripe/stripe-node/pull/1422) API Updates * Add support for new `Treasury` APIs: `CreditReversal`, `DebitReversal`, `FinancialAccountFeatures`, `FinancialAccount`, `FlowDetails`, `InboundTransfer`, `OutboundPayment`, `OutboundTransfer`, `ReceivedCredit`, `ReceivedDebit`, `TransactionEntry`, and `Transaction` - * Add support for `treasury` on `Issuing.Authorization`, `Issuing.Dispute`, `Issuing.Transaction`, and `IssuingDisputeCreateParams` + * Add support for `treasury` on `Issuing.Authorization`, `Issuing.Dispute`, `Issuing.Transaction`, and `IssuingDisputeCreateParams` * Add support for `retrieve_payment_method` method on resource `Customer` - * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account` - * Change `BillingPortalConfigurationCreateParams.features.customer_update.allowed_updates` to be optional - * Change type of `BillingPortal.Session.return_url` from `string` to `nullable(string)` - * Add support for `afterpay_clearpay`, `au_becs_debit`, `bacs_debit`, `eps`, `fpx`, `giropay`, `grabpay`, `klarna`, `paynow`, and `sepa_debit` on `Checkout.Session.payment_method_options` - * Add support for `financial_account` on `Issuing.Card` and `IssuingCardCreateParams` - * Add support for `client_secret` on `Order` - * Add support for `networks` on `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `PaymentMethod.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, and `SetupIntentUpdateParams.payment_method_options.us_bank_account` - * Add support for `attach_to_self` and `flow_directions` on `SetupIntent` - * Add support for `save_default_payment_method` on `Subscription.payment_settings`, `SubscriptionCreateParams.payment_settings`, and `SubscriptionUpdateParams.payment_settings` - * Add support for `czk` on `Terminal.Configuration.tipping`, `TerminalConfigurationCreateParams.tipping`, and `TerminalConfigurationUpdateParams.tipping` + * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account` + * Change `BillingPortalConfigurationCreateParams.features.customer_update.allowed_updates` to be optional + * Change type of `BillingPortal.Session.return_url` from `string` to `nullable(string)` + * Add support for `afterpay_clearpay`, `au_becs_debit`, `bacs_debit`, `eps`, `fpx`, `giropay`, `grabpay`, `klarna`, `paynow`, and `sepa_debit` on `Checkout.Session.payment_method_options` + * Add support for `financial_account` on `Issuing.Card` and `IssuingCardCreateParams` + * Add support for `client_secret` on `Order` + * Add support for `networks` on `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `PaymentMethod.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, and `SetupIntentUpdateParams.payment_method_options.us_bank_account` + * Add support for `attach_to_self` and `flow_directions` on `SetupIntent` + * Add support for `save_default_payment_method` on `Subscription.payment_settings`, `SubscriptionCreateParams.payment_settings`, and `SubscriptionUpdateParams.payment_settings` + * Add support for `czk` on `Terminal.Configuration.tipping`, `TerminalConfigurationCreateParams.tipping`, and `TerminalConfigurationUpdateParams.tipping` ## 9.1.0 - 2022-05-11 * [#1420](https://github.com/stripe/stripe-node/pull/1420) API Updates @@ -67,28 +76,28 @@ Major version release - The [migration guide](https://github.com/stripe/stripe-n (⚠️ = breaking changes): * ⚠️[#1336](https://github.com/stripe/stripe-node/pull/1336) feat(http-client): retry closed connection errors * [#1415](https://github.com/stripe/stripe-node/pull/1415) [#1417](https://github.com/stripe/stripe-node/pull/1417) API Updates - * ⚠️ Replace the legacy `Order` API with the new `Order` API. + * ⚠️ Replace the legacy `Order` API with the new `Order` API. * Resource modified: `Order`. * New methods: `cancel`, `list_line_items`, `reopen`, and `submit` * Removed methods: `pay` and `return_order` * Removed resources: `OrderItem` and `OrderReturn` * Removed references from other resources: `Charge.order` - * Add support for `amount_discount`, `amount_tax`, and `product` on `LineItem` + * Add support for `amount_discount`, `amount_tax`, and `product` on `LineItem` * Change type of `Charge.shipping.name`, `Checkout.Session.shipping.name`, `Customer.shipping.name`, `Invoice.customer_shipping.name`, `PaymentIntent.shipping.name`, `ShippingDetails.name`, and `Source.source_order.shipping.name` from `nullable(string)` to `string` ## 8.222.0 - 2022-05-05 * [#1414](https://github.com/stripe/stripe-node/pull/1414) API Updates - * Add support for `default_price_data` on `ProductCreateParams` - * Add support for `default_price` on `ProductUpdateParams` and `Product` - * Add support for `instructions_email` on `RefundCreateParams` and `Refund` - + * Add support for `default_price_data` on `ProductCreateParams` + * Add support for `default_price` on `ProductUpdateParams` and `Product` + * Add support for `instructions_email` on `RefundCreateParams` and `Refund` + ## 8.221.0 - 2022-05-05 * [#1413](https://github.com/stripe/stripe-node/pull/1413) API Updates - * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` - * Add support for `financial_connections` on `Checkout.Session.payment_method_options.us_bank_account`, `CheckoutSessionCreateParams.payment_method_options.us_bank_account`, `Invoice.payment_settings.payment_method_options.us_bank_account`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account`, `PaymentIntent.payment_method_options.us_bank_account`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `SetupIntent.payment_method_options.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, `SetupIntentUpdateParams.payment_method_options.us_bank_account`, `Subscription.payment_settings.payment_method_options.us_bank_account`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account` - * Add support for `financial_connections_account` on `PaymentIntentConfirmParams.payment_method_data.us_bank_account`, `PaymentIntentCreateParams.payment_method_data.us_bank_account`, `PaymentIntentUpdateParams.payment_method_data.us_bank_account`, `PaymentMethod.us_bank_account`, `PaymentMethodCreateParams.us_bank_account`, `SetupIntentConfirmParams.payment_method_data.us_bank_account`, `SetupIntentCreateParams.payment_method_data.us_bank_account`, and `SetupIntentUpdateParams.payment_method_data.us_bank_account` - + * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` + * Add support for `financial_connections` on `Checkout.Session.payment_method_options.us_bank_account`, `CheckoutSessionCreateParams.payment_method_options.us_bank_account`, `Invoice.payment_settings.payment_method_options.us_bank_account`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account`, `PaymentIntent.payment_method_options.us_bank_account`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `SetupIntent.payment_method_options.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, `SetupIntentUpdateParams.payment_method_options.us_bank_account`, `Subscription.payment_settings.payment_method_options.us_bank_account`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account` + * Add support for `financial_connections_account` on `PaymentIntentConfirmParams.payment_method_data.us_bank_account`, `PaymentIntentCreateParams.payment_method_data.us_bank_account`, `PaymentIntentUpdateParams.payment_method_data.us_bank_account`, `PaymentMethod.us_bank_account`, `PaymentMethodCreateParams.us_bank_account`, `SetupIntentConfirmParams.payment_method_data.us_bank_account`, `SetupIntentCreateParams.payment_method_data.us_bank_account`, and `SetupIntentUpdateParams.payment_method_data.us_bank_account` + * [#1410](https://github.com/stripe/stripe-node/pull/1410) API Updates * Add support for `registered_address` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `Person`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person` * Change type of `PaymentIntent.amount_details.tip.amount` from `nullable(integer)` to `integer` @@ -146,7 +155,7 @@ Major version release - The [migration guide](https://github.com/stripe/stripe-n * Add support for new value `customer_balance` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]` * Add support for `request_extended_authorization` on `PaymentIntent.payment_method_options.card_present`, `PaymentIntentConfirmParams.payment_method_options.card_present`, `PaymentIntentCreateParams.payment_method_options.card_present`, and `PaymentIntentUpdateParams.payment_method_options.card_present` * Add support for new values `payment_intent.partially_funded`, `terminal.reader.action_failed`, and `terminal.reader.action_succeeded` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` - + * [#1388](https://github.com/stripe/stripe-node/pull/1388) Stop sending Content-Length header for verbs which don't have bodies. * Fixes https://github.com/stripe/stripe-node/issues/1360. diff --git a/VERSION b/VERSION index 7b0680f4e2..a458a24cc2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.6.0 +9.7.0 diff --git a/package.json b/package.json index 2778d0e339..ed84c564e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "9.6.0", + "version": "9.7.0", "description": "Stripe API wrapper", "keywords": [ "stripe",