@stripe/stripe-js 1.47.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pure.esm.js +1 -1
- package/dist/pure.js +1 -1
- package/dist/stripe.esm.js +1 -1
- package/dist/stripe.js +1 -1
- package/package.json +1 -1
- package/types/stripe-js/elements/{pay-button.d.ts → express-checkout.d.ts} +106 -87
- package/types/stripe-js/elements/index.d.ts +1 -1
- package/types/stripe-js/elements-group.d.ts +12 -10
- package/types/stripe-js/payment-intents.d.ts +35 -0
- package/types/stripe-js/setup-intents.d.ts +27 -0
- package/types/stripe-js/stripe.d.ts +34 -0
package/dist/pure.esm.js
CHANGED
package/dist/pure.js
CHANGED
package/dist/stripe.esm.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -1,184 +1,203 @@
|
|
|
1
1
|
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type StripeExpressCheckoutElement = StripeElementBase & {
|
|
5
5
|
/**
|
|
6
6
|
* Triggered when the element is fully rendered and can accept `element.focus` calls.
|
|
7
7
|
*/
|
|
8
8
|
on(
|
|
9
9
|
eventType: 'ready',
|
|
10
|
-
handler: (event:
|
|
11
|
-
):
|
|
10
|
+
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
|
|
11
|
+
): StripeExpressCheckoutElement;
|
|
12
12
|
once(
|
|
13
13
|
eventType: 'ready',
|
|
14
|
-
handler: (event:
|
|
15
|
-
):
|
|
14
|
+
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
|
|
15
|
+
): StripeExpressCheckoutElement;
|
|
16
16
|
off(
|
|
17
17
|
eventType: 'ready',
|
|
18
|
-
handler?: (event:
|
|
19
|
-
):
|
|
18
|
+
handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
|
|
19
|
+
): StripeExpressCheckoutElement;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Triggered when a button on the element is clicked.
|
|
23
23
|
*/
|
|
24
24
|
on(
|
|
25
25
|
eventType: 'click',
|
|
26
|
-
handler: (event:
|
|
27
|
-
):
|
|
26
|
+
handler: (event: StripeExpressCheckoutElementClickEvent) => any
|
|
27
|
+
): StripeExpressCheckoutElement;
|
|
28
28
|
once(
|
|
29
29
|
eventType: 'click',
|
|
30
|
-
handler: (event:
|
|
31
|
-
):
|
|
30
|
+
handler: (event: StripeExpressCheckoutElementClickEvent) => any
|
|
31
|
+
): StripeExpressCheckoutElement;
|
|
32
32
|
off(
|
|
33
33
|
eventType: 'click',
|
|
34
|
-
handler?: (event:
|
|
35
|
-
):
|
|
34
|
+
handler?: (event: StripeExpressCheckoutElementClickEvent) => any
|
|
35
|
+
): StripeExpressCheckoutElement;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Triggered when the element gains focus.
|
|
39
39
|
*/
|
|
40
40
|
on(
|
|
41
41
|
eventType: 'focus',
|
|
42
|
-
handler: (event: {elementType: '
|
|
43
|
-
):
|
|
42
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
43
|
+
): StripeExpressCheckoutElement;
|
|
44
44
|
once(
|
|
45
45
|
eventType: 'focus',
|
|
46
|
-
handler: (event: {elementType: '
|
|
47
|
-
):
|
|
46
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
47
|
+
): StripeExpressCheckoutElement;
|
|
48
48
|
off(
|
|
49
49
|
eventType: 'focus',
|
|
50
|
-
handler?: (event: {elementType: '
|
|
51
|
-
):
|
|
50
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
51
|
+
): StripeExpressCheckoutElement;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Triggered when the element loses focus.
|
|
55
55
|
*/
|
|
56
56
|
on(
|
|
57
57
|
eventType: 'blur',
|
|
58
|
-
handler: (event: {elementType: '
|
|
59
|
-
):
|
|
58
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
59
|
+
): StripeExpressCheckoutElement;
|
|
60
60
|
once(
|
|
61
61
|
eventType: 'blur',
|
|
62
|
-
handler: (event: {elementType: '
|
|
63
|
-
):
|
|
62
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
63
|
+
): StripeExpressCheckoutElement;
|
|
64
64
|
off(
|
|
65
65
|
eventType: 'blur',
|
|
66
|
-
handler?: (event: {elementType: '
|
|
67
|
-
):
|
|
66
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
67
|
+
): StripeExpressCheckoutElement;
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* Triggered when the escape key is pressed within the element.
|
|
71
71
|
*/
|
|
72
72
|
on(
|
|
73
73
|
eventType: 'escape',
|
|
74
|
-
handler: (event: {elementType: '
|
|
75
|
-
):
|
|
74
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
75
|
+
): StripeExpressCheckoutElement;
|
|
76
76
|
once(
|
|
77
77
|
eventType: 'escape',
|
|
78
|
-
handler: (event: {elementType: '
|
|
79
|
-
):
|
|
78
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
79
|
+
): StripeExpressCheckoutElement;
|
|
80
80
|
off(
|
|
81
81
|
eventType: 'escape',
|
|
82
|
-
handler?: (event: {elementType: '
|
|
83
|
-
):
|
|
82
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
83
|
+
): StripeExpressCheckoutElement;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Triggered when the element fails to load.
|
|
87
87
|
*/
|
|
88
88
|
on(
|
|
89
89
|
eventType: 'loaderror',
|
|
90
|
-
handler: (event: {
|
|
91
|
-
|
|
90
|
+
handler: (event: {
|
|
91
|
+
elementType: 'expressCheckout';
|
|
92
|
+
error: StripeError;
|
|
93
|
+
}) => any
|
|
94
|
+
): StripeExpressCheckoutElement;
|
|
92
95
|
once(
|
|
93
96
|
eventType: 'loaderror',
|
|
94
|
-
handler: (event: {
|
|
95
|
-
|
|
97
|
+
handler: (event: {
|
|
98
|
+
elementType: 'expressCheckout';
|
|
99
|
+
error: StripeError;
|
|
100
|
+
}) => any
|
|
101
|
+
): StripeExpressCheckoutElement;
|
|
96
102
|
off(
|
|
97
103
|
eventType: 'loaderror',
|
|
98
|
-
handler?: (event: {
|
|
99
|
-
|
|
104
|
+
handler?: (event: {
|
|
105
|
+
elementType: 'expressCheckout';
|
|
106
|
+
error: StripeError;
|
|
107
|
+
}) => any
|
|
108
|
+
): StripeExpressCheckoutElement;
|
|
100
109
|
|
|
101
110
|
/**
|
|
102
111
|
* Triggered when a buyer authorizes a payment within a supported payment method.
|
|
103
112
|
*/
|
|
104
113
|
on(
|
|
105
114
|
eventType: 'confirm',
|
|
106
|
-
handler: (event:
|
|
107
|
-
):
|
|
115
|
+
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
|
|
116
|
+
): StripeExpressCheckoutElement;
|
|
108
117
|
once(
|
|
109
118
|
eventType: 'confirm',
|
|
110
|
-
handler: (event:
|
|
111
|
-
):
|
|
119
|
+
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
|
|
120
|
+
): StripeExpressCheckoutElement;
|
|
112
121
|
off(
|
|
113
122
|
eventType: 'confirm',
|
|
114
|
-
handler?: (event:
|
|
115
|
-
):
|
|
123
|
+
handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
|
|
124
|
+
): StripeExpressCheckoutElement;
|
|
116
125
|
|
|
117
126
|
/**
|
|
118
127
|
* Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
|
|
119
128
|
*/
|
|
120
129
|
on(
|
|
121
130
|
eventType: 'cancel',
|
|
122
|
-
handler: (event: {elementType: '
|
|
123
|
-
):
|
|
131
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
132
|
+
): StripeExpressCheckoutElement;
|
|
124
133
|
once(
|
|
125
134
|
eventType: 'cancel',
|
|
126
|
-
handler: (event: {elementType: '
|
|
127
|
-
):
|
|
135
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
136
|
+
): StripeExpressCheckoutElement;
|
|
128
137
|
off(
|
|
129
138
|
eventType: 'cancel',
|
|
130
|
-
handler?: (event: {elementType: '
|
|
131
|
-
):
|
|
139
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
140
|
+
): StripeExpressCheckoutElement;
|
|
132
141
|
|
|
133
142
|
/**
|
|
134
143
|
* Triggered when a buyer selects a different shipping address.
|
|
135
144
|
*/
|
|
136
145
|
on(
|
|
137
146
|
eventType: 'shippingaddresschange',
|
|
138
|
-
handler: (
|
|
139
|
-
|
|
147
|
+
handler: (
|
|
148
|
+
event: StripeExpressCheckoutElementShippingAddressChangeEvent
|
|
149
|
+
) => any
|
|
150
|
+
): StripeExpressCheckoutElement;
|
|
140
151
|
once(
|
|
141
152
|
eventType: 'shippingaddresschange',
|
|
142
|
-
handler: (
|
|
143
|
-
|
|
153
|
+
handler: (
|
|
154
|
+
event: StripeExpressCheckoutElementShippingAddressChangeEvent
|
|
155
|
+
) => any
|
|
156
|
+
): StripeExpressCheckoutElement;
|
|
144
157
|
off(
|
|
145
158
|
eventType: 'shippingaddresschange',
|
|
146
|
-
handler?: (
|
|
147
|
-
|
|
159
|
+
handler?: (
|
|
160
|
+
event: StripeExpressCheckoutElementShippingAddressChangeEvent
|
|
161
|
+
) => any
|
|
162
|
+
): StripeExpressCheckoutElement;
|
|
148
163
|
|
|
149
164
|
/**
|
|
150
165
|
* Triggered when a buyer selects a different shipping rate.
|
|
151
166
|
*/
|
|
152
167
|
on(
|
|
153
168
|
eventType: 'shippingratechange',
|
|
154
|
-
handler: (event:
|
|
155
|
-
):
|
|
169
|
+
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
|
|
170
|
+
): StripeExpressCheckoutElement;
|
|
156
171
|
once(
|
|
157
172
|
eventType: 'shippingratechange',
|
|
158
|
-
handler: (event:
|
|
159
|
-
):
|
|
173
|
+
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
|
|
174
|
+
): StripeExpressCheckoutElement;
|
|
160
175
|
off(
|
|
161
176
|
eventType: 'shippingratechange',
|
|
162
|
-
handler?: (
|
|
163
|
-
|
|
177
|
+
handler?: (
|
|
178
|
+
event: StripeExpressCheckoutElementShippingRateChangeEvent
|
|
179
|
+
) => any
|
|
180
|
+
): StripeExpressCheckoutElement;
|
|
164
181
|
|
|
165
182
|
/**
|
|
166
|
-
* Updates the options the `
|
|
183
|
+
* Updates the options the `ExpressCheckoutElement` was initialized with.
|
|
167
184
|
* Updates are merged into the existing configuration.
|
|
168
185
|
*/
|
|
169
|
-
update(
|
|
186
|
+
update(
|
|
187
|
+
options: StripeExpressCheckoutElementUpdateOptions
|
|
188
|
+
): StripeExpressCheckoutElement;
|
|
170
189
|
};
|
|
171
190
|
|
|
172
|
-
export type PaymentMethodType = 'google_pay' | 'apple_pay';
|
|
191
|
+
export type PaymentMethodType = 'google_pay' | 'apple_pay' | 'link';
|
|
173
192
|
|
|
174
|
-
export type
|
|
193
|
+
export type ExpressCheckoutPartialAddress = {
|
|
175
194
|
city: string;
|
|
176
195
|
state: string;
|
|
177
196
|
postal_code: string;
|
|
178
197
|
country: string;
|
|
179
198
|
};
|
|
180
199
|
|
|
181
|
-
export type
|
|
200
|
+
export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & {
|
|
182
201
|
line1: string;
|
|
183
202
|
line2: string | null;
|
|
184
203
|
};
|
|
@@ -187,12 +206,12 @@ export type BillingDetails = {
|
|
|
187
206
|
name: string;
|
|
188
207
|
email?: string;
|
|
189
208
|
phone?: string;
|
|
190
|
-
address:
|
|
209
|
+
address: ExpressCheckoutAddress;
|
|
191
210
|
};
|
|
192
211
|
|
|
193
212
|
export type ShippingAddress = {
|
|
194
213
|
name: string;
|
|
195
|
-
address:
|
|
214
|
+
address: ExpressCheckoutAddress;
|
|
196
215
|
};
|
|
197
216
|
|
|
198
217
|
export type LineItem = {
|
|
@@ -226,11 +245,11 @@ export type LayoutOption =
|
|
|
226
245
|
visibleButtonCount?: number;
|
|
227
246
|
};
|
|
228
247
|
|
|
229
|
-
export type
|
|
248
|
+
export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never';
|
|
230
249
|
|
|
231
|
-
export type
|
|
232
|
-
applePay?:
|
|
233
|
-
googlePay?:
|
|
250
|
+
export type ExpressCheckoutWalletsOption = {
|
|
251
|
+
applePay?: ExpressCheckoutWalletOption;
|
|
252
|
+
googlePay?: ExpressCheckoutWalletOption;
|
|
234
253
|
};
|
|
235
254
|
|
|
236
255
|
export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
|
|
@@ -273,7 +292,7 @@ export type ButtonTypeOption = {
|
|
|
273
292
|
googlePay?: GooglePayButtonType;
|
|
274
293
|
};
|
|
275
294
|
|
|
276
|
-
export interface
|
|
295
|
+
export interface StripeExpressCheckoutElementOptions {
|
|
277
296
|
/**
|
|
278
297
|
* Manually sets the height of the buttons shown.
|
|
279
298
|
*/
|
|
@@ -295,21 +314,21 @@ export interface StripePayButtonElementOptions {
|
|
|
295
314
|
layout?: LayoutOption;
|
|
296
315
|
|
|
297
316
|
/**
|
|
298
|
-
* Override the order in which payment methods are displayed in the
|
|
299
|
-
* By default, the
|
|
317
|
+
* Override the order in which payment methods are displayed in the Express Checkout Element.
|
|
318
|
+
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
|
|
300
319
|
*/
|
|
301
320
|
paymentMethodOrder?: string[];
|
|
302
321
|
|
|
303
322
|
/**
|
|
304
|
-
* Control wallets display in the
|
|
323
|
+
* Control wallets display in the Express Checkout Element.
|
|
305
324
|
*/
|
|
306
|
-
wallets?:
|
|
325
|
+
wallets?: ExpressCheckoutWalletsOption;
|
|
307
326
|
}
|
|
308
327
|
|
|
309
328
|
/*
|
|
310
329
|
* Updatable options for an `Elements` instance
|
|
311
330
|
*/
|
|
312
|
-
export interface
|
|
331
|
+
export interface StripeExpressCheckoutElementUpdateOptions {
|
|
313
332
|
/**
|
|
314
333
|
* Manually sets the height of the buttons shown.
|
|
315
334
|
*/
|
|
@@ -322,7 +341,7 @@ export interface StripePayButtonElementUpdateOptions {
|
|
|
322
341
|
|
|
323
342
|
/**
|
|
324
343
|
* Override the order in which payment methods are displayed in the Pay Button Element.
|
|
325
|
-
* By default, the
|
|
344
|
+
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
|
|
326
345
|
*/
|
|
327
346
|
paymentMethodOrder?: string[];
|
|
328
347
|
}
|
|
@@ -332,11 +351,11 @@ export type AvailablePaymentMethods = {
|
|
|
332
351
|
googlePay: boolean;
|
|
333
352
|
};
|
|
334
353
|
|
|
335
|
-
export interface
|
|
354
|
+
export interface StripeExpressCheckoutElementReadyEvent {
|
|
336
355
|
/**
|
|
337
356
|
* The type of element that emitted this event.
|
|
338
357
|
*/
|
|
339
|
-
elementType: '
|
|
358
|
+
elementType: 'expressCheckout';
|
|
340
359
|
|
|
341
360
|
/**
|
|
342
361
|
* The list of payment methods that could possibly show in the element, or undefined if no payment methods can show.
|
|
@@ -395,11 +414,11 @@ export type ClickResolveDetails = {
|
|
|
395
414
|
applePay?: ApplePayOption;
|
|
396
415
|
};
|
|
397
416
|
|
|
398
|
-
export interface
|
|
417
|
+
export interface StripeExpressCheckoutElementClickEvent {
|
|
399
418
|
/**
|
|
400
419
|
* The type of element that emitted this event.
|
|
401
420
|
*/
|
|
402
|
-
elementType: '
|
|
421
|
+
elementType: 'expressCheckout';
|
|
403
422
|
|
|
404
423
|
/**
|
|
405
424
|
* The payment method associated with the button that was clicked.
|
|
@@ -413,7 +432,7 @@ export interface StripePayButtonElementClickEvent {
|
|
|
413
432
|
resolve: (resolveDetails?: ClickResolveDetails) => void;
|
|
414
433
|
}
|
|
415
434
|
|
|
416
|
-
export interface
|
|
435
|
+
export interface StripeExpressCheckoutElementConfirmEvent {
|
|
417
436
|
/**
|
|
418
437
|
* Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface.
|
|
419
438
|
*/
|
|
@@ -435,14 +454,14 @@ export type ChangeResolveDetails = {
|
|
|
435
454
|
shippingRates?: Array<ShippingRate>;
|
|
436
455
|
};
|
|
437
456
|
|
|
438
|
-
export interface
|
|
457
|
+
export interface StripeExpressCheckoutElementShippingAddressChangeEvent {
|
|
439
458
|
name: string;
|
|
440
|
-
address:
|
|
459
|
+
address: ExpressCheckoutPartialAddress;
|
|
441
460
|
resolve: (resolveDetails?: ChangeResolveDetails) => void;
|
|
442
461
|
reject: () => void;
|
|
443
462
|
}
|
|
444
463
|
|
|
445
|
-
export interface
|
|
464
|
+
export interface StripeExpressCheckoutElementShippingRateChangeEvent {
|
|
446
465
|
shippingRate: ShippingRate;
|
|
447
466
|
resolve: (resolveDetails?: ChangeResolveDetails) => void;
|
|
448
467
|
reject: () => void;
|
|
@@ -10,12 +10,12 @@ export * from './card-number';
|
|
|
10
10
|
export * from './card';
|
|
11
11
|
export * from './cart';
|
|
12
12
|
export * from './eps-bank';
|
|
13
|
+
export * from './express-checkout';
|
|
13
14
|
export * from './fpx-bank';
|
|
14
15
|
export * from './iban';
|
|
15
16
|
export * from './ideal-bank';
|
|
16
17
|
export * from './link-authentication';
|
|
17
18
|
export * from './p24-bank';
|
|
18
|
-
export * from './pay-button';
|
|
19
19
|
export * from './payment-request-button';
|
|
20
20
|
export * from './payment';
|
|
21
21
|
export * from './shipping-address';
|
|
@@ -47,8 +47,8 @@ import {
|
|
|
47
47
|
StripeIssuingCardPinDisplayElementOptions,
|
|
48
48
|
StripeIssuingCardCopyButtonElement,
|
|
49
49
|
StripeIssuingCardCopyButtonElementOptions,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
StripeExpressCheckoutElement,
|
|
51
|
+
StripeExpressCheckoutElementOptions,
|
|
52
52
|
} from './elements';
|
|
53
53
|
|
|
54
54
|
export interface StripeElements {
|
|
@@ -367,19 +367,19 @@ export interface StripeElements {
|
|
|
367
367
|
): StripeLinkAuthenticationElement | null;
|
|
368
368
|
|
|
369
369
|
/////////////////////////////
|
|
370
|
-
///
|
|
370
|
+
/// expressCheckout
|
|
371
371
|
/////////////////////////////
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
374
|
* Requires beta access:
|
|
375
375
|
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
376
376
|
*
|
|
377
|
-
* Creates a `
|
|
377
|
+
* Creates a `ExpressCheckoutElement`.
|
|
378
378
|
*/
|
|
379
379
|
create(
|
|
380
|
-
elementType: '
|
|
381
|
-
options?:
|
|
382
|
-
):
|
|
380
|
+
elementType: 'expressCheckout',
|
|
381
|
+
options?: StripeExpressCheckoutElementOptions
|
|
382
|
+
): StripeExpressCheckoutElement;
|
|
383
383
|
|
|
384
384
|
/**
|
|
385
385
|
* Requires beta access:
|
|
@@ -387,7 +387,9 @@ export interface StripeElements {
|
|
|
387
387
|
*
|
|
388
388
|
* Looks up a previously created `Element` by its type.
|
|
389
389
|
*/
|
|
390
|
-
getElement(
|
|
390
|
+
getElement(
|
|
391
|
+
elementType: 'expressCheckout'
|
|
392
|
+
): StripeExpressCheckoutElement | null;
|
|
391
393
|
|
|
392
394
|
/////////////////////////////
|
|
393
395
|
/// payment
|
|
@@ -520,11 +522,11 @@ export type StripeElementType =
|
|
|
520
522
|
| 'cardCvc'
|
|
521
523
|
| 'cart'
|
|
522
524
|
| 'epsBank'
|
|
525
|
+
| 'expressCheckout'
|
|
523
526
|
| 'fpxBank'
|
|
524
527
|
| 'iban'
|
|
525
528
|
| 'idealBank'
|
|
526
529
|
| 'p24Bank'
|
|
527
|
-
| 'payButton'
|
|
528
530
|
| 'payment'
|
|
529
531
|
| 'paymentMethodMessaging'
|
|
530
532
|
| 'paymentRequestButton'
|
|
@@ -551,7 +553,7 @@ export type StripeElement =
|
|
|
551
553
|
| StripeIbanElement
|
|
552
554
|
| StripeIdealBankElement
|
|
553
555
|
| StripeP24BankElement
|
|
554
|
-
|
|
|
556
|
+
| StripeExpressCheckoutElement
|
|
555
557
|
| StripePaymentElement
|
|
556
558
|
| StripePaymentMethodMessagingElement
|
|
557
559
|
| StripePaymentRequestButtonElement
|
|
@@ -22,6 +22,7 @@ export type CreatePaymentMethodData =
|
|
|
22
22
|
| CreatePaymentMethodBancontactData
|
|
23
23
|
| CreatePaymentMethodBoletoData
|
|
24
24
|
| CreatePaymentMethodCardData
|
|
25
|
+
| CreatePaymentMethodCashappData
|
|
25
26
|
| CreatePaymentMethodCustomerBalanceData
|
|
26
27
|
| CreatePaymentMethodEpsData
|
|
27
28
|
| CreatePaymentMethodGiropayData
|
|
@@ -122,6 +123,10 @@ export interface CreatePaymentMethodCardData extends PaymentMethodCreateParams {
|
|
|
122
123
|
card: StripeCardElement | StripeCardNumberElement | {token: string};
|
|
123
124
|
}
|
|
124
125
|
|
|
126
|
+
interface CreatePaymentMethodCashappData extends PaymentMethodCreateParams {
|
|
127
|
+
type: 'cashapp';
|
|
128
|
+
}
|
|
129
|
+
|
|
125
130
|
export interface CreatePaymentMethodCustomerBalanceData
|
|
126
131
|
extends PaymentMethodCreateParams {
|
|
127
132
|
/**
|
|
@@ -643,6 +648,36 @@ export interface ConfirmCardPaymentOptions {
|
|
|
643
648
|
handleActions?: boolean;
|
|
644
649
|
}
|
|
645
650
|
|
|
651
|
+
/**
|
|
652
|
+
* Data to be sent with a `stripe.confirmCashappPayment` request.
|
|
653
|
+
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
|
|
654
|
+
*/
|
|
655
|
+
interface ConfirmCashappPaymentData extends PaymentIntentConfirmParams {
|
|
656
|
+
/**
|
|
657
|
+
* The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
658
|
+
* This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created.
|
|
659
|
+
*
|
|
660
|
+
* @recommended
|
|
661
|
+
*/
|
|
662
|
+
payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* The url your customer will be directed to after they complete authentication.
|
|
666
|
+
*/
|
|
667
|
+
return_url?: string;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* An options object to control the behavior of `stripe.confirmCashappPayment`.
|
|
672
|
+
*/
|
|
673
|
+
interface ConfirmCashappPaymentOptions {
|
|
674
|
+
/**
|
|
675
|
+
* Set this to `false` if you want to [manually handle the authorization QR code or redirect](https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=API#handle-redirect).
|
|
676
|
+
* Default is `true`.
|
|
677
|
+
*/
|
|
678
|
+
handleActions?: boolean;
|
|
679
|
+
}
|
|
680
|
+
|
|
646
681
|
/**
|
|
647
682
|
* Data to be sent with a `stripe.confirmCustomerBalancePayment` request.
|
|
648
683
|
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
CreatePaymentMethodAuBecsDebitData,
|
|
6
6
|
CreatePaymentMethodBancontactData,
|
|
7
7
|
CreatePaymentMethodCardData,
|
|
8
|
+
CreatePaymentMethodCashappData,
|
|
8
9
|
CreatePaymentMethodIdealData,
|
|
9
10
|
CreatePaymentMethodSepaDebitData,
|
|
10
11
|
CreatePaymentMethodSofortData,
|
|
@@ -41,6 +42,32 @@ export interface ConfirmCardSetupOptions {
|
|
|
41
42
|
handleActions?: boolean;
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
interface ConfirmCashappSetupData extends SetupIntentConfirmParams {
|
|
46
|
+
/*
|
|
47
|
+
* Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
|
48
|
+
* This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
|
|
49
|
+
*
|
|
50
|
+
* @recommended
|
|
51
|
+
*/
|
|
52
|
+
payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The url your customer will be directed to after they complete authentication.
|
|
56
|
+
*/
|
|
57
|
+
return_url?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* An options object to control the behavior of `stripe.confirmCashappSetup`.
|
|
62
|
+
*/
|
|
63
|
+
interface ConfirmCashappSetupOptions {
|
|
64
|
+
/*
|
|
65
|
+
* Set this to `false` if you want to [manually handle the authorization QR code or redirect](https://stripe.com/docs/payments/cash-app-pay/set-up-payment?platform=web&ui=API#web-create-setup-intent).
|
|
66
|
+
* Default is `true`.
|
|
67
|
+
*/
|
|
68
|
+
handleActions?: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
44
71
|
/**
|
|
45
72
|
* Data to be sent with a `stripe.confirmIdealSetup` request.
|
|
46
73
|
* Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
|
@@ -194,6 +194,23 @@ export interface Stripe {
|
|
|
194
194
|
options?: paymentIntents.ConfirmCardPaymentOptions
|
|
195
195
|
): Promise<PaymentIntentResult>;
|
|
196
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Use `stripe.confirmCashappPayment` in the [Cash App Payments](https://stripe.com/docs/payments/cash-app-pay) with Payment Methods flow when the customer submits your payment form.
|
|
199
|
+
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
|
|
200
|
+
* Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details.
|
|
201
|
+
*
|
|
202
|
+
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
203
|
+
* In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
|
|
204
|
+
* If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
|
|
205
|
+
*
|
|
206
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_payment
|
|
207
|
+
*/
|
|
208
|
+
confirmCashappPayment(
|
|
209
|
+
clientSecret: string,
|
|
210
|
+
data?: paymentIntents.ConfirmCashappPaymentData,
|
|
211
|
+
options?: paymentIntents.ConfirmCashappPaymentOptions
|
|
212
|
+
): Promise<PaymentIntentResult>;
|
|
213
|
+
|
|
197
214
|
/**
|
|
198
215
|
* Requires beta access:
|
|
199
216
|
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
@@ -697,6 +714,23 @@ export interface Stripe {
|
|
|
697
714
|
options?: setupIntents.ConfirmCardSetupOptions
|
|
698
715
|
): Promise<SetupIntentResult>;
|
|
699
716
|
|
|
717
|
+
/**
|
|
718
|
+
* Use `stripe.confirmCashappSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form.
|
|
719
|
+
* When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide.
|
|
720
|
+
* Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details..
|
|
721
|
+
*
|
|
722
|
+
* When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
723
|
+
* In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
|
|
724
|
+
* It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
|
|
725
|
+
*
|
|
726
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_setup
|
|
727
|
+
*/
|
|
728
|
+
confirmCashappSetup(
|
|
729
|
+
clientSecret: string,
|
|
730
|
+
data?: setupIntents.ConfirmCashappSetupData,
|
|
731
|
+
options?: setupIntents.ConfirmCashappSetupOptions
|
|
732
|
+
): Promise<SetupIntentResult>;
|
|
733
|
+
|
|
700
734
|
/**
|
|
701
735
|
* Use `stripe.confirmIdealSetup` in the [Set up future payments](https://stripe.com/docs/payments/ideal/set-up-payment) flow to use iDEAL bank details to set up a SEPA Direct Debit payment method for future payments.
|
|
702
736
|
* When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
|