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

Add support for Sofort on PaymentMethod and PaymentIntent #995

Merged
merged 1 commit into from
Sep 8, 2020
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 types/2020-08-27/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ declare module 'stripe' {
customer?: string | Stripe.Customer | Stripe.DeletedCustomer | null;

/**
* If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
* If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge).
*/
cvc_check: string | null;

Expand Down
19 changes: 18 additions & 1 deletion types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare module 'stripe' {
application_fee: string | Stripe.ApplicationFee | null;

/**
* The amount of the application fee (if any) for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details.
* The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details.
*/
application_fee_amount: number | null;

Expand Down Expand Up @@ -1361,13 +1361,30 @@ declare module 'stripe' {
*/
iban_last4: string | null;

/**
* Preferred language of the SOFORT authorization page that the customer is redirected to.
* Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl`
*/
preferred_language?: Sofort.PreferredLanguage | null;

/**
* Owner's verified full name. Values are verified or provided by SOFORT directly
* (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
verified_name: string | null;
}

namespace Sofort {
type PreferredLanguage =
| 'de'
| 'en'
| 'es'
| 'fr'
| 'it'
| 'nl'
| 'pl';
}

interface StripeAccount {}

interface Wechat {}
Expand Down
14 changes: 8 additions & 6 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ declare module 'stripe' {
/**
* The mode of the Checkout Session, one of `payment`, `setup`, or `subscription`.
*/
mode: Session.Mode | null;
mode: Session.Mode;

/**
* The ID of the PaymentIntent for Checkout Sessions in `payment` mode.
Expand Down Expand Up @@ -825,10 +825,11 @@ declare module 'stripe' {

interface PaymentIntentData {
/**
* The amount of the application fee (if any) that will be applied to the payment and transferred to the
* application owner's Stripe account. To use an application fee, the request must be made on
* behalf of another account, using the `Stripe-Account` header or an OAuth key. For more
* information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
* 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. To use an application fee, the request must be made on
* behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information,
* see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount?: number;

Expand Down Expand Up @@ -960,7 +961,8 @@ declare module 'stripe' {
| 'fpx'
| 'giropay'
| 'ideal'
| 'p24';
| 'p24'
| 'sofort';

interface SetupIntentData {
/**
Expand Down
145 changes: 138 additions & 7 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare module 'stripe' {
application: string | Stripe.Application | null;

/**
* The amount of the application fee (if any) for the resulting payment. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
* The amount of the application fee (if any) requested for the resulting payment. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
*/
application_fee_amount: number | null;

Expand Down Expand Up @@ -376,6 +376,8 @@ declare module 'stripe' {
bancontact?: PaymentMethodOptions.Bancontact;

card?: PaymentMethodOptions.Card;

sofort?: PaymentMethodOptions.Sofort;
}

namespace PaymentMethodOptions {
Expand Down Expand Up @@ -481,6 +483,24 @@ declare module 'stripe' {

type RequestThreeDSecure = 'any' | 'automatic' | 'challenge_only';
}

interface Sofort {
/**
* Preferred language of the SOFORT authorization page that the customer is redirected to.
*/
preferred_language: Sofort.PreferredLanguage | null;
}

namespace Sofort {
type PreferredLanguage =
| 'de'
| 'en'
| 'es'
| 'fr'
| 'it'
| 'nl'
| 'pl';
}
}

type SetupFutureUsage = 'off_session' | 'on_session';
Expand Down Expand Up @@ -545,7 +565,7 @@ declare module 'stripe' {
currency: string;

/**
* The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner's Stripe account. Must be greater than zero when provided. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
* 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. Must be greater than zero when provided. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount?: number;

Expand Down Expand Up @@ -807,6 +827,11 @@ declare module 'stripe' {
*/
sepa_debit?: PaymentMethodData.SepaDebit;

/**
* If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
*/
sofort?: PaymentMethodData.Sofort;

/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
Expand Down Expand Up @@ -974,6 +999,17 @@ declare module 'stripe' {
iban: string;
}

interface Sofort {
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: Sofort.Country;
}

namespace Sofort {
type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL';
}

type Type =
| 'alipay'
| 'au_becs_debit'
Expand All @@ -984,7 +1020,8 @@ declare module 'stripe' {
| 'giropay'
| 'ideal'
| 'p24'
| 'sepa_debit';
| 'sepa_debit'
| 'sofort';
}

interface PaymentMethodOptions {
Expand All @@ -1002,6 +1039,11 @@ declare module 'stripe' {
* Configuration for any card payments attempted on this PaymentIntent.
*/
card?: PaymentMethodOptions.Card | null;

/**
* If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
*/
sofort?: PaymentMethodOptions.Sofort | null;
}

namespace PaymentMethodOptions {
Expand Down Expand Up @@ -1094,6 +1136,21 @@ declare module 'stripe' {

type RequestThreeDSecure = 'any' | 'automatic';
}

interface Sofort {
preferred_language?: Sofort.PreferredLanguage;
}

namespace Sofort {
type PreferredLanguage =
| 'de'
| 'en'
| 'es'
| 'fr'
| 'it'
| 'nl'
| 'pl';
}
}

type SetupFutureUsage = 'off_session' | 'on_session';
Expand Down Expand Up @@ -1166,7 +1223,7 @@ declare module 'stripe' {
amount?: number;

/**
* The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner's Stripe account. Must be greater than zero when provided. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
* 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. Must be greater than zero when provided. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount?: number | null;

Expand Down Expand Up @@ -1330,6 +1387,11 @@ declare module 'stripe' {
*/
sepa_debit?: PaymentMethodData.SepaDebit;

/**
* If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
*/
sofort?: PaymentMethodData.Sofort;

/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
Expand Down Expand Up @@ -1497,6 +1559,17 @@ declare module 'stripe' {
iban: string;
}

interface Sofort {
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: Sofort.Country;
}

namespace Sofort {
type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL';
}

type Type =
| 'alipay'
| 'au_becs_debit'
Expand All @@ -1507,7 +1580,8 @@ declare module 'stripe' {
| 'giropay'
| 'ideal'
| 'p24'
| 'sepa_debit';
| 'sepa_debit'
| 'sofort';
}

interface PaymentMethodOptions {
Expand All @@ -1525,6 +1599,11 @@ declare module 'stripe' {
* Configuration for any card payments attempted on this PaymentIntent.
*/
card?: PaymentMethodOptions.Card | null;

/**
* If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
*/
sofort?: PaymentMethodOptions.Sofort | null;
}

namespace PaymentMethodOptions {
Expand Down Expand Up @@ -1617,6 +1696,21 @@ declare module 'stripe' {

type RequestThreeDSecure = 'any' | 'automatic';
}

interface Sofort {
preferred_language?: Sofort.PreferredLanguage;
}

namespace Sofort {
type PreferredLanguage =
| 'de'
| 'en'
| 'es'
| 'fr'
| 'it'
| 'nl'
| 'pl';
}
}

type SetupFutureUsage = 'off_session' | 'on_session';
Expand Down Expand Up @@ -1700,7 +1794,7 @@ declare module 'stripe' {
amount_to_capture?: number;

/**
* The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner's Stripe account. Must be greater than zero when provided. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
* 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. Must be greater than zero when provided. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount?: number;

Expand Down Expand Up @@ -1967,6 +2061,11 @@ declare module 'stripe' {
*/
sepa_debit?: PaymentMethodData.SepaDebit;

/**
* If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
*/
sofort?: PaymentMethodData.Sofort;

/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
Expand Down Expand Up @@ -2134,6 +2233,17 @@ declare module 'stripe' {
iban: string;
}

interface Sofort {
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: Sofort.Country;
}

namespace Sofort {
type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL';
}

type Type =
| 'alipay'
| 'au_becs_debit'
Expand All @@ -2144,7 +2254,8 @@ declare module 'stripe' {
| 'giropay'
| 'ideal'
| 'p24'
| 'sepa_debit';
| 'sepa_debit'
| 'sofort';
}

interface PaymentMethodOptions {
Expand All @@ -2162,6 +2273,11 @@ declare module 'stripe' {
* Configuration for any card payments attempted on this PaymentIntent.
*/
card?: PaymentMethodOptions.Card | null;

/**
* If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
*/
sofort?: PaymentMethodOptions.Sofort | null;
}

namespace PaymentMethodOptions {
Expand Down Expand Up @@ -2254,6 +2370,21 @@ declare module 'stripe' {

type RequestThreeDSecure = 'any' | 'automatic';
}

interface Sofort {
preferred_language?: Sofort.PreferredLanguage;
}

namespace Sofort {
type PreferredLanguage =
| 'de'
| 'en'
| 'es'
| 'fr'
| 'it'
| 'nl'
| 'pl';
}
}

type SetupFutureUsage = 'off_session' | 'on_session';
Expand Down
Loading