@stripe/stripe-js 1.27.0 → 1.30.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-intents.d.ts +2 -2
- package/types/api/payment-methods.d.ts +2 -0
- package/types/api/setup-intents.d.ts +2 -2
- package/types/stripe-js/elements/payment.d.ts +17 -0
- package/types/stripe-js/elements/shipping-address.d.ts +0 -8
- package/types/stripe-js/elements-group.d.ts +27 -3
- package/types/stripe-js/payment-intents.d.ts +10 -0
- package/types/stripe-js/payment-request.d.ts +5 -0
- package/types/stripe-js/setup-intents.d.ts +5 -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
|
@@ -77,9 +77,9 @@ export interface PaymentIntent {
|
|
|
77
77
|
next_action: PaymentIntent.NextAction | null;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* ID of the payment method used in this PaymentIntent.
|
|
80
|
+
* ID of the payment method used in this PaymentIntent, or the PaymentMethod itself if this field is expanded.
|
|
81
81
|
*/
|
|
82
|
-
payment_method: string | null;
|
|
82
|
+
payment_method: string | null | PaymentMethod;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
|
|
@@ -52,9 +52,9 @@ export interface SetupIntent {
|
|
|
52
52
|
next_action: SetupIntent.NextAction | null;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* ID of the payment method used with this SetupIntent.
|
|
55
|
+
* ID of the payment method used with this SetupIntent, or the PaymentMethod itself if this field is expanded.
|
|
56
56
|
*/
|
|
57
|
-
payment_method: string | null;
|
|
57
|
+
payment_method: string | null | PaymentMethod;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {StripeElementBase} from './base';
|
|
2
|
+
import {StripeError} from '../stripe';
|
|
2
3
|
|
|
3
4
|
export type StripePaymentElement = StripeElementBase & {
|
|
4
5
|
/**
|
|
@@ -81,6 +82,22 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
81
82
|
handler?: (event: {elementType: 'payment'}) => any
|
|
82
83
|
): StripePaymentElement;
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Triggered when the element fails to load.
|
|
87
|
+
*/
|
|
88
|
+
on(
|
|
89
|
+
eventType: 'loaderror',
|
|
90
|
+
handler: (event: {elementType: 'payment'; error: StripeError}) => any
|
|
91
|
+
): StripePaymentElement;
|
|
92
|
+
once(
|
|
93
|
+
eventType: 'loaderror',
|
|
94
|
+
handler: (event: {elementType: 'payment'; error: StripeError}) => any
|
|
95
|
+
): StripePaymentElement;
|
|
96
|
+
off(
|
|
97
|
+
eventType: 'loaderror',
|
|
98
|
+
handler?: (event: {elementType: 'payment'; error: StripeError}) => any
|
|
99
|
+
): StripePaymentElement;
|
|
100
|
+
|
|
84
101
|
/**
|
|
85
102
|
* Updates the options the `PaymentElement` was initialized with.
|
|
86
103
|
* Updates are merged into the existing configuration.
|
|
@@ -80,14 +80,6 @@ export type StripeShippingAddressElement = StripeElementBase & {
|
|
|
80
80
|
eventType: 'escape',
|
|
81
81
|
handler?: (event: {elementType: 'shippingAddress'}) => any
|
|
82
82
|
): StripeShippingAddressElement;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Updates the options the `ShippingAddressElement` was initialized with.
|
|
86
|
-
* Updates are merged into the existing configuration.
|
|
87
|
-
*/
|
|
88
|
-
update(
|
|
89
|
-
options: Partial<StripeShippingAddressElementOptions>
|
|
90
|
-
): StripeShippingAddressElement;
|
|
91
83
|
};
|
|
92
84
|
|
|
93
85
|
export interface StripeShippingAddressElementOptions {
|
|
@@ -40,6 +40,12 @@ export interface StripeElements {
|
|
|
40
40
|
*/
|
|
41
41
|
update(options: StripeElementsUpdateOptions): void;
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Fetches updates from the associated PaymentIntent or SetupIntent on an existing
|
|
45
|
+
* instance of Elements, and reflects these updates in the Payment Element.
|
|
46
|
+
*/
|
|
47
|
+
fetchUpdates(): Promise<{error?: {message: string; status?: string}}>;
|
|
48
|
+
|
|
43
49
|
/////////////////////////////
|
|
44
50
|
/// affirmMessage
|
|
45
51
|
/////////////////////////////
|
|
@@ -465,6 +471,15 @@ export interface StripeElementsOptions {
|
|
|
465
471
|
* Default is `'auto'` (Stripe determines if a loader UI should be shown).
|
|
466
472
|
*/
|
|
467
473
|
loader?: 'auto' | 'always' | 'never';
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Requires beta access:
|
|
477
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
478
|
+
*
|
|
479
|
+
* Display saved PaymentMethods and Customer information.
|
|
480
|
+
* Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
|
|
481
|
+
*/
|
|
482
|
+
customerOptions?: CustomerOptions;
|
|
468
483
|
}
|
|
469
484
|
|
|
470
485
|
/*
|
|
@@ -479,9 +494,6 @@ export interface StripeElementsUpdateOptions {
|
|
|
479
494
|
locale?: StripeElementLocale;
|
|
480
495
|
|
|
481
496
|
/**
|
|
482
|
-
* Used with the Payment Element, requires beta access:
|
|
483
|
-
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
484
|
-
*
|
|
485
497
|
* Match the design of your site with the appearance option.
|
|
486
498
|
* The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more.
|
|
487
499
|
*
|
|
@@ -632,3 +644,15 @@ export interface Appearance {
|
|
|
632
644
|
|
|
633
645
|
labels?: 'above' | 'floating';
|
|
634
646
|
}
|
|
647
|
+
|
|
648
|
+
export interface CustomerOptions {
|
|
649
|
+
/**
|
|
650
|
+
* The Customer id.
|
|
651
|
+
*/
|
|
652
|
+
customer: string;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* The ephemeral key for a Customer that grants temporary access to Customer data.
|
|
656
|
+
*/
|
|
657
|
+
ephemeralKey: string;
|
|
658
|
+
}
|
|
@@ -1303,6 +1303,11 @@ export interface ConfirmPaymentData extends PaymentIntentConfirmParams {
|
|
|
1303
1303
|
*/
|
|
1304
1304
|
billing_details?: PaymentMethodCreateParams.BillingDetails;
|
|
1305
1305
|
};
|
|
1306
|
+
|
|
1307
|
+
/**
|
|
1308
|
+
* Specifies which fields in the response should be expanded.
|
|
1309
|
+
*/
|
|
1310
|
+
expand?: Array<string>;
|
|
1306
1311
|
}
|
|
1307
1312
|
|
|
1308
1313
|
/**
|
|
@@ -1325,4 +1330,9 @@ export interface CollectBankAccountForPaymentOptions {
|
|
|
1325
1330
|
clientSecret: string;
|
|
1326
1331
|
|
|
1327
1332
|
params: CollectBankAccountParams;
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Specifies which fields in the response should be expanded.
|
|
1336
|
+
*/
|
|
1337
|
+
expand?: Array<string>;
|
|
1328
1338
|
}
|
|
@@ -14,6 +14,11 @@ export interface PaymentRequest {
|
|
|
14
14
|
*/
|
|
15
15
|
show(): void;
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Closes the browser’s payment interface.
|
|
19
|
+
*/
|
|
20
|
+
abort: () => void;
|
|
21
|
+
|
|
17
22
|
/**
|
|
18
23
|
* `true` if the browser’s payment interface is showing.
|
|
19
24
|
* When using the `PaymentRequestButtonElement`, this is called for you automatically.
|