@stripe/stripe-js 4.2.0 → 4.3.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/api/payment-methods.d.mts +15 -0
- package/dist/api/payment-methods.d.ts +15 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/pure.js +1 -1
- package/dist/pure.mjs +1 -1
- package/dist/stripe-js/elements/address.d.mts +4 -0
- package/dist/stripe-js/elements/address.d.ts +4 -0
- package/dist/stripe-js/elements-group.d.mts +5 -1
- package/dist/stripe-js/elements-group.d.ts +5 -1
- package/dist/stripe-js/embedded-checkout.d.mts +32 -0
- package/dist/stripe-js/embedded-checkout.d.ts +32 -0
- package/package.json +1 -1
|
@@ -150,6 +150,21 @@ export namespace PaymentMethod {
|
|
|
150
150
|
*/
|
|
151
151
|
last4: string;
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Contains information about card networks that can be used to process the payment.
|
|
155
|
+
*/
|
|
156
|
+
networks: {
|
|
157
|
+
/**
|
|
158
|
+
* The preferred network for co-branded cards.
|
|
159
|
+
*/
|
|
160
|
+
preferred: string | null;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* All available networks for the card.
|
|
164
|
+
*/
|
|
165
|
+
available: string[];
|
|
166
|
+
} | null;
|
|
167
|
+
|
|
153
168
|
/**
|
|
154
169
|
* Contains details on how this Card maybe be used for 3D Secure authentication.
|
|
155
170
|
*/
|
|
@@ -150,6 +150,21 @@ export namespace PaymentMethod {
|
|
|
150
150
|
*/
|
|
151
151
|
last4: string;
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Contains information about card networks that can be used to process the payment.
|
|
155
|
+
*/
|
|
156
|
+
networks: {
|
|
157
|
+
/**
|
|
158
|
+
* The preferred network for co-branded cards.
|
|
159
|
+
*/
|
|
160
|
+
preferred: string | null;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* All available networks for the card.
|
|
164
|
+
*/
|
|
165
|
+
available: string[];
|
|
166
|
+
} | null;
|
|
167
|
+
|
|
153
168
|
/**
|
|
154
169
|
* Contains details on how this Card maybe be used for 3D Secure authentication.
|
|
155
170
|
*/
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/dist/pure.js
CHANGED
package/dist/pure.mjs
CHANGED
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
StripeIssuingCardCopyButtonElementOptions,
|
|
48
48
|
StripeExpressCheckoutElement,
|
|
49
49
|
StripeExpressCheckoutElementOptions,
|
|
50
|
+
StripeAddressElementGetElementOptions,
|
|
50
51
|
} from './elements';
|
|
51
52
|
import {StripeError} from './stripe';
|
|
52
53
|
|
|
@@ -84,7 +85,10 @@ export interface StripeElements {
|
|
|
84
85
|
/**
|
|
85
86
|
* Looks up a previously created `Element` by its type.
|
|
86
87
|
*/
|
|
87
|
-
getElement(
|
|
88
|
+
getElement(
|
|
89
|
+
elementType: 'address',
|
|
90
|
+
options?: StripeAddressElementGetElementOptions
|
|
91
|
+
): StripeAddressElement | null;
|
|
88
92
|
|
|
89
93
|
/////////////////////////////
|
|
90
94
|
/// paymentMethodMessaging
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
StripeIssuingCardCopyButtonElementOptions,
|
|
48
48
|
StripeExpressCheckoutElement,
|
|
49
49
|
StripeExpressCheckoutElementOptions,
|
|
50
|
+
StripeAddressElementGetElementOptions,
|
|
50
51
|
} from './elements';
|
|
51
52
|
import {StripeError} from './stripe';
|
|
52
53
|
|
|
@@ -84,7 +85,10 @@ export interface StripeElements {
|
|
|
84
85
|
/**
|
|
85
86
|
* Looks up a previously created `Element` by its type.
|
|
86
87
|
*/
|
|
87
|
-
getElement(
|
|
88
|
+
getElement(
|
|
89
|
+
elementType: 'address',
|
|
90
|
+
options?: StripeAddressElementGetElementOptions
|
|
91
|
+
): StripeAddressElement | null;
|
|
88
92
|
|
|
89
93
|
/////////////////////////////
|
|
90
94
|
/// paymentMethodMessaging
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
export type StripeEmbeddedCheckoutAddress = {
|
|
2
|
+
country: string;
|
|
3
|
+
line1?: string | null;
|
|
4
|
+
line2?: string | null;
|
|
5
|
+
city?: string | null;
|
|
6
|
+
postal_code?: string | null;
|
|
7
|
+
state?: string | null;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type StripeEmbeddedCheckoutShippingDetails = {
|
|
11
|
+
name: string;
|
|
12
|
+
address: StripeEmbeddedCheckoutAddress;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
|
|
16
|
+
checkoutSessionId: string;
|
|
17
|
+
shippingDetails: StripeEmbeddedCheckoutShippingDetails;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ResultAction =
|
|
21
|
+
| {type: 'accept'}
|
|
22
|
+
| {type: 'reject'; errorMessage?: string};
|
|
23
|
+
|
|
1
24
|
export interface StripeEmbeddedCheckoutOptions {
|
|
2
25
|
/**
|
|
3
26
|
* The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
|
|
@@ -13,6 +36,15 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
13
36
|
* You can use it to unmount Embedded Checkout and render a custom success UI.
|
|
14
37
|
*/
|
|
15
38
|
onComplete?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* onShippingDetailsChange is called when the customer completes the shipping details form.
|
|
41
|
+
*
|
|
42
|
+
* The callback is required when [permissions.update.shipping_details](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-shipping_details) is set to `server_only`.
|
|
43
|
+
* For a step-by-step guide on using this callback to customize shipping options during checkout, see [Customize Shipping Options](https://docs.stripe.com/payments/checkout/custom-shipping-options).
|
|
44
|
+
*/
|
|
45
|
+
onShippingDetailsChange?: (
|
|
46
|
+
event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
|
|
47
|
+
) => Promise<ResultAction>;
|
|
16
48
|
}
|
|
17
49
|
|
|
18
50
|
export interface StripeEmbeddedCheckout {
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
export type StripeEmbeddedCheckoutAddress = {
|
|
2
|
+
country: string;
|
|
3
|
+
line1?: string | null;
|
|
4
|
+
line2?: string | null;
|
|
5
|
+
city?: string | null;
|
|
6
|
+
postal_code?: string | null;
|
|
7
|
+
state?: string | null;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type StripeEmbeddedCheckoutShippingDetails = {
|
|
11
|
+
name: string;
|
|
12
|
+
address: StripeEmbeddedCheckoutAddress;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
|
|
16
|
+
checkoutSessionId: string;
|
|
17
|
+
shippingDetails: StripeEmbeddedCheckoutShippingDetails;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ResultAction =
|
|
21
|
+
| {type: 'accept'}
|
|
22
|
+
| {type: 'reject'; errorMessage?: string};
|
|
23
|
+
|
|
1
24
|
export interface StripeEmbeddedCheckoutOptions {
|
|
2
25
|
/**
|
|
3
26
|
* The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
|
|
@@ -13,6 +36,15 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
13
36
|
* You can use it to unmount Embedded Checkout and render a custom success UI.
|
|
14
37
|
*/
|
|
15
38
|
onComplete?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* onShippingDetailsChange is called when the customer completes the shipping details form.
|
|
41
|
+
*
|
|
42
|
+
* The callback is required when [permissions.update.shipping_details](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-shipping_details) is set to `server_only`.
|
|
43
|
+
* For a step-by-step guide on using this callback to customize shipping options during checkout, see [Customize Shipping Options](https://docs.stripe.com/payments/checkout/custom-shipping-options).
|
|
44
|
+
*/
|
|
45
|
+
onShippingDetailsChange?: (
|
|
46
|
+
event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
|
|
47
|
+
) => Promise<ResultAction>;
|
|
16
48
|
}
|
|
17
49
|
|
|
18
50
|
export interface StripeEmbeddedCheckout {
|