@stripe/stripe-js 4.1.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/custom-checkout.d.mts +34 -0
- package/dist/stripe-js/custom-checkout.d.ts +34 -0
- 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
|
@@ -100,6 +100,32 @@ export type StripeCustomCheckoutLastPaymentError = {
|
|
|
100
100
|
message: string;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
export type StripeCustomCheckoutRedirectBehavior = 'always' | 'if_required';
|
|
104
|
+
|
|
105
|
+
export type StripeCustomCheckoutSavedPaymentMethod = {
|
|
106
|
+
id: string;
|
|
107
|
+
type: 'card';
|
|
108
|
+
card: {
|
|
109
|
+
brand: string;
|
|
110
|
+
expMonth: number;
|
|
111
|
+
expYear: number;
|
|
112
|
+
last4: string;
|
|
113
|
+
};
|
|
114
|
+
billingDetails: {
|
|
115
|
+
email?: string | null;
|
|
116
|
+
name?: string | null;
|
|
117
|
+
phone?: string | null;
|
|
118
|
+
address?: {
|
|
119
|
+
line1?: string | null;
|
|
120
|
+
line2?: string | null;
|
|
121
|
+
city?: string | null;
|
|
122
|
+
postal_code?: string | null;
|
|
123
|
+
state?: string | null;
|
|
124
|
+
country?: string | null;
|
|
125
|
+
} | null;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
103
129
|
export type StripeCustomCheckoutTaxAmount = {
|
|
104
130
|
amount: number;
|
|
105
131
|
inclusive: boolean;
|
|
@@ -179,15 +205,19 @@ export type StripeCustomCheckoutTrial = {
|
|
|
179
205
|
/* Custom Checkout session */
|
|
180
206
|
export interface StripeCustomCheckoutSession {
|
|
181
207
|
billingAddress: StripeCustomCheckoutContact | null;
|
|
208
|
+
businessName: string | null;
|
|
182
209
|
canConfirm: boolean;
|
|
183
210
|
confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[];
|
|
184
211
|
currency: string;
|
|
185
212
|
discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
|
|
186
213
|
email: string | null;
|
|
214
|
+
id: string;
|
|
187
215
|
lastPaymentError: StripeCustomCheckoutLastPaymentError | null;
|
|
188
216
|
lineItems: Array<StripeCustomCheckoutLineItem>;
|
|
217
|
+
livemode: boolean;
|
|
189
218
|
phoneNumber: string | null;
|
|
190
219
|
recurring: StripeCustomCheckoutRecurring | null;
|
|
220
|
+
savedPaymentMethods: Array<StripeCustomCheckoutSavedPaymentMethod> | null;
|
|
191
221
|
shipping: StripeCustomCheckoutShipping | null;
|
|
192
222
|
shippingAddress: StripeCustomCheckoutContact | null;
|
|
193
223
|
shippingOptions: Array<StripeCustomCheckoutShippingOption>;
|
|
@@ -374,6 +404,10 @@ export interface StripeCustomCheckout {
|
|
|
374
404
|
) => Promise<StripeCustomCheckoutResult>;
|
|
375
405
|
confirm: (args?: {
|
|
376
406
|
return_url?: string;
|
|
407
|
+
returnUrl?: string;
|
|
408
|
+
redirect?: StripeCustomCheckoutRedirectBehavior;
|
|
409
|
+
paymentMethod?: string;
|
|
410
|
+
savePaymentMethod?: boolean;
|
|
377
411
|
}) => Promise<StripeCustomCheckoutResult>;
|
|
378
412
|
session: () => StripeCustomCheckoutSession;
|
|
379
413
|
on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void;
|
|
@@ -100,6 +100,32 @@ export type StripeCustomCheckoutLastPaymentError = {
|
|
|
100
100
|
message: string;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
export type StripeCustomCheckoutRedirectBehavior = 'always' | 'if_required';
|
|
104
|
+
|
|
105
|
+
export type StripeCustomCheckoutSavedPaymentMethod = {
|
|
106
|
+
id: string;
|
|
107
|
+
type: 'card';
|
|
108
|
+
card: {
|
|
109
|
+
brand: string;
|
|
110
|
+
expMonth: number;
|
|
111
|
+
expYear: number;
|
|
112
|
+
last4: string;
|
|
113
|
+
};
|
|
114
|
+
billingDetails: {
|
|
115
|
+
email?: string | null;
|
|
116
|
+
name?: string | null;
|
|
117
|
+
phone?: string | null;
|
|
118
|
+
address?: {
|
|
119
|
+
line1?: string | null;
|
|
120
|
+
line2?: string | null;
|
|
121
|
+
city?: string | null;
|
|
122
|
+
postal_code?: string | null;
|
|
123
|
+
state?: string | null;
|
|
124
|
+
country?: string | null;
|
|
125
|
+
} | null;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
103
129
|
export type StripeCustomCheckoutTaxAmount = {
|
|
104
130
|
amount: number;
|
|
105
131
|
inclusive: boolean;
|
|
@@ -179,15 +205,19 @@ export type StripeCustomCheckoutTrial = {
|
|
|
179
205
|
/* Custom Checkout session */
|
|
180
206
|
export interface StripeCustomCheckoutSession {
|
|
181
207
|
billingAddress: StripeCustomCheckoutContact | null;
|
|
208
|
+
businessName: string | null;
|
|
182
209
|
canConfirm: boolean;
|
|
183
210
|
confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[];
|
|
184
211
|
currency: string;
|
|
185
212
|
discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
|
|
186
213
|
email: string | null;
|
|
214
|
+
id: string;
|
|
187
215
|
lastPaymentError: StripeCustomCheckoutLastPaymentError | null;
|
|
188
216
|
lineItems: Array<StripeCustomCheckoutLineItem>;
|
|
217
|
+
livemode: boolean;
|
|
189
218
|
phoneNumber: string | null;
|
|
190
219
|
recurring: StripeCustomCheckoutRecurring | null;
|
|
220
|
+
savedPaymentMethods: Array<StripeCustomCheckoutSavedPaymentMethod> | null;
|
|
191
221
|
shipping: StripeCustomCheckoutShipping | null;
|
|
192
222
|
shippingAddress: StripeCustomCheckoutContact | null;
|
|
193
223
|
shippingOptions: Array<StripeCustomCheckoutShippingOption>;
|
|
@@ -374,6 +404,10 @@ export interface StripeCustomCheckout {
|
|
|
374
404
|
) => Promise<StripeCustomCheckoutResult>;
|
|
375
405
|
confirm: (args?: {
|
|
376
406
|
return_url?: string;
|
|
407
|
+
returnUrl?: string;
|
|
408
|
+
redirect?: StripeCustomCheckoutRedirectBehavior;
|
|
409
|
+
paymentMethod?: string;
|
|
410
|
+
savePaymentMethod?: boolean;
|
|
377
411
|
}) => Promise<StripeCustomCheckoutResult>;
|
|
378
412
|
session: () => StripeCustomCheckoutSession;
|
|
379
413
|
on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void;
|
|
@@ -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 {
|