From 7edc9e15af1a98bdf926a5d3b93a4e4996e6dbac Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Fri, 22 Jul 2022 13:20:38 -0400 Subject: [PATCH] Codegen for openapi v172 --- OPENAPI_VERSION | 2 +- types/2020-08-27/Checkout/Sessions.d.ts | 49 ++++++ types/2020-08-27/Invoices.d.ts | 89 +++++++++++ types/2020-08-27/Orders.d.ts | 200 +++++++++++++++++++++++- types/2020-08-27/PaymentIntents.d.ts | 2 - types/2020-08-27/Prices.d.ts | 2 +- types/2020-08-27/QuotePhases.d.ts | 2 +- 7 files changed, 333 insertions(+), 13 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 48af0461ca..6fa005db08 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v170 \ No newline at end of file +v172 \ No newline at end of file diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index 4d6697a3a8..75267077f0 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -652,6 +652,8 @@ declare module 'stripe' { } interface Card { + installments?: Card.Installments; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -673,6 +675,13 @@ declare module 'stripe' { } namespace Card { + interface Installments { + /** + * Indicates if installments are enabled + */ + enabled?: boolean; + } + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; } @@ -2151,6 +2160,11 @@ declare module 'stripe' { } interface Card { + /** + * Installment options for card payments + */ + installments?: Card.Installments; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -2172,6 +2186,41 @@ declare module 'stripe' { } namespace Card { + interface Installments { + /** + * Setting to true enables installments for this PaymentIntent. + * This will cause the response to contain a list of available installment plans. + * Setting to false will prevent any selected plan from applying to a charge. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this payment attempt. + * This parameter can only be provided during confirmation. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + type SetupFutureUsage = 'off_session' | 'on_session'; } diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index d1a9e41659..2ecdcea008 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -695,6 +695,8 @@ declare module 'stripe' { } interface Card { + installments?: Card.Installments; + /** * 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. 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. */ @@ -702,6 +704,13 @@ declare module 'stripe' { } namespace Card { + interface Installments { + /** + * Whether Installments are enabled for this Invoice. + */ + enabled: boolean | null; + } + type RequestThreeDSecure = 'any' | 'automatic'; } @@ -1174,6 +1183,13 @@ declare module 'stripe' { } interface Card { + /** + * Installment configuration for payments attempted on this invoice (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + /** * 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. 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. */ @@ -1181,6 +1197,39 @@ declare module 'stripe' { } namespace Card { + interface Installments { + /** + * Setting to true enables installments for this invoice. + * Setting to false will prevent any selected plan from applying to a payment. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this invoice. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + type RequestThreeDSecure = 'any' | 'automatic'; } @@ -1555,6 +1604,13 @@ declare module 'stripe' { } interface Card { + /** + * Installment configuration for payments attempted on this invoice (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + /** * 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. 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. */ @@ -1562,6 +1618,39 @@ declare module 'stripe' { } namespace Card { + interface Installments { + /** + * Setting to true enables installments for this invoice. + * Setting to false will prevent any selected plan from applying to a payment. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this invoice. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + type RequestThreeDSecure = 'any' | 'automatic'; } diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index 0c50c5f898..c015d6c3ce 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -1030,20 +1030,37 @@ declare module 'stripe' { discounts?: Stripe.Emptyable>; /** - * The ID of the price object. One of `product` (with default price) or `price` or `price_data` is required. + * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. + * + * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. */ 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. + * Data used to generate a new Price object inline. + * + * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + * + * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. */ 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. + * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. + * + * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. */ product?: string; + /** + * Defines a Product inline and adds it to the Order. + * + * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + * + * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + */ + product_data?: LineItem.ProductData; + /** * The quantity of the line item. */ @@ -1075,7 +1092,9 @@ declare module 'stripe' { currency?: string; /** - * The ID of the product that this price will belong to. + * ID of the product this price belongs to. + * + * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. */ product?: string; @@ -1098,6 +1117,79 @@ declare module 'stripe' { namespace PriceData { type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; } + + interface ProductData { + /** + * 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. + */ + description?: string; + + /** + * A unique identifier for this product. + * + * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + */ + id: string; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Stripe.Emptyable>; + + /** + * 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; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * The dimensions of this product for shipping purposes. + */ + package_dimensions?: Stripe.Emptyable; + + /** + * Whether this product is shipped (i.e., physical goods). + */ + shippable?: boolean; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * A URL of a publicly-accessible webpage for this product. + */ + url?: Stripe.Emptyable; + } + + namespace ProductData { + interface PackageDimensions { + /** + * Height, in inches. Maximum precision is 2 decimal places. + */ + height: number; + + /** + * Length, in inches. Maximum precision is 2 decimal places. + */ + length: number; + + /** + * Weight, in ounces. Maximum precision is 2 decimal places. + */ + weight: number; + + /** + * Width, in inches. Maximum precision is 2 decimal places. + */ + width: number; + } + } } interface Payment { @@ -2099,20 +2191,37 @@ declare module 'stripe' { id?: string; /** - * The ID of the price object. One of `product` (with default price) or `price` or `price_data` is required. + * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. + * + * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. */ 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. + * Data used to generate a new Price object inline. + * + * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + * + * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. */ 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. + * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. + * + * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. */ product?: string; + /** + * Defines a Product inline and adds it to the Order. + * + * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + * + * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + */ + product_data?: LineItem.ProductData; + /** * The quantity of the line item. */ @@ -2144,7 +2253,9 @@ declare module 'stripe' { currency?: string; /** - * The ID of the product that this price will belong to. + * ID of the product this price belongs to. + * + * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. */ product?: string; @@ -2167,6 +2278,79 @@ declare module 'stripe' { namespace PriceData { type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; } + + interface ProductData { + /** + * 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. + */ + description?: string; + + /** + * A unique identifier for this product. + * + * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + */ + id: string; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Stripe.Emptyable>; + + /** + * 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; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * The dimensions of this product for shipping purposes. + */ + package_dimensions?: Stripe.Emptyable; + + /** + * Whether this product is shipped (i.e., physical goods). + */ + shippable?: boolean; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * A URL of a publicly-accessible webpage for this product. + */ + url?: Stripe.Emptyable; + } + + namespace ProductData { + interface PackageDimensions { + /** + * Height, in inches. Maximum precision is 2 decimal places. + */ + height: number; + + /** + * Length, in inches. Maximum precision is 2 decimal places. + */ + length: number; + + /** + * Weight, in ounces. Maximum precision is 2 decimal places. + */ + weight: number; + + /** + * Width, in inches. Maximum precision is 2 decimal places. + */ + width: number; + } + } } interface Payment { diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 6729e524b0..65aac3f998 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -7317,8 +7317,6 @@ declare module 'stripe' { /** * Manually reconcile the remaining amount for a customer_balance PaymentIntent. - * - * This can be used when the cash balance for [a customer in manual reconciliation mode](docs/payments/customer-balance/reconciliation#cash-manual-reconciliation) received funds. */ applyCustomerBalance( id: string, diff --git a/types/2020-08-27/Prices.d.ts b/types/2020-08-27/Prices.d.ts index 24a6bc47b5..136c3fcf73 100644 --- a/types/2020-08-27/Prices.d.ts +++ b/types/2020-08-27/Prices.d.ts @@ -431,7 +431,7 @@ declare module 'stripe' { transform_quantity?: PriceCreateParams.TransformQuantity; /** - * A positive integer in cents (or local equivalent) (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. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. */ unit_amount?: number; diff --git a/types/2020-08-27/QuotePhases.d.ts b/types/2020-08-27/QuotePhases.d.ts index 059656cb1f..61b2de891e 100644 --- a/types/2020-08-27/QuotePhases.d.ts +++ b/types/2020-08-27/QuotePhases.d.ts @@ -27,7 +27,7 @@ declare module 'stripe' { amount_total: number; /** - * If set to `new`, the billing_cycle_anchor of the subscription is set to the start of the phase when entering the phase. If unset, then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + * If set to `reset`, the billing_cycle_anchor of the subscription is set to the start of the phase when entering the phase. If unset, then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). */ billing_cycle_anchor: 'reset' | null;