diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f0478776cd..fe5aa3c019 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v177 \ No newline at end of file +v178 \ No newline at end of file diff --git a/types/2022-08-01/Checkout/Sessions.d.ts b/types/2022-08-01/Checkout/Sessions.d.ts index ba56fc52bc..1b5a0479b2 100644 --- a/types/2022-08-01/Checkout/Sessions.d.ts +++ b/types/2022-08-01/Checkout/Sessions.d.ts @@ -140,6 +140,11 @@ declare module 'stripe' { */ payment_link: string | Stripe.PaymentLink | null; + /** + * Configure whether a Checkout Session should collect a payment method. + */ + payment_method_collection: Session.PaymentMethodCollection | null; + /** * Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. */ @@ -450,6 +455,8 @@ declare module 'stripe' { type Mode = 'payment' | 'setup' | 'subscription'; + type PaymentMethodCollection = 'always' | 'if_required'; + interface PaymentMethodOptions { acss_debit?: PaymentMethodOptions.AcssDebit; @@ -1498,6 +1505,16 @@ declare module 'stripe' { */ payment_intent_data?: SessionCreateParams.PaymentIntentData; + /** + * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. + * This may occur if the Checkout Session includes a free trial or a discount. + * + * Can only be set in `subscription` mode. + * + * If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + */ + payment_method_collection?: SessionCreateParams.PaymentMethodCollection; + /** * Payment-method-specific configuration. */ @@ -1991,6 +2008,8 @@ declare module 'stripe' { } } + type PaymentMethodCollection = 'always' | 'if_required'; + interface PaymentMethodOptions { /** * contains details about the ACSS Debit payment method options. diff --git a/types/2022-08-01/PaymentLinks.d.ts b/types/2022-08-01/PaymentLinks.d.ts index 5a850b029c..29b530cb6a 100644 --- a/types/2022-08-01/PaymentLinks.d.ts +++ b/types/2022-08-01/PaymentLinks.d.ts @@ -80,6 +80,11 @@ declare module 'stripe' { */ payment_intent_data: PaymentLink.PaymentIntentData | null; + /** + * Configuration for collecting a payment method during checkout. + */ + payment_method_collection: PaymentLink.PaymentMethodCollection; + /** * 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). */ @@ -190,6 +195,8 @@ declare module 'stripe' { type SetupFutureUsage = 'off_session' | 'on_session'; } + type PaymentMethodCollection = 'always' | 'if_required'; + type PaymentMethodType = | 'affirm' | 'afterpay_clearpay' @@ -583,6 +590,15 @@ declare module 'stripe' { */ payment_intent_data?: PaymentLinkCreateParams.PaymentIntentData; + /** + * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. + * + * Can only be set in `subscription` mode. + * + * If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + */ + payment_method_collection?: PaymentLinkCreateParams.PaymentMethodCollection; + /** * The list of payment method types that customers can use. 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)). */ @@ -750,6 +766,8 @@ declare module 'stripe' { type SetupFutureUsage = 'off_session' | 'on_session'; } + type PaymentMethodCollection = 'always' | 'if_required'; + type PaymentMethodType = | 'affirm' | 'afterpay_clearpay' @@ -1124,6 +1142,15 @@ declare module 'stripe' { */ metadata?: Stripe.MetadataParam; + /** + * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. + * + * Can only be set in `subscription` mode. + * + * If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + */ + payment_method_collection?: PaymentLinkUpdateParams.PaymentMethodCollection; + /** * The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). */ @@ -1222,6 +1249,8 @@ declare module 'stripe' { } } + type PaymentMethodCollection = 'always' | 'if_required'; + type PaymentMethodType = | 'affirm' | 'afterpay_clearpay'