diff --git a/CHANGELOG.md b/CHANGELOG.md index f8a511f422..25de992c96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 9.12.0 - 2022-07-07 +* [#1468](https://github.com/stripe/stripe-node/pull/1468) API Updates + * Add support for `currency` on `CheckoutSessionCreateParams`, `InvoiceUpcomingLinesParams`, `InvoiceUpcomingParams`, `PaymentLinkCreateParams`, `SubscriptionCreateParams`, `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.phases[]`, `SubscriptionScheduleUpdateParams.phases[]`, and `Subscription` + * Add support for `currency_options` on `CheckoutSessionCreateParams.shipping_options[].shipping_rate_data.fixed_amount`, `CouponCreateParams`, `CouponUpdateParams`, `Coupon`, `OrderCreateParams.shipping_cost.shipping_rate_data.fixed_amount`, `OrderUpdateParams.shipping_cost.shipping_rate_data.fixed_amount`, `PriceCreateParams`, `PriceUpdateParams`, `Price`, `ProductCreateParams.default_price_data`, `PromotionCode.restrictions`, `PromotionCodeCreateParams.restrictions`, `ShippingRate.fixed_amount`, and `ShippingRateCreateParams.fixed_amount` + * Add support for `restrictions` on `PromotionCodeUpdateParams` + * Add support for `fixed_amount` and `tax_behavior` on `ShippingRateUpdateParams` +* [#1467](https://github.com/stripe/stripe-node/pull/1467) API Updates + * Add support for `customer` on `CheckoutSessionListParams` and `RefundCreateParams` + * Add support for `currency` and `origin` on `RefundCreateParams` + * Add support for new values `financial_connections.account.created`, `financial_connections.account.deactivated`, `financial_connections.account.disconnected`, `financial_connections.account.reactivated`, and `financial_connections.account.refreshed_balance` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` + ## 9.11.0 - 2022-06-29 * [#1462](https://github.com/stripe/stripe-node/pull/1462) API Updates * Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card` diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 515f433c0c..1f7b99f730 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v161 \ No newline at end of file +v163 \ No newline at end of file diff --git a/lib/apiVersion.js b/lib/apiVersion.js index e8515c3cd4..b2629c57a1 100644 --- a/lib/apiVersion.js +++ b/lib/apiVersion.js @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec -module.exports = {ApiVersion: '2020-08-27'}; +module.exports = {ApiVersion: '2020-08-27; server_side_confirmation_beta=v1'}; diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 719357dbdb..a04f41c00a 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -486,6 +486,56 @@ describe('PaymentLink', function() { }); }); +describe('Price', function() { + it('create method', async function() { + const price = await stripe.prices.create({ + unit_amount: 2000, + currency: 'usd', + currency_options: { + uah: {unit_amount: 5000}, + eur: {unit_amount: 1800}, + }, + recurring: {interval: 'month'}, + product: 'prod_xxxxxxxxxxxxx', + }); + expect(price).not.to.be.null; + }); + + it('list method', async function() { + const prices = await stripe.prices.list({limit: 3}); + expect(prices).not.to.be.null; + }); + + 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 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('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('SetupAttempt', function() { it('list method', async function() { const setupAttempts = await stripe.setupAttempts.list({ @@ -2005,42 +2055,6 @@ describe('Plan', function() { }); }); -describe('Price', function() { - it('list method', async function() { - const prices = await stripe.prices.list({limit: 3}); - expect(prices).not.to.be.null; - }); - - 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 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('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('Product', function() { it('list method', async function() { const products = await stripe.products.list({limit: 3}); diff --git a/types/2020-08-27/CashBalances.d.ts b/types/2020-08-27/CashBalances.d.ts index cf7afa1b89..d2729b6a70 100644 --- a/types/2020-08-27/CashBalances.d.ts +++ b/types/2020-08-27/CashBalances.d.ts @@ -12,7 +12,7 @@ declare module 'stripe' { object: 'cash_balance'; /** - * A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. + * A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). */ available: { [key: string]: number; @@ -57,20 +57,16 @@ declare module 'stripe' { */ expand?: Array; + /** + * A hash of settings for this cash balance. + */ settings?: CashBalanceUpdateParams.Settings; } namespace CashBalanceUpdateParams { interface Settings { /** - * Method for using the customer balance to pay outstanding - * `customer_balance` PaymentIntents. If set to `automatic`, all available - * funds will automatically be used to pay any outstanding PaymentIntent. - * If set to `manual`, only customer balance funds from bank transfers - * with a reference code matching - * `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - * automatically be used to pay the corresponding outstanding - * PaymentIntent. + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). */ reconciliation_mode?: Settings.ReconciliationMode; } diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index fda304a7f6..fedb4b03b7 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -303,33 +303,33 @@ declare module 'stripe' { interface CustomerDetails { /** - * The customer's address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. + * The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. */ address: Stripe.Address | null; /** - * The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry. + * The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. * Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. */ email: string | null; /** - * The customer's name at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. + * The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. */ name: string | null; /** - * The customer's phone number at the time of checkout + * The customer's phone number after a completed Checkout Session. */ phone: string | null; /** - * The customer's tax exempt status at time of checkout. + * The customer's tax exempt status after a completed Checkout Session. */ tax_exempt: CustomerDetails.TaxExempt | null; /** - * The customer's tax IDs at time of checkout. + * The customer's tax IDs after a completed Checkout Session. */ tax_ids: Array | null; } @@ -1283,6 +1283,11 @@ declare module 'stripe' { */ consent_collection?: SessionCreateParams.ConsentCollection; + /** + * 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 an existing Customer, if one exists. In `payment` mode, the customer's most recent card * payment method will be used to prefill the email, name, card details, and billing address @@ -2792,6 +2797,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -2907,6 +2937,11 @@ declare module 'stripe' { } interface SessionListParams extends PaginationParams { + /** + * Only return the Checkout Sessions for the Customer specified. + */ + customer?: string; + /** * Specifies which fields in the response should be expanded. */ diff --git a/types/2020-08-27/Coupons.d.ts b/types/2020-08-27/Coupons.d.ts index 8b9ed35837..0b88c6ad75 100644 --- a/types/2020-08-27/Coupons.d.ts +++ b/types/2020-08-27/Coupons.d.ts @@ -33,6 +33,13 @@ declare module 'stripe' { */ currency: string | null; + /** + * Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Coupon.CurrencyOptions; + }; + deleted?: void; /** @@ -94,6 +101,13 @@ declare module 'stripe' { products: Array; } + interface CurrencyOptions { + /** + * Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + */ + amount_off: number; + } + type Duration = 'forever' | 'once' | 'repeating'; } @@ -133,6 +147,13 @@ declare module 'stripe' { */ currency?: string; + /** + * Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: CouponCreateParams.CurrencyOptions; + }; + /** * Specifies how long the discount will be in effect if used on a subscription. Can be `forever`, `once`, or `repeating`. Defaults to `once`. */ @@ -187,6 +208,13 @@ declare module 'stripe' { products?: Array; } + interface CurrencyOptions { + /** + * A positive integer representing the amount to subtract from an invoice total. + */ + amount_off: number; + } + type Duration = 'forever' | 'once' | 'repeating'; } @@ -198,6 +226,13 @@ declare module 'stripe' { } interface CouponUpdateParams { + /** + * Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: CouponUpdateParams.CurrencyOptions; + }; + /** * Specifies which fields in the response should be expanded. */ @@ -214,6 +249,15 @@ declare module 'stripe' { name?: string; } + namespace CouponUpdateParams { + interface CurrencyOptions { + /** + * A positive integer representing the amount to subtract from an invoice total. + */ + amount_off: number; + } + } + interface CouponListParams extends PaginationParams { /** * 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. diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index e3391d4b0a..936a734edc 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -398,14 +398,7 @@ declare module 'stripe' { namespace CashBalance { interface Settings { /** - * Method for using the customer balance to pay outstanding - * `customer_balance` PaymentIntents. If set to `automatic`, all available - * funds will automatically be used to pay any outstanding PaymentIntent. - * If set to `manual`, only customer balance funds from bank transfers - * with a reference code matching - * `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - * automatically be used to pay the corresponding outstanding - * PaymentIntent. + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). */ reconciliation_mode?: Settings.ReconciliationMode; } @@ -683,14 +676,7 @@ declare module 'stripe' { namespace CashBalance { interface Settings { /** - * Method for using the customer balance to pay outstanding - * `customer_balance` PaymentIntents. If set to `automatic`, all available - * funds will automatically be used to pay any outstanding PaymentIntent. - * If set to `manual`, only customer balance funds from bank transfers - * with a reference code matching - * `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - * automatically be used to pay the corresponding outstanding - * PaymentIntent. + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). */ reconciliation_mode?: Settings.ReconciliationMode; } @@ -1068,7 +1054,7 @@ declare module 'stripe' { ): Promise>; /** - * Updates a customer's cash balance. + * Changes the settings on a customer's cash balance. */ updateCashBalance( id: string, diff --git a/types/2020-08-27/InvoiceLineItems.d.ts b/types/2020-08-27/InvoiceLineItems.d.ts index bd9b4894e9..a4678a8df6 100644 --- a/types/2020-08-27/InvoiceLineItems.d.ts +++ b/types/2020-08-27/InvoiceLineItems.d.ts @@ -208,6 +208,11 @@ declare module 'stripe' { */ coupon?: string; + /** + * The currency to preview this invoice in. Defaults to that of `customer` if not specified. + */ + currency?: string; + /** * The identifier of the customer whose upcoming invoice you'd like to retrieve. */ diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index 6515825750..72f6815b76 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -1768,6 +1768,11 @@ declare module 'stripe' { */ coupon?: string; + /** + * The currency to preview this invoice in. Defaults to that of `customer` if not specified. + */ + currency?: string; + /** * The identifier of the customer whose upcoming invoice you'd like to retrieve. */ diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index 20bd28ee01..0c50c5f898 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -1817,6 +1817,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -2865,6 +2890,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index e03fb46815..5dbe8b10cf 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -163,6 +163,11 @@ declare module 'stripe' { */ review: string | Stripe.Review | null; + /** + * Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + */ + secret_key_confirmation?: PaymentIntent.SecretKeyConfirmation; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -1683,6 +1688,8 @@ declare module 'stripe' { } } + type SecretKeyConfirmation = 'optional' | 'required'; + type SetupFutureUsage = 'off_session' | 'on_session'; interface Shipping { @@ -1854,6 +1861,11 @@ declare module 'stripe' { */ return_url?: string; + /** + * Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + */ + secret_key_confirmation?: PaymentIntentCreateParams.SecretKeyConfirmation; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -3477,6 +3489,8 @@ declare module 'stripe' { session?: string; } + type SecretKeyConfirmation = 'optional' | 'required'; + type SetupFutureUsage = 'off_session' | 'on_session'; interface Shipping { @@ -3586,6 +3600,11 @@ declare module 'stripe' { */ expand?: Array; + /** + * This hash contains details about the Mandate to create. + */ + mandate_data?: PaymentIntentUpdateParams.MandateData; + /** * 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`. */ @@ -3660,6 +3679,41 @@ declare module 'stripe' { namespace PaymentIntentUpdateParams { type CaptureMethod = 'automatic' | 'manual'; + interface MandateData { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData.CustomerAcceptance; + } + + namespace MandateData { + interface CustomerAcceptance { + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. + */ + type: 'online'; + } + + namespace CustomerAcceptance { + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address?: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent?: string; + } + } + } + interface PaymentMethodData { /** * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. @@ -5318,6 +5372,11 @@ declare module 'stripe' { } interface PaymentIntentConfirmParams { + /** + * 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. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + application_fee_amount?: Stripe.Emptyable; + /** * Controls when the funds will be captured from the customer's account. */ diff --git a/types/2020-08-27/PaymentLinks.d.ts b/types/2020-08-27/PaymentLinks.d.ts index d4f813438d..0150b7feda 100644 --- a/types/2020-08-27/PaymentLinks.d.ts +++ b/types/2020-08-27/PaymentLinks.d.ts @@ -548,6 +548,11 @@ declare module 'stripe' { */ consent_collection?: PaymentLinkCreateParams.ConsentCollection; + /** + * 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) and supported by each line item's price. + */ + currency?: string; + /** * 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). */ @@ -596,7 +601,7 @@ declare module 'stripe' { shipping_options?: Array; /** - * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. + * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). */ submit_type?: PaymentLinkCreateParams.SubmitType; diff --git a/types/2020-08-27/Prices.d.ts b/types/2020-08-27/Prices.d.ts index 18df63728e..4ee68ec509 100644 --- a/types/2020-08-27/Prices.d.ts +++ b/types/2020-08-27/Prices.d.ts @@ -36,6 +36,13 @@ declare module 'stripe' { */ currency: string; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Price.CurrencyOptions; + }; + /** * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. */ @@ -112,6 +119,81 @@ declare module 'stripe' { namespace Price { type BillingScheme = 'per_unit' | 'tiered'; + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount: CurrencyOptions.CustomUnitAmount | null; + + /** + * 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: CurrencyOptions.TaxBehavior | null; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + */ + unit_amount: number | null; + + /** + * The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + */ + unit_amount_decimal: string | null; + } + + namespace CurrencyOptions { + interface CustomUnitAmount { + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum: number | null; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum: number | null; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset: number | null; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * Price for the entire tier. + */ + flat_amount: number | null; + + /** + * Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + */ + flat_amount_decimal: string | null; + + /** + * Per unit price for units relevant to the tier. + */ + unit_amount: number | null; + + /** + * Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + */ + unit_amount_decimal: string | null; + + /** + * Up to and including to this quantity will be contained in the tier. + */ + up_to: number | null; + } + } + interface CustomUnitAmount { /** * The maximum unit amount the customer can specify for this item. @@ -254,6 +336,13 @@ declare module 'stripe' { */ billing_scheme?: PriceCreateParams.BillingScheme; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: PriceCreateParams.CurrencyOptions; + }; + /** * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. */ @@ -333,6 +422,86 @@ declare module 'stripe' { namespace PriceCreateParams { type BillingScheme = 'per_unit' | 'tiered'; + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount?: CurrencyOptions.CustomUnitAmount; + + /** + * 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?: CurrencyOptions.TaxBehavior; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * 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 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; + } + + namespace CurrencyOptions { + interface CustomUnitAmount { + /** + * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + */ + enabled: boolean; + + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum?: number; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum?: number; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * The flat billing amount for an entire tier, regardless of the number of units in the tier. + */ + flat_amount?: number; + + /** + * Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + */ + flat_amount_decimal?: string; + + /** + * The per unit billing amount for each individual unit for which this tier applies. + */ + unit_amount?: number; + + /** + * 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; + + /** + * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + */ + up_to: 'inf' | number; + } + } + interface CustomUnitAmount { /** * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. @@ -494,6 +663,13 @@ declare module 'stripe' { */ active?: boolean; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: Stripe.Emptyable<{ + [key: string]: PriceUpdateParams.CurrencyOptions; + }>; + /** * Specifies which fields in the response should be expanded. */ @@ -531,6 +707,86 @@ declare module 'stripe' { } namespace PriceUpdateParams { + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount?: CurrencyOptions.CustomUnitAmount; + + /** + * 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?: CurrencyOptions.TaxBehavior; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * 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 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; + } + + namespace CurrencyOptions { + interface CustomUnitAmount { + /** + * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + */ + enabled: boolean; + + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum?: number; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum?: number; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * The flat billing amount for an entire tier, regardless of the number of units in the tier. + */ + flat_amount?: number; + + /** + * Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + */ + flat_amount_decimal?: string; + + /** + * The per unit billing amount for each individual unit for which this tier applies. + */ + unit_amount?: number; + + /** + * 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; + + /** + * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + */ + up_to: 'inf' | number; + } + } + interface Recurring { /** * Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). diff --git a/types/2020-08-27/Products.d.ts b/types/2020-08-27/Products.d.ts index d896c0c276..eefbd67b7a 100644 --- a/types/2020-08-27/Products.d.ts +++ b/types/2020-08-27/Products.d.ts @@ -262,6 +262,13 @@ declare module 'stripe' { */ currency: string; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: DefaultPriceData.CurrencyOptions; + }; + /** * The recurring components of a price such as `interval` and `interval_count`. */ @@ -284,6 +291,86 @@ declare module 'stripe' { } namespace DefaultPriceData { + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount?: CurrencyOptions.CustomUnitAmount; + + /** + * 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?: CurrencyOptions.TaxBehavior; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * 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 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; + } + + namespace CurrencyOptions { + interface CustomUnitAmount { + /** + * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + */ + enabled: boolean; + + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum?: number; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum?: number; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * The flat billing amount for an entire tier, regardless of the number of units in the tier. + */ + flat_amount?: number; + + /** + * Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + */ + flat_amount_decimal?: string; + + /** + * The per unit billing amount for each individual unit for which this tier applies. + */ + unit_amount?: number; + + /** + * 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; + + /** + * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + */ + up_to: 'inf' | number; + } + } + interface Recurring { /** * Specifies billing frequency. Either `day`, `week`, `month` or `year`. diff --git a/types/2020-08-27/PromotionCodes.d.ts b/types/2020-08-27/PromotionCodes.d.ts index 3b22639eff..ba1e241893 100644 --- a/types/2020-08-27/PromotionCodes.d.ts +++ b/types/2020-08-27/PromotionCodes.d.ts @@ -73,6 +73,13 @@ declare module 'stripe' { namespace PromotionCode { interface Restrictions { + /** + * Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Restrictions.CurrencyOptions; + }; + /** * A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices */ @@ -88,6 +95,15 @@ declare module 'stripe' { */ minimum_amount_currency: string | null; } + + namespace Restrictions { + interface CurrencyOptions { + /** + * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + */ + minimum_amount: number; + } + } } interface PromotionCodeCreateParams { @@ -139,6 +155,13 @@ declare module 'stripe' { namespace PromotionCodeCreateParams { interface Restrictions { + /** + * Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Restrictions.CurrencyOptions; + }; + /** * A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices */ @@ -154,6 +177,15 @@ declare module 'stripe' { */ minimum_amount_currency?: string; } + + namespace Restrictions { + interface CurrencyOptions { + /** + * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + */ + minimum_amount?: number; + } + } } interface PromotionCodeRetrieveParams { @@ -178,6 +210,31 @@ declare module 'stripe' { * 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; + + /** + * Settings that restrict the redemption of the promotion code. + */ + restrictions?: PromotionCodeUpdateParams.Restrictions; + } + + namespace PromotionCodeUpdateParams { + interface Restrictions { + /** + * Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Restrictions.CurrencyOptions; + }; + } + + namespace Restrictions { + interface CurrencyOptions { + /** + * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + */ + minimum_amount?: number; + } + } } interface PromotionCodeListParams extends PaginationParams { diff --git a/types/2020-08-27/Refunds.d.ts b/types/2020-08-27/Refunds.d.ts index 5e85fd749b..03af79b646 100644 --- a/types/2020-08-27/Refunds.d.ts +++ b/types/2020-08-27/Refunds.d.ts @@ -145,15 +145,31 @@ declare module 'stripe' { } interface RefundCreateParams { + /** + * A positive integer representing how much to refund. + */ amount?: number; charge?: string; + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + + /** + * Customer whose customer balance to refund from. + */ + customer?: string; + /** * Specifies which fields in the response should be expanded. */ expand?: Array; + /** + * Address to send refund email, use customer email if not specified + */ instructions_email?: string; /** @@ -161,6 +177,11 @@ declare module 'stripe' { */ metadata?: Stripe.Emptyable; + /** + * Origin of the refund + */ + origin?: 'customer_balance'; + payment_intent?: string; reason?: RefundCreateParams.Reason; diff --git a/types/2020-08-27/ShippingRates.d.ts b/types/2020-08-27/ShippingRates.d.ts index b9f29c7e45..3ea5966dd0 100644 --- a/types/2020-08-27/ShippingRates.d.ts +++ b/types/2020-08-27/ShippingRates.d.ts @@ -121,6 +121,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -225,6 +250,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -248,10 +298,51 @@ declare module 'stripe' { */ expand?: Array; + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateUpdateParams.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.Emptyable; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateUpdateParams.TaxBehavior; + } + + namespace ShippingRateUpdateParams { + interface FixedAmount { + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount?: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; } interface ShippingRateListParams extends PaginationParams { diff --git a/types/2020-08-27/SubscriptionSchedules.d.ts b/types/2020-08-27/SubscriptionSchedules.d.ts index a5495e5eda..8a965c2932 100644 --- a/types/2020-08-27/SubscriptionSchedules.d.ts +++ b/types/2020-08-27/SubscriptionSchedules.d.ts @@ -229,6 +229,11 @@ declare module 'stripe' { */ coupon: string | Stripe.Coupon | Stripe.DeletedCoupon | 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). + */ + currency?: string; + /** * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. */ @@ -559,6 +564,11 @@ declare module 'stripe' { */ coupon?: string; + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + /** * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. */ @@ -979,6 +989,11 @@ declare module 'stripe' { */ coupon?: string; + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + /** * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. */ diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index 91ac59e962..6b9688c722 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -67,6 +67,11 @@ declare module 'stripe' { */ created: number; + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + /** * End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. */ @@ -579,6 +584,11 @@ declare module 'stripe' { */ coupon?: string; + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + /** * Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. */ diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2020-08-27/WebhookEndpoints.d.ts index a42bef2c92..5ab9755061 100644 --- a/types/2020-08-27/WebhookEndpoints.d.ts +++ b/types/2020-08-27/WebhookEndpoints.d.ts @@ -285,6 +285,11 @@ declare module 'stripe' { | 'customer.tax_id.updated' | 'customer.updated' | 'file.created' + | 'financial_connections.account.created' + | 'financial_connections.account.deactivated' + | 'financial_connections.account.disconnected' + | 'financial_connections.account.reactivated' + | 'financial_connections.account.refreshed_balance' | 'identity.verification_session.canceled' | 'identity.verification_session.created' | 'identity.verification_session.processing' @@ -544,6 +549,11 @@ declare module 'stripe' { | 'customer.tax_id.updated' | 'customer.updated' | 'file.created' + | 'financial_connections.account.created' + | 'financial_connections.account.deactivated' + | 'financial_connections.account.disconnected' + | 'financial_connections.account.reactivated' + | 'financial_connections.account.refreshed_balance' | 'identity.verification_session.canceled' | 'identity.verification_session.created' | 'identity.verification_session.processing' diff --git a/types/2020-08-27; server_side_confirmation_beta=v1/index.d.ts b/types/2020-08-27; server_side_confirmation_beta=v1/index.d.ts new file mode 100644 index 0000000000..5dfaa6c714 --- /dev/null +++ b/types/2020-08-27; server_side_confirmation_beta=v1/index.d.ts @@ -0,0 +1,318 @@ +// File generated from our OpenAPI spec + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare module 'stripe' { + // Added to in other modules, referenced above. + export namespace Stripe {} + + export class Stripe { + static Stripe: typeof Stripe; + + constructor(apiKey: string, config: Stripe.StripeConfig); + + setAppInfo(info: Stripe.AppInfo): void; + + StripeResource: Stripe.StripeResource; + + /** + * Top Level Resources + */ + accounts: Stripe.AccountsResource; + accountLinks: Stripe.AccountLinksResource; + applePayDomains: Stripe.ApplePayDomainsResource; + applicationFees: Stripe.ApplicationFeesResource; + balance: Stripe.BalanceResource; + balanceTransactions: Stripe.BalanceTransactionsResource; + charges: Stripe.ChargesResource; + countrySpecs: Stripe.CountrySpecsResource; + coupons: Stripe.CouponsResource; + creditNotes: Stripe.CreditNotesResource; + customers: Stripe.CustomersResource; + disputes: Stripe.DisputesResource; + ephemeralKeys: Stripe.EphemeralKeysResource; + events: Stripe.EventsResource; + exchangeRates: Stripe.ExchangeRatesResource; + files: Stripe.FilesResource; + fileLinks: Stripe.FileLinksResource; + invoices: Stripe.InvoicesResource; + invoiceItems: Stripe.InvoiceItemsResource; + issuerFraudRecords: Stripe.IssuerFraudRecordsResource; + mandates: Stripe.MandatesResource; + orders: Stripe.OrdersResource; + paymentIntents: Stripe.PaymentIntentsResource; + paymentLinks: Stripe.PaymentLinksResource; + paymentMethods: Stripe.PaymentMethodsResource; + payouts: Stripe.PayoutsResource; + plans: Stripe.PlansResource; + prices: Stripe.PricesResource; + products: Stripe.ProductsResource; + promotionCodes: Stripe.PromotionCodesResource; + quotes: Stripe.QuotesResource; + refunds: Stripe.RefundsResource; + reviews: Stripe.ReviewsResource; + setupAttempts: Stripe.SetupAttemptsResource; + setupIntents: Stripe.SetupIntentsResource; + shippingRates: Stripe.ShippingRatesResource; + skus: Stripe.SkusResource; + sources: Stripe.SourcesResource; + subscriptions: Stripe.SubscriptionsResource; + subscriptionItems: Stripe.SubscriptionItemsResource; + subscriptionSchedules: Stripe.SubscriptionSchedulesResource; + taxCodes: Stripe.TaxCodesResource; + taxRates: Stripe.TaxRatesResource; + tokens: Stripe.TokensResource; + topups: Stripe.TopupsResource; + transfers: Stripe.TransfersResource; + webhookEndpoints: Stripe.WebhookEndpointsResource; + webhooks: Stripe.Webhooks; + oauth: Stripe.OAuthResource; + + /** + * Namespaced Resources + */ + apps: { + secrets: Stripe.Apps.SecretsResource; + }; + billingPortal: { + configurations: Stripe.BillingPortal.ConfigurationsResource; + sessions: Stripe.BillingPortal.SessionsResource; + }; + checkout: { + sessions: Stripe.Checkout.SessionsResource; + }; + financialConnections: { + accounts: Stripe.FinancialConnections.AccountsResource; + sessions: Stripe.FinancialConnections.SessionsResource; + }; + identity: { + verificationReports: Stripe.Identity.VerificationReportsResource; + verificationSessions: Stripe.Identity.VerificationSessionsResource; + }; + issuing: { + authorizations: Stripe.Issuing.AuthorizationsResource; + cards: Stripe.Issuing.CardsResource; + cardholders: Stripe.Issuing.CardholdersResource; + disputes: Stripe.Issuing.DisputesResource; + transactions: Stripe.Issuing.TransactionsResource; + }; + radar: { + earlyFraudWarnings: Stripe.Radar.EarlyFraudWarningsResource; + valueLists: Stripe.Radar.ValueListsResource; + valueListItems: Stripe.Radar.ValueListItemsResource; + }; + reporting: { + reportRuns: Stripe.Reporting.ReportRunsResource; + reportTypes: Stripe.Reporting.ReportTypesResource; + }; + sigma: { + scheduledQueryRuns: Stripe.Sigma.ScheduledQueryRunsResource; + }; + terminal: { + configurations: Stripe.Terminal.ConfigurationsResource; + connectionTokens: Stripe.Terminal.ConnectionTokensResource; + locations: Stripe.Terminal.LocationsResource; + readers: Stripe.Terminal.ReadersResource; + }; + testHelpers: { + testClocks: Stripe.TestHelpers.TestClocksResource; + customers: Stripe.TestHelpers.CustomersResource; + refunds: Stripe.TestHelpers.RefundsResource; + issuing: { + cards: Stripe.TestHelpers.Issuing.CardsResource; + }; + 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 + */ + errors: typeof Stripe.errors; + + on(event: 'request', handler: (event: Stripe.RequestEvent) => void): void; + on(event: 'response', handler: (event: Stripe.ResponseEvent) => void): void; + once(event: 'request', handler: (event: Stripe.RequestEvent) => void): void; + once( + event: 'response', + handler: (event: Stripe.ResponseEvent) => void + ): void; + off(event: 'request', handler: (event: Stripe.RequestEvent) => void): void; + off( + event: 'response', + handler: (event: Stripe.ResponseEvent) => void + ): void; + + setProtocol(protocol: string): void; + + /** @deprecated Please use the StripeConfig object instead. */ + setHost(host: string, port?: string | number, protocol?: string): void; + + /** @deprecated Please use the StripeConfig object instead. */ + setPort(port: string | number): void; + /** @deprecated Please use the StripeConfig object instead. */ + setApiVersion(version: Stripe.LatestApiVersion): void; + /** @deprecated Please use the StripeConfig object instead. */ + setApiKey(key: string): void; + + /** @deprecated Please use the StripeConfig object instead. */ + setTimeout(timeout?: number): void; + /** @deprecated Please use the StripeConfig object instead. */ + setMaxNetworkRetries(maxNetworkRetries: number): void; + /** @deprecated Please use the StripeConfig object instead. */ + setTelemetryEnabled(enabled: boolean): void; + /** @deprecated Please use the StripeConfig object instead. */ + setHttpAgent(agent: Stripe.HttpAgent): void; + } + + export default Stripe; +}