Skip to content

Commit

Permalink
Add support for Bancontact/iDEAL/Sofort -> SEPA (#1028)
Browse files Browse the repository at this point in the history
* Codegen for openapi db6e2d0
  • Loading branch information
richardm-stripe authored Oct 9, 2020
1 parent a9f8e13 commit 63c476b
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 9 deletions.
6 changes: 3 additions & 3 deletions types/2020-08-27/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
36 changes: 33 additions & 3 deletions types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down
25 changes: 22 additions & 3 deletions types/2020-08-27/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
165 changes: 165 additions & 0 deletions types/2020-08-27/SetupAttempts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 63c476b

Please sign in to comment.