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 Bancontact/iDEAL/Sofort -> SEPA #1028

Merged
merged 2 commits into from
Oct 9, 2020
Merged
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
6 changes: 3 additions & 3 deletions types/2020-08-27/Cards.d.ts
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ declare module 'stripe' {
deleted?: void;

/**
* Card description. (Only for internal use only and not typically available in standard API requests.)
* Card description. (For internal use only and not typically available in standard API requests.)
*/
description?: string;

@@ -128,12 +128,12 @@ declare module 'stripe' {
funding: string;

/**
* Issuer identification number of the card. (Only for internal use only and not typically available in standard API requests.)
* Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
*/
iin?: string;

/**
* Issuer bank name of the card. (Only for internal use only and not typically available in standard API requests.)
* Issuer bank name of the card. (For internal use only and not typically available in standard API requests.)
*/
issuer?: string;

36 changes: 33 additions & 3 deletions types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
@@ -598,6 +598,16 @@ declare module 'stripe' {
*/
bic: string | null;

/**
* The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
*/
generated_sepa_debit: string | Stripe.PaymentMethod | null;

/**
* The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
*/
generated_sepa_debit_mandate: string | Stripe.Mandate | null;

/**
* Last four characters of the IBAN.
*/
@@ -637,7 +647,7 @@ declare module 'stripe' {
country: string | null;

/**
* Card description. (Only for internal use only and not typically available in standard API requests.)
* Card description. (For internal use only and not typically available in standard API requests.)
*/
description?: string | null;

@@ -662,7 +672,7 @@ declare module 'stripe' {
funding: string | null;

/**
* Issuer identification number of the card. (Only for internal use only and not typically available in standard API requests.)
* Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
*/
iin?: string | null;

@@ -674,7 +684,7 @@ declare module 'stripe' {
installments: Card.Installments | null;

/**
* Issuer bank name of the card. (Only for internal use only and not typically available in standard API requests.)
* Issuer bank name of the card. (For internal use only and not typically available in standard API requests.)
*/
issuer?: string | null;

@@ -1096,6 +1106,16 @@ declare module 'stripe' {
*/
bic: Ideal.Bic | null;

/**
* The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
*/
generated_sepa_debit: string | Stripe.PaymentMethod | null;

/**
* The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
*/
generated_sepa_debit_mandate: string | Stripe.Mandate | null;

/**
* Last four characters of the IBAN.
*/
@@ -1370,6 +1390,16 @@ declare module 'stripe' {
*/
country: string | null;

/**
* The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
*/
generated_sepa_debit: string | Stripe.PaymentMethod | null;

/**
* The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
*/
generated_sepa_debit_mandate: string | Stripe.Mandate | null;

/**
* Last four characters of the IBAN.
*/
25 changes: 22 additions & 3 deletions types/2020-08-27/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
@@ -151,7 +151,7 @@ declare module 'stripe' {
country: string | null;

/**
* Card description. (Only for internal use only and not typically available in standard API requests.)
* Card description. (For internal use only and not typically available in standard API requests.)
*/
description?: string | null;

@@ -176,12 +176,12 @@ declare module 'stripe' {
funding: string;

/**
* Issuer identification number of the card. (Only for internal use only and not typically available in standard API requests.)
* Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
*/
iin?: string | null;

/**
* Issuer bank name of the card. (Only for internal use only and not typically available in standard API requests.)
* Issuer bank name of the card. (For internal use only and not typically available in standard API requests.)
*/
issuer?: string | null;

@@ -443,12 +443,31 @@ declare module 'stripe' {
*/
fingerprint: string | null;

/**
* Information about the object that generated this PaymentMethod.
*/
generated_from: SepaDebit.GeneratedFrom | null;

/**
* Last four characters of the IBAN.
*/
last4: string | null;
}

namespace SepaDebit {
interface GeneratedFrom {
/**
* The ID of the Charge that generated this PaymentMethod, if any.
*/
charge: string | Stripe.Charge | null;

/**
* The ID of the SetupAttempt that generated this PaymentMethod, if any.
*/
setup_attempt: string | Stripe.SetupAttempt | null;
}
}

interface Sofort {
/**
* Two-letter ISO code representing the country the bank account is located in.
165 changes: 165 additions & 0 deletions types/2020-08-27/SetupAttempts.d.ts
Original file line number Diff line number Diff line change
@@ -70,15 +70,69 @@ declare module 'stripe' {

namespace SetupAttempt {
interface PaymentMethodDetails {
bancontact?: PaymentMethodDetails.Bancontact;

card?: PaymentMethodDetails.Card;

ideal?: PaymentMethodDetails.Ideal;

sofort?: PaymentMethodDetails.Sofort;

/**
* The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method.
*/
type: string;
}

namespace PaymentMethodDetails {
interface Bancontact {
/**
* Bank code of bank associated with the bank account.
*/
bank_code: string | null;

/**
* Name of the bank associated with the bank account.
*/
bank_name: string | null;

/**
* Bank Identifier Code of the bank associated with the bank account.
*/
bic: string | null;

/**
* The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
*/
generated_sepa_debit: string | Stripe.PaymentMethod | null;

/**
* The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
*/
generated_sepa_debit_mandate: string | Stripe.Mandate | null;

/**
* Last four characters of the IBAN.
*/
iban_last4: string | null;

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

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

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

interface Card {
/**
* Populated if this authorization used 3D Secure authentication.
@@ -133,6 +187,117 @@ declare module 'stripe' {
type Version = '1.0.2' | '2.1.0' | '2.2.0';
}
}

interface Ideal {
/**
* The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `sns_bank`, `triodos_bank`, or `van_lanschot`.
*/
bank: Ideal.Bank | null;

/**
* The Bank Identifier Code of the customer's bank.
*/
bic: Ideal.Bic | null;

/**
* The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
*/
generated_sepa_debit: string | Stripe.PaymentMethod | null;

/**
* The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
*/
generated_sepa_debit_mandate: string | Stripe.Mandate | null;

/**
* Last four characters of the IBAN.
*/
iban_last4: string | null;

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

namespace Ideal {
type Bank =
| 'abn_amro'
| 'asn_bank'
| 'bunq'
| 'handelsbanken'
| 'ing'
| 'knab'
| 'moneyou'
| 'rabobank'
| 'regiobank'
| 'sns_bank'
| 'triodos_bank'
| 'van_lanschot';

type Bic =
| 'ABNANL2A'
| 'ASNBNL21'
| 'BUNQNL2A'
| 'FVLBNL22'
| 'HANDNL2A'
| 'INGBNL2A'
| 'KNABNL2H'
| 'MOYONL21'
| 'RABONL2U'
| 'RBRBNL21'
| 'SNSBNL2A'
| 'TRIONL2U';
}

interface Sofort {
/**
* Bank code of bank associated with the bank account.
*/
bank_code: string | null;

/**
* Name of the bank associated with the bank account.
*/
bank_name: string | null;

/**
* Bank Identifier Code of the bank associated with the bank account.
*/
bic: string | null;

/**
* The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
*/
generated_sepa_debit: string | Stripe.PaymentMethod | null;

/**
* The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
*/
generated_sepa_debit_mandate: string | Stripe.Mandate | null;

/**
* Last four characters of the IBAN.
*/
iban_last4: string | null;

/**
* Preferred language of the Sofort authorization page that the customer is redirected to.
* Can be one of `en`, `de`, `fr`, or `nl`
*/
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' | 'fr' | 'nl';
}
}

interface SetupError {