Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates #1510

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v177
v178
19 changes: 19 additions & 0 deletions types/2022-08-01/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -450,6 +455,8 @@ declare module 'stripe' {

type Mode = 'payment' | 'setup' | 'subscription';

type PaymentMethodCollection = 'always' | 'if_required';

interface PaymentMethodOptions {
acss_debit?: PaymentMethodOptions.AcssDebit;

Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -1991,6 +2008,8 @@ declare module 'stripe' {
}
}

type PaymentMethodCollection = 'always' | 'if_required';

interface PaymentMethodOptions {
/**
* contains details about the ACSS Debit payment method options.
Expand Down
29 changes: 29 additions & 0 deletions types/2022-08-01/PaymentLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down Expand Up @@ -190,6 +195,8 @@ declare module 'stripe' {
type SetupFutureUsage = 'off_session' | 'on_session';
}

type PaymentMethodCollection = 'always' | 'if_required';

type PaymentMethodType =
| 'affirm'
| 'afterpay_clearpay'
Expand Down Expand Up @@ -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)).
*/
Expand Down Expand Up @@ -750,6 +766,8 @@ declare module 'stripe' {
type SetupFutureUsage = 'off_session' | 'on_session';
}

type PaymentMethodCollection = 'always' | 'if_required';

type PaymentMethodType =
| 'affirm'
| 'afterpay_clearpay'
Expand Down Expand Up @@ -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).
*/
Expand Down Expand Up @@ -1222,6 +1249,8 @@ declare module 'stripe' {
}
}

type PaymentMethodCollection = 'always' | 'if_required';

type PaymentMethodType =
| 'affirm'
| 'afterpay_clearpay'
Expand Down