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 BACS Debit as a PaymentMethod #905

Merged
merged 1 commit into from
May 29, 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
9 changes: 9 additions & 0 deletions types/2020-03-02/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ declare module 'stripe' {
}

interface Settings {
bacs_debit_payments?: Settings.BacsDebitPayments;

branding: Settings.Branding;

card_payments: Settings.CardPayments;
Expand All @@ -512,6 +514,13 @@ declare module 'stripe' {
}

namespace Settings {
interface BacsDebitPayments {
/**
* The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this will appear on the mandate, and as the statement descriptor.
*/
display_name?: string;
}

interface Branding {
/**
* (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px.
Expand Down
32 changes: 28 additions & 4 deletions types/2020-03-02/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ declare module 'stripe' {

au_becs_debit?: PaymentMethodDetails.AuBecsDebit;

bacs_debit?: PaymentMethodDetails.BacsDebit;

bancontact?: PaymentMethodDetails.Bancontact;

bitcoin?: PaymentMethodDetails.Bitcoin;
Expand Down Expand Up @@ -542,6 +544,28 @@ declare module 'stripe' {
mandate?: string;
}

interface BacsDebit {
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;

/**
* Last four digits of the bank account number.
*/
last4: string | null;

/**
* ID of the mandate used to make this payment.
*/
mandate: string | null;

/**
* Sort code of the bank account. (e.g., `10-20-30`)
*/
sort_code: string | null;
}

interface Bancontact {
/**
* Bank code of bank associated with the bank account.
Expand Down Expand Up @@ -730,9 +754,8 @@ declare module 'stripe' {
authenticated?: boolean;

/**
* For authenticated transactions: whether issuing bank authenticated the
* cardholder with a traditional challenge screen, or with device data
* via the 3DS2 frictionless flow.
* For authenticated transactions: how the customer was authenticated by
* the issuing bank.
*/
authentication_flow: ThreeDSecure.AuthenticationFlow | null;

Expand All @@ -742,7 +765,8 @@ declare module 'stripe' {
result: ThreeDSecure.Result;

/**
* Additional information about why 3D Secure succeeded or failed.
* Additional information about why 3D Secure succeeded or failed based
* on the `result`.
*/
result_reason: ThreeDSecure.ResultReason | null;

Expand Down
10 changes: 5 additions & 5 deletions types/2020-03-02/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ declare module 'stripe' {
* If not provided, customers will be asked to enter their email address.
* Use this parameter to prefill customer data if you already have an email
* on file. To access information about the customer once a session is
* complete, use the `customer` field.
* complete, use the `customer` attribute.
*/
customer_email: string | null;

/**
* The line items, plans, or SKUs purchased by the customer.
* The line items, plans, or SKUs purchased by the customer. Prefer using `line_items`.
*/
display_items?: Array<Session.DisplayItem>;

Expand Down Expand Up @@ -553,7 +553,7 @@ declare module 'stripe' {
/**
* A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [prices](https://stripe.com/docs/api/prices).
*
* Alternatively, if not using recurring prices, this parameter is for one-time payments or
* If not using recurring prices, this parameter is for one-time payments or
* adding invoice line items to a subscription (used in conjunction with `subscription_data.items`).
*
* There is a maximum of 100 line items, however it is recommended to
Expand Down Expand Up @@ -637,7 +637,7 @@ declare module 'stripe' {
name?: string;

/**
* The ID of the price object. One of `price`, `price_data` or `amount` is required.
* The ID of the price or plan object. One of `price`, `price_data` or `amount` is required.
*/
price?: string;

Expand Down Expand Up @@ -1159,7 +1159,7 @@ declare module 'stripe' {
default_tax_rates?: Array<string>;

/**
* A list of items, each with an attached plan, that the customer is subscribing to. Use this parameter for subscriptions. To create one-time payments, use `line_items`.
* A list of items, each with an attached plan, that the customer is subscribing to. Prefer using `line_items`.
*/
items?: Array<SubscriptionData.Item>;

Expand Down
14 changes: 14 additions & 0 deletions types/2020-03-02/Mandates.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ declare module 'stripe' {
interface PaymentMethodDetails {
au_becs_debit?: PaymentMethodDetails.AuBecsDebit;

bacs_debit?: PaymentMethodDetails.BacsDebit;

card?: PaymentMethodDetails.Card;

sepa_debit?: PaymentMethodDetails.SepaDebit;
Expand All @@ -101,6 +103,18 @@ declare module 'stripe' {
url: string;
}

interface BacsDebit {
network_status: BacsDebit.NetworkStatus;

reference: string;

url: string;
}

namespace BacsDebit {
type NetworkStatus = 'accepted' | 'pending' | 'refused' | 'revoked';
}

interface Card {}

interface SepaDebit {
Expand Down
38 changes: 38 additions & 0 deletions types/2020-03-02/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ declare module 'stripe' {

au_becs_debit?: PaymentMethod.AuBecsDebit;

bacs_debit?: PaymentMethod.BacsDebit;

billing_details: PaymentMethod.BillingDetails;

card?: PaymentMethod.Card;
Expand Down Expand Up @@ -74,6 +76,23 @@ declare module 'stripe' {
last4: string | null;
}

interface BacsDebit {
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;

/**
* Last four digits of the bank account number.
*/
last4: string | null;

/**
* Sort code of the bank account. (e.g., `10-20-30`)
*/
sort_code: string | null;
}

interface BillingDetails {
/**
* Billing address.
Expand Down Expand Up @@ -388,6 +407,7 @@ declare module 'stripe' {

type Type =
| 'au_becs_debit'
| 'bacs_debit'
| 'card'
| 'card_present'
| 'fpx'
Expand All @@ -401,6 +421,11 @@ declare module 'stripe' {
*/
au_becs_debit?: PaymentMethodCreateParams.AuBecsDebit;

/**
* If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
*/
bacs_debit?: PaymentMethodCreateParams.BacsDebit;

/**
* Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
*/
Expand Down Expand Up @@ -470,6 +495,18 @@ declare module 'stripe' {
bsb_number: string;
}

interface BacsDebit {
/**
* Account number of the bank account that the funds will be debited from.
*/
account_number?: string;

/**
* Sort code of the bank account. (e.g., `10-20-30`)
*/
sort_code?: string;
}

interface BillingDetails {
/**
* Billing address.
Expand Down Expand Up @@ -624,6 +661,7 @@ declare module 'stripe' {

type Type =
| 'au_becs_debit'
| 'bacs_debit'
| 'card'
| 'card_present'
| 'fpx'
Expand Down
6 changes: 3 additions & 3 deletions types/2020-03-02/Persons.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ declare module 'stripe' {
requirements?: Person.Requirements | null;

/**
* Whether the last 4 digits of this person's SSN have been provided.
* Whether the last four digits of the person's Social Security number have been provided (U.S. only).
*/
ssn_last_4_provided?: boolean;

Expand Down Expand Up @@ -515,7 +515,7 @@ declare module 'stripe' {
relationship?: PersonCreateParams.Relationship;

/**
* The last 4 digits of the person's social security number.
* The last four digits of the person's Social Security number (U.S. only).
*/
ssn_last_4?: string;

Expand Down Expand Up @@ -750,7 +750,7 @@ declare module 'stripe' {
relationship?: PersonUpdateParams.Relationship;

/**
* The last 4 digits of the person's social security number.
* The last four digits of the person's Social Security number (U.S. only).
*/
ssn_last_4?: string;

Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/Plans.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ declare module 'stripe' {

class PlansResource {
/**
* You can create plans using the API, or in the Stripe [Dashboard](https://dashboard.stripe.com/subscriptions/products).
* You can create plans using the API, or in the Stripe [Dashboard](https://dashboard.stripe.com/products).
*/
create(
params: PlanCreateParams,
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/Tokens.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ declare module 'stripe' {
relationship?: Person.Relationship;

/**
* The last 4 digits of the person's social security number.
* The last four digits of the person's Social Security number (U.S. only).
*/
ssn_last_4?: string;

Expand Down