1 | import {SetupIntentConfirmParams} from '../api';
|
2 |
|
3 | import {
|
4 | CreatePaymentMethodAcssDebitData,
|
5 | CreatePaymentMethodAuBecsDebitData,
|
6 | CreatePaymentMethodBancontactData,
|
7 | CreatePaymentMethodCardData,
|
8 | CreatePaymentMethodIdealData,
|
9 | CreatePaymentMethodSepaDebitData,
|
10 | CreatePaymentMethodSofortData,
|
11 | CreatePaymentMethodPayPalData,
|
12 | CreatePaymentMethodBacsDebitData,
|
13 | CreatePaymentMethodUsBankAccountData,
|
14 | CollectBankAccountParams,
|
15 | } from './payment-intents';
|
16 |
|
17 | import {Omit} from '../utils';
|
18 |
|
19 | /**
|
20 | * Data to be sent with a `stripe.confirmCardSetup` request.
|
21 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
22 | */
|
23 | export interface ConfirmCardSetupData extends SetupIntentConfirmParams {
|
24 | /*
|
25 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
26 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
27 | *
|
28 | * @recommended
|
29 | */
|
30 | payment_method?: string | Omit<CreatePaymentMethodCardData, 'type'>;
|
31 | }
|
32 |
|
33 | /**
|
34 | * An options object to control the behavior of `stripe.confirmCardSetup`.
|
35 | */
|
36 | export interface ConfirmCardSetupOptions {
|
37 | /*
|
38 | * Set this to `false` if you want to [handle next actions yourself](https://stripe.com/docs/payments/payment-intents/verifying-status#next-actions), or if you want to defer next action handling until later (e.g. for use in the [PaymentRequest API](https://stripe.com/docs/stripe-js/elements/payment-request-button#complete-payment-intents)).
|
39 | * Default is `true`.
|
40 | */
|
41 | handleActions?: boolean;
|
42 | }
|
43 |
|
44 | /**
|
45 | * Data to be sent with a `stripe.confirmIdealSetup` request.
|
46 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
47 | */
|
48 | export interface ConfirmIdealSetupData extends SetupIntentConfirmParams {
|
49 | /*
|
50 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
51 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
52 | *
|
53 | * @recommended
|
54 | */
|
55 | payment_method?: string | Omit<CreatePaymentMethodIdealData, 'type'>;
|
56 | }
|
57 |
|
58 | /**
|
59 | * Data to be sent with a `stripe.confirmIdealSetup` request.
|
60 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
61 | */
|
62 | export interface ConfirmPayPalSetupData extends SetupIntentConfirmParams {
|
63 | /*
|
64 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
65 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
66 | *
|
67 | * @recommended
|
68 | */
|
69 | payment_method?: string | Omit<CreatePaymentMethodPayPalData, 'type'>;
|
70 |
|
71 | /**
|
72 | * The required url your customer will be directed to after they complete authentication.
|
73 | */
|
74 | return_url: string;
|
75 | }
|
76 |
|
77 | /**
|
78 | * Data to be sent with a `stripe.confirmSepaDebitSetup` request.
|
79 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
80 | */
|
81 | export interface ConfirmSepaDebitSetupData extends SetupIntentConfirmParams {
|
82 | /*
|
83 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
84 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
85 | *
|
86 | * @recommended
|
87 | */
|
88 | payment_method?: string | Omit<CreatePaymentMethodSepaDebitData, 'type'>;
|
89 | }
|
90 |
|
91 | /**
|
92 | * Data to be sent with a `stripe.confirmSofortSetup` request.
|
93 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
94 | */
|
95 | export interface ConfirmSofortSetupData extends SetupIntentConfirmParams {
|
96 | /*
|
97 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
98 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
99 | *
|
100 | * @recommended
|
101 | */
|
102 | payment_method?: string | Omit<CreatePaymentMethodSofortData, 'type'>;
|
103 | }
|
104 |
|
105 | /**
|
106 | * An options object to control the behavior of `stripe.confirmSofortSetup`.
|
107 | */
|
108 | export interface ConfirmSofortSetupOptions {
|
109 | /**
|
110 | * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect).
|
111 | * Default is `true`.
|
112 | */
|
113 | handleActions?: boolean;
|
114 | }
|
115 |
|
116 | /**
|
117 | * Data to be sent with a `stripe.confirmAuBecsDebitSetup` request.
|
118 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
119 | */
|
120 | export interface ConfirmAuBecsDebitSetupData extends SetupIntentConfirmParams {
|
121 | /*
|
122 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
123 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
124 | *
|
125 | * @recommended
|
126 | */
|
127 | payment_method?: string | Omit<CreatePaymentMethodAuBecsDebitData, 'type'>;
|
128 | }
|
129 |
|
130 | /**
|
131 | * Data to be sent with a `stripe.confirmBacsDebitSetup` request.
|
132 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
133 | */
|
134 | export interface ConfirmBacsDebitSetupData extends SetupIntentConfirmParams {
|
135 | /*
|
136 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
137 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
138 | *
|
139 | * @recommended
|
140 | */
|
141 | payment_method?: string | Omit<CreatePaymentMethodBacsDebitData, 'type'>;
|
142 | }
|
143 |
|
144 | /**
|
145 | * Data to be sent with a `stripe.confirmBancontactSetup` request.
|
146 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
147 | */
|
148 | export interface ConfirmBancontactSetupData extends SetupIntentConfirmParams {
|
149 | /*
|
150 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
151 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
152 | *
|
153 | * @recommended
|
154 | */
|
155 | payment_method?: string | Omit<CreatePaymentMethodBancontactData, 'type'>;
|
156 | }
|
157 |
|
158 | /**
|
159 | * Data to be sent with a `stripe.confirmAcssDebitSetup` request.
|
160 | * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
161 | */
|
162 | export interface ConfirmAcssDebitSetupData extends SetupIntentConfirmParams {
|
163 | /**
|
164 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
165 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
166 | *
|
167 | * @recommended
|
168 | */
|
169 | payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>;
|
170 | }
|
171 |
|
172 | /**
|
173 | * An options object to control the behavior of `stripe.confirmAcssDebitSetup`.
|
174 | */
|
175 | export interface ConfirmAcssDebitSetupOptions {
|
176 | /**
|
177 | * Set this to true if you want to skip displaying the mandate confirmation.
|
178 | */
|
179 | skipMandate?: boolean;
|
180 | }
|
181 |
|
182 | /**
|
183 | * Data to be sent with a `stripe.verifyMicrodepositsForSetup` request.
|
184 | */
|
185 | export interface VerifyMicrodepositsForSetupData {
|
186 | /**
|
187 | * An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account.
|
188 | */
|
189 | amounts?: Array<number>;
|
190 |
|
191 | /**
|
192 | * A six-character code starting with SM present in the microdeposit sent to the bank account.
|
193 | */
|
194 | descriptor_code?: string;
|
195 | }
|
196 |
|
197 | export interface ConfirmUsBankAccountSetupData
|
198 | extends SetupIntentConfirmParams {
|
199 | /**
|
200 | * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
201 | * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
202 | *
|
203 | * @recommended
|
204 | */
|
205 | payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>;
|
206 | }
|
207 |
|
208 | /**
|
209 | * Data to be sent with a `stripe.collectBankAccountForSetup` request.
|
210 | */
|
211 | export interface CollectBankAccountForSetupOptions {
|
212 | /**
|
213 | * The client secret of the SetupIntent.
|
214 | */
|
215 | clientSecret: string;
|
216 |
|
217 | params: CollectBankAccountParams;
|
218 |
|
219 | /**
|
220 | * Specifies which fields in the response should be expanded.
|
221 | */
|
222 | expand?: Array<string>;
|
223 | }
|