1 | import {SourceCreateParams} from '../api';
|
2 |
|
3 | /**
|
4 | * An object containing the unique ID and client secret for a `Source`.
|
5 | *
|
6 | * You can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys.
|
7 | */
|
8 | export interface RetrieveSourceParam {
|
9 | /**
|
10 | * Unique identifier of the `Source`.
|
11 | */
|
12 | id: string;
|
13 |
|
14 | /**
|
15 | * A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client.
|
16 | */
|
17 | client_secret: string;
|
18 | }
|
19 |
|
20 | /**
|
21 | * An object containing additional payment information you might have collected.
|
22 | *
|
23 | * Although these fields are optional, we highly recommend collecting name and address.
|
24 | * This information can be used to perform a number of verifications, such as CVC, ZIP, and address verification.
|
25 | * Radar includes built-in rules that can block payments where the ZIP or CVC verifications with the cardholder’s bank failed.
|
26 | */
|
27 | export interface CreateTokenCardData {
|
28 | /**
|
29 | * @recommended
|
30 | */
|
31 | name?: string;
|
32 |
|
33 | address_line1?: string;
|
34 |
|
35 | address_line2?: string;
|
36 |
|
37 | address_city?: string;
|
38 |
|
39 | address_state?: string;
|
40 |
|
41 | address_zip?: string;
|
42 |
|
43 | /**
|
44 | * A two character country code (for example, `US`).
|
45 | *
|
46 | * @recommended
|
47 | */
|
48 | address_country?: string;
|
49 |
|
50 | /**
|
51 | * Required in order to [add the card to a Connect account](https://stripe.com/docs/connect/payouts#bank-accounts) (in all other cases, this parameter is not used).
|
52 | * Currently, the only supported currency for debit card payouts is `usd`.
|
53 | */
|
54 | currency?: string;
|
55 | }
|
56 |
|
57 | export interface CreateTokenIbanData {
|
58 | /**
|
59 | * Three character currency code (e.g., `eur`).
|
60 | */
|
61 | currency: string;
|
62 |
|
63 | account_holder_name: string;
|
64 |
|
65 | account_holder_type: string;
|
66 | }
|
67 |
|
68 | export interface CreateTokenPiiData {
|
69 | personal_id_number: string;
|
70 | }
|
71 |
|
72 | export interface CreateTokenBankAccountData {
|
73 | country: string;
|
74 |
|
75 | currency: string;
|
76 |
|
77 | routing_number?: string;
|
78 |
|
79 | account_number: string;
|
80 |
|
81 | account_holder_name?: string;
|
82 |
|
83 | account_holder_type: string;
|
84 |
|
85 | account_type?: string;
|
86 | }
|
87 |
|
88 | /**
|
89 | * A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.
|
90 | * See the [Sources API](https://stripe.com/docs/api#create_source) reference for details.
|
91 | *
|
92 | * You cannot pass raw card information to `stripe.createSource(sourceData)`.
|
93 | * Instead, you must gather card information in an `Element` and use `stripe.createSource(element, sourceData)`.
|
94 | * You can also pass an existing card token to convert it into a `Source` object.
|
95 | */
|
96 | export interface CreateSourceData extends SourceCreateParams {
|
97 | bancontact?: CreateSourceData.DeprecatedMethodData;
|
98 |
|
99 | ideal?: CreateSourceData.DeprecatedMethodData;
|
100 |
|
101 | klarna?: CreateSourceData.DeprecatedMethodData;
|
102 |
|
103 | sepa_debit?: CreateSourceData.DeprecatedMethodData;
|
104 |
|
105 | sofort?: CreateSourceData.DeprecatedMethodData;
|
106 | }
|
107 |
|
108 | export namespace CreateSourceData {
|
109 | export type DeprecatedMethodData = Record<string, unknown>;
|
110 | }
|