@stripe/stripe-js 1.48.0 → 1.50.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/api/payment-methods.d.ts +42 -0
- package/types/stripe-js/elements/card.d.ts +43 -1
- package/types/stripe-js/elements/payment-request-button.d.ts +11 -0
- package/types/stripe-js/elements-group.d.ts +92 -8
- package/types/stripe-js/payment-intents.d.ts +41 -0
- package/types/stripe-js/setup-intents.d.ts +27 -0
- package/types/stripe-js/stripe.d.ts +149 -2
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,3 +1,4 @@
|
|
|
1
|
+
import {StripeElement, StripeElements} from '../stripe-js';
|
|
1
2
|
import {Metadata, MetadataParam, Address} from './shared';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -316,6 +317,47 @@ export interface PaymentMethodCreateParams {
|
|
|
316
317
|
type?: string;
|
|
317
318
|
}
|
|
318
319
|
|
|
320
|
+
export interface CreatePaymentMethodFromElements {
|
|
321
|
+
/**
|
|
322
|
+
* The Elements instance
|
|
323
|
+
*
|
|
324
|
+
* @docs https://stripe.com/docs/js/elements_object
|
|
325
|
+
*/
|
|
326
|
+
elements: StripeElements;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Parameters that will be passed on to the PaymentMethod API
|
|
330
|
+
*
|
|
331
|
+
* @docs https://stripe.com/docs/api/payment_methods/create
|
|
332
|
+
*/
|
|
333
|
+
params?: PaymentMethodCreateParams;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
337
|
+
*/
|
|
338
|
+
metadata?: MetadataParam;
|
|
339
|
+
}
|
|
340
|
+
export interface CreatePaymentMethodFromElement {
|
|
341
|
+
/**
|
|
342
|
+
* The specific Element used to collect payment details
|
|
343
|
+
*
|
|
344
|
+
* @docs https://stripe.com/docs/js/element
|
|
345
|
+
*/
|
|
346
|
+
element: StripeElement;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Parameters that will be passed on to the PaymentMethod API
|
|
350
|
+
*
|
|
351
|
+
* @docs https://stripe.com/docs/api/payment_methods/create
|
|
352
|
+
*/
|
|
353
|
+
params?: PaymentMethodCreateParams;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
|
357
|
+
*/
|
|
358
|
+
metadata?: MetadataParam;
|
|
359
|
+
}
|
|
360
|
+
|
|
319
361
|
export namespace PaymentMethodCreateParams {
|
|
320
362
|
export interface BillingDetails {
|
|
321
363
|
/**
|
|
@@ -109,7 +109,7 @@ export type StripeCardElement = StripeElementBase & {
|
|
|
109
109
|
* The styles of an `CardElement` can be dynamically changed using `element.update`.
|
|
110
110
|
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
|
|
111
111
|
*/
|
|
112
|
-
update(options:
|
|
112
|
+
update(options: StripeCardElementUpdateOptions): void;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
export interface StripeCardElementOptions {
|
|
@@ -146,6 +146,48 @@ export interface StripeCardElementOptions {
|
|
|
146
146
|
* Default is false.
|
|
147
147
|
*/
|
|
148
148
|
disabled?: boolean;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Hides and disables the Link Button in the Card Element.
|
|
152
|
+
* Default is false.
|
|
153
|
+
*/
|
|
154
|
+
disableLink?: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface StripeCardElementUpdateOptions {
|
|
158
|
+
classes?: StripeElementClasses;
|
|
159
|
+
|
|
160
|
+
style?: StripeElementStyle;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`).
|
|
164
|
+
* Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled.
|
|
165
|
+
*/
|
|
166
|
+
value?: {postalCode?: string};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Hide the postal code field.
|
|
170
|
+
* Default is `false`.
|
|
171
|
+
* If you are already collecting a full billing address or postal code elsewhere, set this to `true`.
|
|
172
|
+
*/
|
|
173
|
+
hidePostalCode?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Appearance of the icon in the Element.
|
|
177
|
+
*/
|
|
178
|
+
iconStyle?: 'default' | 'solid';
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Hides the icon in the Element.
|
|
182
|
+
* Default is `false`.
|
|
183
|
+
*/
|
|
184
|
+
hideIcon?: boolean;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Applies a disabled state to the Element such that user input is not accepted.
|
|
188
|
+
* Default is false.
|
|
189
|
+
*/
|
|
190
|
+
disabled?: boolean;
|
|
149
191
|
}
|
|
150
192
|
|
|
151
193
|
export interface StripeCardElementChangeEvent extends StripeElementChangeEvent {
|
|
@@ -126,6 +126,11 @@ export interface StripePaymentRequestButtonElementOptions {
|
|
|
126
126
|
* The height of the Payment Request Button. Accepts px unit values.
|
|
127
127
|
*/
|
|
128
128
|
height?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The gap between buttons when multile buttons are shown. Accepts px unit values.
|
|
132
|
+
*/
|
|
133
|
+
buttonSpacing?: string;
|
|
129
134
|
};
|
|
130
135
|
};
|
|
131
136
|
|
|
@@ -133,6 +138,12 @@ export interface StripePaymentRequestButtonElementOptions {
|
|
|
133
138
|
* A `PaymentRequest` object used to configure the element.
|
|
134
139
|
*/
|
|
135
140
|
paymentRequest: PaymentRequest;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Disable showing multiple buttons.
|
|
144
|
+
* Default is `false`.
|
|
145
|
+
*/
|
|
146
|
+
disableMultipleButtons?: boolean;
|
|
136
147
|
}
|
|
137
148
|
|
|
138
149
|
export interface StripePaymentRequestButtonElementClickEvent {
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
StripeExpressCheckoutElement,
|
|
51
51
|
StripeExpressCheckoutElementOptions,
|
|
52
52
|
} from './elements';
|
|
53
|
+
import {StripeError} from './stripe';
|
|
53
54
|
|
|
54
55
|
export interface StripeElements {
|
|
55
56
|
/**
|
|
@@ -64,6 +65,12 @@ export interface StripeElements {
|
|
|
64
65
|
*/
|
|
65
66
|
fetchUpdates(): Promise<{error?: {message: string; status?: string}}>;
|
|
66
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Before confirming payment, call elements.submit() to validate the state of the
|
|
70
|
+
* Payment Element and collect any data required for wallets.
|
|
71
|
+
*/
|
|
72
|
+
submit(): Promise<{error?: StripeError}>;
|
|
73
|
+
|
|
67
74
|
/////////////////////////////
|
|
68
75
|
/// address
|
|
69
76
|
/////////////////////////////
|
|
@@ -619,7 +626,7 @@ export type StripeElementLocale =
|
|
|
619
626
|
/**
|
|
620
627
|
* Options to create an `Elements` instance with.
|
|
621
628
|
*/
|
|
622
|
-
|
|
629
|
+
interface BaseStripeElementsOptions {
|
|
623
630
|
/**
|
|
624
631
|
* An array of custom fonts, which elements created from the `Elements` object can use.
|
|
625
632
|
*/
|
|
@@ -640,13 +647,6 @@ export interface StripeElementsOptions {
|
|
|
640
647
|
*/
|
|
641
648
|
appearance?: Appearance;
|
|
642
649
|
|
|
643
|
-
/**
|
|
644
|
-
* The client secret for a PaymentIntent or SetupIntent used by the Payment Element.
|
|
645
|
-
*
|
|
646
|
-
* @docs https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
|
|
647
|
-
*/
|
|
648
|
-
clientSecret?: string;
|
|
649
|
-
|
|
650
650
|
/**
|
|
651
651
|
* Display skeleton loader UI while waiting for Elements to be fully loaded, after they are mounted.
|
|
652
652
|
* Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
|
|
@@ -664,6 +664,54 @@ export interface StripeElementsOptions {
|
|
|
664
664
|
customerOptions?: CustomerOptions;
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
+
export interface StripeElementsOptionsClientSecret
|
|
668
|
+
extends BaseStripeElementsOptions {
|
|
669
|
+
/**
|
|
670
|
+
* The client secret for a PaymentIntent or SetupIntent used by the Payment Element.
|
|
671
|
+
*
|
|
672
|
+
* @docs https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
|
|
673
|
+
*/
|
|
674
|
+
clientSecret?: string;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
|
|
678
|
+
/**
|
|
679
|
+
* Whether the Payment Element will be used to create a PaymentIntent, SetupIntent, or Subscription.
|
|
680
|
+
*/
|
|
681
|
+
mode?: 'payment' | 'setup' | 'subscription';
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Three character currency code (e.g., usd).
|
|
685
|
+
*/
|
|
686
|
+
currency?: string;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* The amount to be charged. Shown in Apple Pay, Google Pay, or Buy now pay later UIs, and influences available payment methods.
|
|
690
|
+
*/
|
|
691
|
+
amount?: number;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Indicates that you intend to make future payments with this PaymentIntent’s payment method.
|
|
695
|
+
*
|
|
696
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
|
|
697
|
+
*/
|
|
698
|
+
setup_future_usage?: 'off_session' | 'on_session';
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Controls when the funds will be captured from the customer’s account.
|
|
702
|
+
*
|
|
703
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
|
|
704
|
+
*/
|
|
705
|
+
capture_method?: 'manual' | 'automatic';
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Instead of using automatic payment methods, declare specific payment methods to enable.
|
|
709
|
+
*
|
|
710
|
+
* @docs https://stripe.com/docs/payments/payment-methods/overview
|
|
711
|
+
*/
|
|
712
|
+
payment_method_types?: string[];
|
|
713
|
+
}
|
|
714
|
+
|
|
667
715
|
/*
|
|
668
716
|
* Updatable options for an `Elements` instance
|
|
669
717
|
*/
|
|
@@ -682,6 +730,42 @@ export interface StripeElementsUpdateOptions {
|
|
|
682
730
|
* @docs https://stripe.com/docs/stripe-js/appearance-api
|
|
683
731
|
*/
|
|
684
732
|
appearance?: Appearance;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Whether the Payment Element will be used to create a PaymentIntent, SetupIntent, or Subscription.
|
|
736
|
+
*/
|
|
737
|
+
mode?: 'payment' | 'setup' | 'subscription';
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Three character currency code (e.g., usd).
|
|
741
|
+
*/
|
|
742
|
+
currency?: string;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* The amount to be charged. Shown in Apple Pay, Google Pay, or Buy now pay later UIs, and influences available payment methods.
|
|
746
|
+
*/
|
|
747
|
+
amount?: number;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Indicates that you intend to make future payments with this PaymentIntent’s payment method.
|
|
751
|
+
*
|
|
752
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
|
|
753
|
+
*/
|
|
754
|
+
setup_future_usage?: 'off_session' | 'on_session';
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Controls when the funds will be captured from the customer’s account.
|
|
758
|
+
*
|
|
759
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
|
|
760
|
+
*/
|
|
761
|
+
capture_method?: 'manual' | 'automatic';
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Instead of using automatic payment methods, declare specific payment methods to enable.
|
|
765
|
+
*
|
|
766
|
+
* @docs https://stripe.com/docs/payments/payment-methods/overview
|
|
767
|
+
*/
|
|
768
|
+
payment_method_types?: string[];
|
|
685
769
|
}
|
|
686
770
|
|
|
687
771
|
/*
|
|
@@ -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
|
|
@@ -40,6 +41,11 @@ export type CreatePaymentMethodData =
|
|
|
40
41
|
| CreatePaymentMethodSofortData
|
|
41
42
|
| CreatePaymentMethodWechatPayData;
|
|
42
43
|
|
|
44
|
+
export {
|
|
45
|
+
CreatePaymentMethodFromElement,
|
|
46
|
+
CreatePaymentMethodFromElements,
|
|
47
|
+
} from '../api';
|
|
48
|
+
|
|
43
49
|
export interface CreatePaymentMethodAlipayData
|
|
44
50
|
extends PaymentMethodCreateParams {
|
|
45
51
|
type: 'alipay';
|
|
@@ -122,6 +128,11 @@ export interface CreatePaymentMethodCardData extends PaymentMethodCreateParams {
|
|
|
122
128
|
card: StripeCardElement | StripeCardNumberElement | {token: string};
|
|
123
129
|
}
|
|
124
130
|
|
|
131
|
+
export interface CreatePaymentMethodCashappData
|
|
132
|
+
extends PaymentMethodCreateParams {
|
|
133
|
+
type: 'cashapp';
|
|
134
|
+
}
|
|
135
|
+
|
|
125
136
|
export interface CreatePaymentMethodCustomerBalanceData
|
|
126
137
|
extends PaymentMethodCreateParams {
|
|
127
138
|
/**
|
|
@@ -643,6 +654,36 @@ export interface ConfirmCardPaymentOptions {
|
|
|
643
654
|
handleActions?: boolean;
|
|
644
655
|
}
|
|
645
656
|
|
|
657
|
+
/**
|
|
658
|
+
* Data to be sent with a `stripe.confirmCashappPayment` request.
|
|
659
|
+
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
|
|
660
|
+
*/
|
|
661
|
+
export interface ConfirmCashappPaymentData extends PaymentIntentConfirmParams {
|
|
662
|
+
/**
|
|
663
|
+
* The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
664
|
+
* This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created.
|
|
665
|
+
*
|
|
666
|
+
* @recommended
|
|
667
|
+
*/
|
|
668
|
+
payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* The url your customer will be directed to after they complete authentication.
|
|
672
|
+
*/
|
|
673
|
+
return_url?: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* An options object to control the behavior of `stripe.confirmCashappPayment`.
|
|
678
|
+
*/
|
|
679
|
+
export interface ConfirmCashappPaymentOptions {
|
|
680
|
+
/**
|
|
681
|
+
* 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).
|
|
682
|
+
* Default is `true`.
|
|
683
|
+
*/
|
|
684
|
+
handleActions?: boolean;
|
|
685
|
+
}
|
|
686
|
+
|
|
646
687
|
/**
|
|
647
688
|
* Data to be sent with a `stripe.confirmCustomerBalancePayment` request.
|
|
648
689
|
* 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
|
+
export 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.
|
|
@@ -7,7 +7,11 @@ import * as elements from './elements';
|
|
|
7
7
|
import * as financialConnections from './financial-connections';
|
|
8
8
|
import * as ephemeralKeys from './ephemeral-keys';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
StripeElements,
|
|
12
|
+
StripeElementsOptionsClientSecret,
|
|
13
|
+
StripeElementsOptionsMode,
|
|
14
|
+
} from './elements-group';
|
|
11
15
|
import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout';
|
|
12
16
|
import {PaymentRequestOptions, PaymentRequest} from './payment-request';
|
|
13
17
|
import {StripeElement, StripeElementLocale} from './elements-group';
|
|
@@ -21,8 +25,17 @@ export interface Stripe {
|
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* Create an `Elements` instance, which manages a group of elements.
|
|
28
|
+
*
|
|
29
|
+
* https://stripe.com/docs/js/elements_object/create
|
|
24
30
|
*/
|
|
25
|
-
elements(options?:
|
|
31
|
+
elements(options?: StripeElementsOptionsClientSecret): StripeElements;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Create an `Elements` instance, which manages a group of elements.
|
|
35
|
+
*
|
|
36
|
+
* https://stripe.com/docs/js/elements_object/create_without_intent
|
|
37
|
+
*/
|
|
38
|
+
elements(options?: StripeElementsOptionsMode): StripeElements;
|
|
26
39
|
|
|
27
40
|
/////////////////////////////
|
|
28
41
|
/// Checkout
|
|
@@ -61,6 +74,24 @@ export interface Stripe {
|
|
|
61
74
|
redirect: 'if_required';
|
|
62
75
|
}): Promise<PaymentIntentResult>;
|
|
63
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
|
|
79
|
+
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
|
|
80
|
+
* Your user will be redirected to the return_url you pass once the confirmation is complete.
|
|
81
|
+
*
|
|
82
|
+
* By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation.
|
|
83
|
+
* If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method.
|
|
84
|
+
* Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
|
|
85
|
+
*
|
|
86
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment
|
|
87
|
+
*/
|
|
88
|
+
confirmPayment(options: {
|
|
89
|
+
elements?: StripeElements;
|
|
90
|
+
clientSecret: string;
|
|
91
|
+
confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
|
|
92
|
+
redirect: 'if_required';
|
|
93
|
+
}): Promise<PaymentIntentResult>;
|
|
94
|
+
|
|
64
95
|
/**
|
|
65
96
|
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
|
|
66
97
|
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
|
|
@@ -74,6 +105,20 @@ export interface Stripe {
|
|
|
74
105
|
redirect?: 'always';
|
|
75
106
|
}): Promise<never | {error: StripeError}>;
|
|
76
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
|
|
110
|
+
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
|
|
111
|
+
* Your user will be redirected to the return_url you pass once the confirmation is complete.
|
|
112
|
+
*
|
|
113
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment
|
|
114
|
+
*/
|
|
115
|
+
confirmPayment(options: {
|
|
116
|
+
elements?: StripeElements;
|
|
117
|
+
clientSecret: string;
|
|
118
|
+
confirmParams: paymentIntents.ConfirmPaymentData;
|
|
119
|
+
redirect?: 'always';
|
|
120
|
+
}): Promise<never | {error: StripeError}>;
|
|
121
|
+
|
|
77
122
|
/**
|
|
78
123
|
* Use `stripe.confirmAcssDebitPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow when the customer submits your payment form.
|
|
79
124
|
* When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) when the user submits the form.
|
|
@@ -194,6 +239,23 @@ export interface Stripe {
|
|
|
194
239
|
options?: paymentIntents.ConfirmCardPaymentOptions
|
|
195
240
|
): Promise<PaymentIntentResult>;
|
|
196
241
|
|
|
242
|
+
/**
|
|
243
|
+
* 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.
|
|
244
|
+
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
|
|
245
|
+
* Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details.
|
|
246
|
+
*
|
|
247
|
+
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
248
|
+
* In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
|
|
249
|
+
* If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
|
|
250
|
+
*
|
|
251
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_payment
|
|
252
|
+
*/
|
|
253
|
+
confirmCashappPayment(
|
|
254
|
+
clientSecret: string,
|
|
255
|
+
data?: paymentIntents.ConfirmCashappPaymentData,
|
|
256
|
+
options?: paymentIntents.ConfirmCashappPaymentOptions
|
|
257
|
+
): Promise<PaymentIntentResult>;
|
|
258
|
+
|
|
197
259
|
/**
|
|
198
260
|
* Requires beta access:
|
|
199
261
|
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
@@ -515,6 +577,24 @@ export interface Stripe {
|
|
|
515
577
|
*/
|
|
516
578
|
handleCardAction(clientSecret: string): Promise<PaymentIntentResult>;
|
|
517
579
|
|
|
580
|
+
/**
|
|
581
|
+
* Use `stripe.handleNextAction` in the Payment Intents API finalizing payments on the server flow to finish confirmation of a [PaymentIntent](https://stripe.com/docs/api/payment_intents) or [SetupIntent](https://stripe.com/docs/api/setup_intents) with the `requires_action` status.
|
|
582
|
+
* It will throw an error if the `PaymentIntent` has a different status.
|
|
583
|
+
*
|
|
584
|
+
* Note that `stripe.handleNextAction` may take several seconds to complete.
|
|
585
|
+
* During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.
|
|
586
|
+
* If you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.
|
|
587
|
+
*
|
|
588
|
+
* Additionally, `stripe.handleNextAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge.
|
|
589
|
+
* The authentication challenge requires a context switch that can be hard to follow on a screen-reader.
|
|
590
|
+
* Ensure that your form is accessible by ensuring that success or error messages are clearly read out.
|
|
591
|
+
*
|
|
592
|
+
* @docs https://stripe.com/docs/js/payment_intents/handle_next_action
|
|
593
|
+
*/
|
|
594
|
+
handleNextAction(options: {
|
|
595
|
+
clientSecret: string;
|
|
596
|
+
}): Promise<PaymentIntentResult>;
|
|
597
|
+
|
|
518
598
|
/**
|
|
519
599
|
* Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow
|
|
520
600
|
* to verify a customer's bank account with micro-deposits.
|
|
@@ -553,6 +633,24 @@ export interface Stripe {
|
|
|
553
633
|
paymentMethodData: paymentIntents.CreatePaymentMethodData
|
|
554
634
|
): Promise<PaymentMethodResult>;
|
|
555
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call.
|
|
638
|
+
*
|
|
639
|
+
* @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements
|
|
640
|
+
*/
|
|
641
|
+
createPaymentMethod(
|
|
642
|
+
options: paymentIntents.CreatePaymentMethodFromElements
|
|
643
|
+
): Promise<PaymentMethodResult>;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call.
|
|
647
|
+
*
|
|
648
|
+
* @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements
|
|
649
|
+
*/
|
|
650
|
+
createPaymentMethod(
|
|
651
|
+
options: paymentIntents.CreatePaymentMethodFromElement
|
|
652
|
+
): Promise<PaymentMethodResult>;
|
|
653
|
+
|
|
556
654
|
/**
|
|
557
655
|
* Retrieve a [PaymentIntent](https://stripe.com/docs/api/payment_intents) using its [client secret](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret).
|
|
558
656
|
*
|
|
@@ -583,6 +681,24 @@ export interface Stripe {
|
|
|
583
681
|
redirect: 'if_required';
|
|
584
682
|
}): Promise<SetupIntentResult>;
|
|
585
683
|
|
|
684
|
+
/**
|
|
685
|
+
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
|
|
686
|
+
* When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
|
|
687
|
+
* Your user will be redirected to the return_url you pass once the confirmation is complete.
|
|
688
|
+
*
|
|
689
|
+
* By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation.
|
|
690
|
+
* If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method.
|
|
691
|
+
* Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
|
|
692
|
+
*
|
|
693
|
+
* @docs https://stripe.com/docs/js/setup_intents/confirm_setup
|
|
694
|
+
*/
|
|
695
|
+
confirmSetup(options: {
|
|
696
|
+
elements?: StripeElements;
|
|
697
|
+
clientSecret: string;
|
|
698
|
+
confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
|
|
699
|
+
redirect: 'if_required';
|
|
700
|
+
}): Promise<SetupIntentResult>;
|
|
701
|
+
|
|
586
702
|
/**
|
|
587
703
|
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
|
|
588
704
|
* When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
|
|
@@ -596,6 +712,20 @@ export interface Stripe {
|
|
|
596
712
|
redirect?: 'always';
|
|
597
713
|
}): Promise<never | {error: StripeError}>;
|
|
598
714
|
|
|
715
|
+
/**
|
|
716
|
+
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
|
|
717
|
+
* When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
|
|
718
|
+
* Your user will be redirected to the return_url you pass once the confirmation is complete.
|
|
719
|
+
*
|
|
720
|
+
* @docs https://stripe.com/docs/js/setup_intents/confirm_setup
|
|
721
|
+
*/
|
|
722
|
+
confirmSetup(options: {
|
|
723
|
+
elements?: StripeElements;
|
|
724
|
+
clientSecret: string;
|
|
725
|
+
confirmParams: paymentIntents.ConfirmPaymentData;
|
|
726
|
+
redirect?: 'always';
|
|
727
|
+
}): Promise<never | {error: StripeError}>;
|
|
728
|
+
|
|
599
729
|
/**
|
|
600
730
|
* Use `stripe.confirmAcssDebitSetup` to [save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment).
|
|
601
731
|
* When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) when the user submits the form.
|
|
@@ -697,6 +827,23 @@ export interface Stripe {
|
|
|
697
827
|
options?: setupIntents.ConfirmCardSetupOptions
|
|
698
828
|
): Promise<SetupIntentResult>;
|
|
699
829
|
|
|
830
|
+
/**
|
|
831
|
+
* Use `stripe.confirmCashappSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form.
|
|
832
|
+
* When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide.
|
|
833
|
+
* Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details..
|
|
834
|
+
*
|
|
835
|
+
* When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
836
|
+
* In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
|
|
837
|
+
* 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.
|
|
838
|
+
*
|
|
839
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_setup
|
|
840
|
+
*/
|
|
841
|
+
confirmCashappSetup(
|
|
842
|
+
clientSecret: string,
|
|
843
|
+
data?: setupIntents.ConfirmCashappSetupData,
|
|
844
|
+
options?: setupIntents.ConfirmCashappSetupOptions
|
|
845
|
+
): Promise<SetupIntentResult>;
|
|
846
|
+
|
|
700
847
|
/**
|
|
701
848
|
* 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
849
|
* When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
|