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 #1119

Merged
merged 1 commit into from
Feb 9, 2021
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
31 changes: 31 additions & 0 deletions types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ declare module 'stripe' {
| 'non_profit';

interface Capabilities {
/**
* The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges.
*/
afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments;

/**
* The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges.
*/
Expand Down Expand Up @@ -254,6 +259,8 @@ declare module 'stripe' {
}

namespace Capabilities {
type AfterpayClearpayPayments = 'active' | 'inactive' | 'pending';

type AuBecsDebitPayments = 'active' | 'inactive' | 'pending';

type BacsDebitPayments = 'active' | 'inactive' | 'pending';
Expand Down Expand Up @@ -949,6 +956,11 @@ declare module 'stripe' {
| 'non_profit';

interface Capabilities {
/**
* The afterpay_clearpay_payments capability.
*/
afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments;

/**
* The au_becs_debit_payments capability.
*/
Expand Down Expand Up @@ -1051,6 +1063,13 @@ declare module 'stripe' {
}

namespace Capabilities {
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.
*/
requested?: boolean;
}

interface AuBecsDebitPayments {
/**
* 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.
Expand Down Expand Up @@ -1950,6 +1969,11 @@ declare module 'stripe' {
| 'non_profit';

interface Capabilities {
/**
* The afterpay_clearpay_payments capability.
*/
afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments;

/**
* The au_becs_debit_payments capability.
*/
Expand Down Expand Up @@ -2052,6 +2076,13 @@ declare module 'stripe' {
}

namespace Capabilities {
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.
*/
requested?: boolean;
}

interface AuBecsDebitPayments {
/**
* 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.
Expand Down
208 changes: 208 additions & 0 deletions types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ declare module 'stripe' {
*/
payment_intent: string | Stripe.PaymentIntent | null;

payment_settings: Invoice.PaymentSettings;

/**
* End of the usage period during which invoice items were added to this invoice.
*/
Expand Down Expand Up @@ -533,6 +535,70 @@ declare module 'stripe' {
| 'rate_limit_error';
}

interface PaymentSettings {
/**
* Payment-method-specific configuration to provide to the invoice's PaymentIntent.
*/
payment_method_options: PaymentSettings.PaymentMethodOptions | null;

/**
* The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. 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<PaymentSettings.PaymentMethodType> | null;
}

namespace PaymentSettings {
interface PaymentMethodOptions {
/**
* If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
*/
bancontact: PaymentMethodOptions.Bancontact | null;

/**
* If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
*/
card: PaymentMethodOptions.Card | null;
}

namespace PaymentMethodOptions {
interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
*/
preferred_language: Bancontact.PreferredLanguage;
}

namespace Bancontact {
type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
}

interface Card {
/**
* 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.
*/
request_three_d_secure: Card.RequestThreeDSecure | null;
}

namespace Card {
type RequestThreeDSecure = 'any' | 'automatic';
}
}

type PaymentMethodType =
| 'ach_credit_transfer'
| 'ach_debit'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'card'
| 'fpx'
| 'giropay'
| 'ideal'
| 'sepa_credit_transfer'
| 'sepa_debit'
| 'sofort';
}

type Status =
| 'deleted'
| 'draft'
Expand Down Expand Up @@ -732,6 +798,11 @@ declare module 'stripe' {
*/
metadata?: Stripe.Emptyable<Stripe.MetadataParam>;

/**
* Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
*/
payment_settings?: InvoiceCreateParams.PaymentSettings;

/**
* Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
*/
Expand Down Expand Up @@ -775,6 +846,72 @@ declare module 'stripe' {
discount?: string;
}

interface PaymentSettings {
/**
* Payment-method-specific configuration to provide to the invoice's PaymentIntent.
*/
payment_method_options?: PaymentSettings.PaymentMethodOptions;

/**
* The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. 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?: Stripe.Emptyable<
Array<PaymentSettings.PaymentMethodType>
>;
}

namespace PaymentSettings {
interface PaymentMethodOptions {
/**
* If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
*/
bancontact?: Stripe.Emptyable<PaymentMethodOptions.Bancontact>;

/**
* If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
*/
card?: Stripe.Emptyable<PaymentMethodOptions.Card>;
}

namespace PaymentMethodOptions {
interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
*/
preferred_language?: Bancontact.PreferredLanguage;
}

namespace Bancontact {
type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
}

interface Card {
/**
* 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.
*/
request_three_d_secure?: Card.RequestThreeDSecure;
}

namespace Card {
type RequestThreeDSecure = 'any' | 'automatic';
}
}

type PaymentMethodType =
| 'ach_credit_transfer'
| 'ach_debit'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'card'
| 'fpx'
| 'giropay'
| 'ideal'
| 'sepa_credit_transfer'
| 'sepa_debit'
| 'sofort';
}

interface TransferData {
/**
* The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
Expand Down Expand Up @@ -871,6 +1008,11 @@ declare module 'stripe' {
*/
metadata?: Stripe.Emptyable<Stripe.MetadataParam>;

/**
* Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
*/
payment_settings?: InvoiceUpdateParams.PaymentSettings;

/**
* Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
*/
Expand Down Expand Up @@ -909,6 +1051,72 @@ declare module 'stripe' {
discount?: string;
}

interface PaymentSettings {
/**
* Payment-method-specific configuration to provide to the invoice's PaymentIntent.
*/
payment_method_options?: PaymentSettings.PaymentMethodOptions;

/**
* The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. 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?: Stripe.Emptyable<
Array<PaymentSettings.PaymentMethodType>
>;
}

namespace PaymentSettings {
interface PaymentMethodOptions {
/**
* If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
*/
bancontact?: Stripe.Emptyable<PaymentMethodOptions.Bancontact>;

/**
* If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
*/
card?: Stripe.Emptyable<PaymentMethodOptions.Card>;
}

namespace PaymentMethodOptions {
interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
*/
preferred_language?: Bancontact.PreferredLanguage;
}

namespace Bancontact {
type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
}

interface Card {
/**
* 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.
*/
request_three_d_secure?: Card.RequestThreeDSecure;
}

namespace Card {
type RequestThreeDSecure = 'any' | 'automatic';
}
}

type PaymentMethodType =
| 'ach_credit_transfer'
| 'ach_debit'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'card'
| 'fpx'
| 'giropay'
| 'ideal'
| 'sepa_credit_transfer'
| 'sepa_debit'
| 'sofort';
}

interface TransferData {
/**
* The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ declare module 'stripe' {
metadata?: Stripe.Emptyable<Stripe.MetadataParam>;

/**
* ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent.
* ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.
*/
payment_method?: string;

Expand Down Expand Up @@ -2176,7 +2176,7 @@ declare module 'stripe' {
off_session?: boolean | PaymentIntentConfirmParams.OffSession;

/**
* ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent.
* ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.
*/
payment_method?: string;

Expand Down