@stripe/stripe-js 8.1.0 → 8.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/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/pure.js +2 -2
- package/dist/pure.mjs +2 -2
- package/dist/stripe-js/elements/payment.d.mts +6 -0
- package/dist/stripe-js/elements/payment.d.ts +6 -0
- package/dist/stripe-js/embedded-checkout.d.mts +90 -0
- package/dist/stripe-js/embedded-checkout.d.ts +90 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
55
55
|
|
|
56
56
|
stripe._registerWrapper({
|
|
57
57
|
name: 'stripe-js',
|
|
58
|
-
version: "8.
|
|
58
|
+
version: "8.3.0",
|
|
59
59
|
startTime: startTime
|
|
60
60
|
});
|
|
61
61
|
};
|
|
@@ -151,7 +151,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
151
151
|
var expectedVersion = RELEASE_TRAIN;
|
|
152
152
|
|
|
153
153
|
if (isTestKey && version !== expectedVersion) {
|
|
154
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.
|
|
154
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.3.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
51
51
|
|
|
52
52
|
stripe._registerWrapper({
|
|
53
53
|
name: 'stripe-js',
|
|
54
|
-
version: "8.
|
|
54
|
+
version: "8.3.0",
|
|
55
55
|
startTime: startTime
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -147,7 +147,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
147
147
|
var expectedVersion = RELEASE_TRAIN;
|
|
148
148
|
|
|
149
149
|
if (isTestKey && version !== expectedVersion) {
|
|
150
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.
|
|
150
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.3.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/pure.js
CHANGED
|
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
71
71
|
|
|
72
72
|
stripe._registerWrapper({
|
|
73
73
|
name: 'stripe-js',
|
|
74
|
-
version: "8.
|
|
74
|
+
version: "8.3.0",
|
|
75
75
|
startTime: startTime
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -167,7 +167,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
167
167
|
var expectedVersion = RELEASE_TRAIN;
|
|
168
168
|
|
|
169
169
|
if (isTestKey && version !== expectedVersion) {
|
|
170
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.
|
|
170
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.3.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/pure.mjs
CHANGED
|
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
67
67
|
|
|
68
68
|
stripe._registerWrapper({
|
|
69
69
|
name: 'stripe-js',
|
|
70
|
-
version: "8.
|
|
70
|
+
version: "8.3.0",
|
|
71
71
|
startTime: startTime
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -163,7 +163,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
163
163
|
var expectedVersion = RELEASE_TRAIN;
|
|
164
164
|
|
|
165
165
|
if (isTestKey && version !== expectedVersion) {
|
|
166
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.
|
|
166
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.3.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
var stripe = maybeStripe.apply(undefined, args);
|
|
@@ -227,6 +227,12 @@ export interface LayoutObject {
|
|
|
227
227
|
radios?: boolean;
|
|
228
228
|
spacedAccordionItems?: boolean;
|
|
229
229
|
visibleAccordionItemsCount?: number;
|
|
230
|
+
/**
|
|
231
|
+
* The position of the payment method logo in each accordion item.
|
|
232
|
+
*
|
|
233
|
+
* By default, the logo is displayed at the start of each accordion item.
|
|
234
|
+
*/
|
|
235
|
+
paymentMethodLogoPosition?: 'start' | 'end';
|
|
230
236
|
}
|
|
231
237
|
|
|
232
238
|
export interface StripePaymentElementOptions {
|
|
@@ -227,6 +227,12 @@ export interface LayoutObject {
|
|
|
227
227
|
radios?: boolean;
|
|
228
228
|
spacedAccordionItems?: boolean;
|
|
229
229
|
visibleAccordionItemsCount?: number;
|
|
230
|
+
/**
|
|
231
|
+
* The position of the payment method logo in each accordion item.
|
|
232
|
+
*
|
|
233
|
+
* By default, the logo is displayed at the start of each accordion item.
|
|
234
|
+
*/
|
|
235
|
+
paymentMethodLogoPosition?: 'start' | 'end';
|
|
230
236
|
}
|
|
231
237
|
|
|
232
238
|
export interface StripePaymentElementOptions {
|
|
@@ -44,6 +44,91 @@ export type ResultAction =
|
|
|
44
44
|
| {type: 'accept'}
|
|
45
45
|
| {type: 'reject'; errorMessage?: string};
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Analytics types for Embedded Checkout events
|
|
49
|
+
*/
|
|
50
|
+
export type StripeEmbeddedCheckoutClientMetadata = {
|
|
51
|
+
[k: string]: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type StripeEmbeddedCheckoutAnalyticsItemsAndTotals = {
|
|
55
|
+
items?: Array<{
|
|
56
|
+
quantity?: number;
|
|
57
|
+
product?: string;
|
|
58
|
+
amount?: number;
|
|
59
|
+
rateCard?: string;
|
|
60
|
+
pricingPlan?: string;
|
|
61
|
+
price?: string;
|
|
62
|
+
}>;
|
|
63
|
+
currency?: string;
|
|
64
|
+
amount?: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type StripeEmbeddedCheckoutAnalyticsEvent<
|
|
68
|
+
EventType extends string,
|
|
69
|
+
EventDetails
|
|
70
|
+
> = {
|
|
71
|
+
checkoutSession: string;
|
|
72
|
+
eventType: EventType;
|
|
73
|
+
details: EventDetails;
|
|
74
|
+
clientMetadata: StripeEmbeddedCheckoutClientMetadata;
|
|
75
|
+
/**
|
|
76
|
+
* The timestamp of the event in unix seconds
|
|
77
|
+
*/
|
|
78
|
+
timestamp: number;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type StripeEmbeddedCheckoutSubmittedDetails = StripeEmbeddedCheckoutAnalyticsItemsAndTotals & {
|
|
82
|
+
paymentMethodType: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type StripeEmbeddedCheckoutRenderedDetails = StripeEmbeddedCheckoutAnalyticsItemsAndTotals;
|
|
86
|
+
|
|
87
|
+
export type StripeEmbeddedCheckoutDeviceDataDetails = {
|
|
88
|
+
device: {
|
|
89
|
+
category: 'mobile' | 'tablet' | 'desktop';
|
|
90
|
+
language?: string;
|
|
91
|
+
platform?: string;
|
|
92
|
+
viewport?: {width: number; height: number};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type StripeEmbeddedCheckoutPromotionCodeAppliedDetails = {
|
|
97
|
+
code: string;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type StripeEmbeddedCheckoutRenderedEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
101
|
+
'checkoutRendered',
|
|
102
|
+
StripeEmbeddedCheckoutRenderedDetails
|
|
103
|
+
>;
|
|
104
|
+
|
|
105
|
+
export type StripeEmbeddedCheckoutDeviceDataEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
106
|
+
'deviceData',
|
|
107
|
+
StripeEmbeddedCheckoutDeviceDataDetails
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
export type StripeEmbeddedCheckoutPromotionCodeAppliedEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
111
|
+
'promotionCodeApplied',
|
|
112
|
+
StripeEmbeddedCheckoutPromotionCodeAppliedDetails
|
|
113
|
+
>;
|
|
114
|
+
|
|
115
|
+
export type StripeEmbeddedCheckoutLineItemChangeEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
116
|
+
'lineItemChange',
|
|
117
|
+
StripeEmbeddedCheckoutAnalyticsItemsAndTotals
|
|
118
|
+
>;
|
|
119
|
+
|
|
120
|
+
export type StripeEmbeddedCheckoutSubmittedEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
121
|
+
'checkoutSubmitted',
|
|
122
|
+
StripeEmbeddedCheckoutSubmittedDetails
|
|
123
|
+
>;
|
|
124
|
+
|
|
125
|
+
export type StripeEmbeddedCheckoutAnalyticsEventUnion =
|
|
126
|
+
| StripeEmbeddedCheckoutRenderedEvent
|
|
127
|
+
| StripeEmbeddedCheckoutDeviceDataEvent
|
|
128
|
+
| StripeEmbeddedCheckoutPromotionCodeAppliedEvent
|
|
129
|
+
| StripeEmbeddedCheckoutLineItemChangeEvent
|
|
130
|
+
| StripeEmbeddedCheckoutSubmittedEvent;
|
|
131
|
+
|
|
47
132
|
export interface StripeEmbeddedCheckoutOptions {
|
|
48
133
|
/**
|
|
49
134
|
* The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
|
|
@@ -75,6 +160,11 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
75
160
|
onLineItemsChange?: (
|
|
76
161
|
event: StripeEmbeddedCheckoutLineItemsChangeEvent
|
|
77
162
|
) => Promise<ResultAction>;
|
|
163
|
+
/**
|
|
164
|
+
* onAnalyticsEvent is called when analytics events occur during the checkout session.
|
|
165
|
+
* You can use it to track customer behavior during the checkout session.
|
|
166
|
+
*/
|
|
167
|
+
onAnalyticsEvent?: (event: StripeEmbeddedCheckoutAnalyticsEventUnion) => void;
|
|
78
168
|
}
|
|
79
169
|
|
|
80
170
|
export interface StripeEmbeddedCheckout {
|
|
@@ -44,6 +44,91 @@ export type ResultAction =
|
|
|
44
44
|
| {type: 'accept'}
|
|
45
45
|
| {type: 'reject'; errorMessage?: string};
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Analytics types for Embedded Checkout events
|
|
49
|
+
*/
|
|
50
|
+
export type StripeEmbeddedCheckoutClientMetadata = {
|
|
51
|
+
[k: string]: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type StripeEmbeddedCheckoutAnalyticsItemsAndTotals = {
|
|
55
|
+
items?: Array<{
|
|
56
|
+
quantity?: number;
|
|
57
|
+
product?: string;
|
|
58
|
+
amount?: number;
|
|
59
|
+
rateCard?: string;
|
|
60
|
+
pricingPlan?: string;
|
|
61
|
+
price?: string;
|
|
62
|
+
}>;
|
|
63
|
+
currency?: string;
|
|
64
|
+
amount?: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type StripeEmbeddedCheckoutAnalyticsEvent<
|
|
68
|
+
EventType extends string,
|
|
69
|
+
EventDetails
|
|
70
|
+
> = {
|
|
71
|
+
checkoutSession: string;
|
|
72
|
+
eventType: EventType;
|
|
73
|
+
details: EventDetails;
|
|
74
|
+
clientMetadata: StripeEmbeddedCheckoutClientMetadata;
|
|
75
|
+
/**
|
|
76
|
+
* The timestamp of the event in unix seconds
|
|
77
|
+
*/
|
|
78
|
+
timestamp: number;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type StripeEmbeddedCheckoutSubmittedDetails = StripeEmbeddedCheckoutAnalyticsItemsAndTotals & {
|
|
82
|
+
paymentMethodType: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type StripeEmbeddedCheckoutRenderedDetails = StripeEmbeddedCheckoutAnalyticsItemsAndTotals;
|
|
86
|
+
|
|
87
|
+
export type StripeEmbeddedCheckoutDeviceDataDetails = {
|
|
88
|
+
device: {
|
|
89
|
+
category: 'mobile' | 'tablet' | 'desktop';
|
|
90
|
+
language?: string;
|
|
91
|
+
platform?: string;
|
|
92
|
+
viewport?: {width: number; height: number};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type StripeEmbeddedCheckoutPromotionCodeAppliedDetails = {
|
|
97
|
+
code: string;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type StripeEmbeddedCheckoutRenderedEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
101
|
+
'checkoutRendered',
|
|
102
|
+
StripeEmbeddedCheckoutRenderedDetails
|
|
103
|
+
>;
|
|
104
|
+
|
|
105
|
+
export type StripeEmbeddedCheckoutDeviceDataEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
106
|
+
'deviceData',
|
|
107
|
+
StripeEmbeddedCheckoutDeviceDataDetails
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
export type StripeEmbeddedCheckoutPromotionCodeAppliedEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
111
|
+
'promotionCodeApplied',
|
|
112
|
+
StripeEmbeddedCheckoutPromotionCodeAppliedDetails
|
|
113
|
+
>;
|
|
114
|
+
|
|
115
|
+
export type StripeEmbeddedCheckoutLineItemChangeEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
116
|
+
'lineItemChange',
|
|
117
|
+
StripeEmbeddedCheckoutAnalyticsItemsAndTotals
|
|
118
|
+
>;
|
|
119
|
+
|
|
120
|
+
export type StripeEmbeddedCheckoutSubmittedEvent = StripeEmbeddedCheckoutAnalyticsEvent<
|
|
121
|
+
'checkoutSubmitted',
|
|
122
|
+
StripeEmbeddedCheckoutSubmittedDetails
|
|
123
|
+
>;
|
|
124
|
+
|
|
125
|
+
export type StripeEmbeddedCheckoutAnalyticsEventUnion =
|
|
126
|
+
| StripeEmbeddedCheckoutRenderedEvent
|
|
127
|
+
| StripeEmbeddedCheckoutDeviceDataEvent
|
|
128
|
+
| StripeEmbeddedCheckoutPromotionCodeAppliedEvent
|
|
129
|
+
| StripeEmbeddedCheckoutLineItemChangeEvent
|
|
130
|
+
| StripeEmbeddedCheckoutSubmittedEvent;
|
|
131
|
+
|
|
47
132
|
export interface StripeEmbeddedCheckoutOptions {
|
|
48
133
|
/**
|
|
49
134
|
* The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
|
|
@@ -75,6 +160,11 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
75
160
|
onLineItemsChange?: (
|
|
76
161
|
event: StripeEmbeddedCheckoutLineItemsChangeEvent
|
|
77
162
|
) => Promise<ResultAction>;
|
|
163
|
+
/**
|
|
164
|
+
* onAnalyticsEvent is called when analytics events occur during the checkout session.
|
|
165
|
+
* You can use it to track customer behavior during the checkout session.
|
|
166
|
+
*/
|
|
167
|
+
onAnalyticsEvent?: (event: StripeEmbeddedCheckoutAnalyticsEventUnion) => void;
|
|
78
168
|
}
|
|
79
169
|
|
|
80
170
|
export interface StripeEmbeddedCheckout {
|