@zonos/elements 1.3.89 → 1.3.91
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/cjs/{cart-e15290ab.js → cart-3cc424f9.js} +14 -9
- package/dist/cjs/{createCustomEvent-3da45800.js → createCustomEvent-68a5819f.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-47b71e3b.js → paypal-6abc29b9.js} +1 -5
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +10 -14
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -3
- package/dist/collection/components/store/checkout/cart.js +15 -10
- package/dist/esm/{cart-08c2a740.js → cart-66d67627.js} +14 -9
- package/dist/esm/{createCustomEvent-a8a9fe09.js → createCustomEvent-34725327.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-4a21792c.js → paypal-da9e020f.js} +2 -5
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +10 -14
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-08c2a740.js → cart-66d67627.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-a8a9fe09.js → createCustomEvent-34725327.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-4a21792c.js → paypal-da9e020f.js} +2 -2
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-dbd51a62.system.entry.js → p-03159bbf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3ac3a8be.entry.js → p-06bab7d2.entry.js} +1 -1
- package/dist/zonos-elements/{p-49010cea.system.entry.js → p-072f4a48.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3214b2df.js → p-0af823af.js} +1 -1
- package/dist/zonos-elements/{p-48b151ae.entry.js → p-0deebb7a.entry.js} +1 -1
- package/dist/zonos-elements/{p-6d5d31ac.entry.js → p-14783646.entry.js} +1 -1
- package/dist/zonos-elements/{p-0033c20b.system.entry.js → p-14d2312c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9773abc9.entry.js → p-1615c1c4.entry.js} +1 -1
- package/dist/zonos-elements/{p-4f13a851.entry.js → p-2e00dbf9.entry.js} +1 -1
- package/dist/zonos-elements/{p-3951ac01.entry.js → p-324fd0ad.entry.js} +1 -1
- package/dist/zonos-elements/{p-00706ef7.system.js → p-35d1a532.system.js} +1 -1
- package/dist/zonos-elements/{p-db4c833d.js → p-5cbae38e.js} +2 -2
- package/dist/zonos-elements/{p-12f25739.system.entry.js → p-6525fa0e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6c6eb676.entry.js +1 -0
- package/dist/zonos-elements/{p-4a417566.system.entry.js → p-6e49e7cc.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f5e29ed6.system.entry.js → p-71cc7c12.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fc2191b7.system.entry.js → p-a637cb1c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-531973ca.entry.js → p-b85f701c.entry.js} +1 -1
- package/dist/zonos-elements/p-bd1b32ea.system.entry.js +1 -0
- package/dist/zonos-elements/{p-8bbe007f.system.entry.js → p-c0e66eb4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7c8ad901.js → p-c61d62ec.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-05b75d37.system.js → p-d1c0bc88.system.js} +1 -1
- package/dist/zonos-elements/{p-5f0c4397.system.js → p-d3a8c7ae.system.js} +2 -2
- package/dist/zonos-elements/{p-2aeb1f26.entry.js → p-dd151786.entry.js} +1 -1
- package/dist/zonos-elements/{p-c1f0aeb4.system.js → p-e987ae90.system.js} +1 -1
- package/dist/zonos-elements/{p-76015899.system.entry.js → p-eca9ebc4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-aab5ccde.entry.js → p-fb85884a.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-c28824a0.system.entry.js +0 -1
- package/dist/zonos-elements/p-f49ca64f.entry.js +0 -1
|
@@ -9826,7 +9826,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
9826
9826
|
cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
|
|
9827
9827
|
}
|
|
9828
9828
|
};
|
|
9829
|
-
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
|
|
9829
|
+
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, shouldInitSessionOnFailure, }) => {
|
|
9830
9830
|
var _a;
|
|
9831
9831
|
if (landedCostId && cartStore.selectedLandedCost) {
|
|
9832
9832
|
// update cart total right away if we have landed cost id to avoid order total flickering
|
|
@@ -9840,7 +9840,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
9840
9840
|
}
|
|
9841
9841
|
// update checkout session
|
|
9842
9842
|
if (!cartStore.checkoutSessionId) {
|
|
9843
|
-
handleFetch.
|
|
9843
|
+
handleFetch.log('Could not update cart total without checkout session id', 'info');
|
|
9844
9844
|
return false;
|
|
9845
9845
|
}
|
|
9846
9846
|
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
@@ -9854,13 +9854,16 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
9854
9854
|
});
|
|
9855
9855
|
if (errors.length > 0 || !json) {
|
|
9856
9856
|
// do nothing if we can't get checkout session
|
|
9857
|
-
handleFetch.logError('Error occurs when updating checkout session');
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9857
|
+
handleFetch.logError('Error occurs when updating checkout session.');
|
|
9858
|
+
if (shouldInitSessionOnFailure) {
|
|
9859
|
+
handleFetch.log('Initiating checkout session on failure', 'info');
|
|
9860
|
+
const success = await stripeStoreInitCheckoutSession();
|
|
9861
|
+
handleFetch.log(`stripeStoreInitCheckoutSession: ${success}`);
|
|
9862
|
+
if (!success) {
|
|
9863
|
+
return false;
|
|
9864
|
+
}
|
|
9865
|
+
return true;
|
|
9866
|
+
}
|
|
9864
9867
|
return false;
|
|
9865
9868
|
}
|
|
9866
9869
|
if (!landedCostId) {
|
|
@@ -9978,6 +9981,8 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
9978
9981
|
currency: currency,
|
|
9979
9982
|
dutiesTaxesFeesEstimate: 0,
|
|
9980
9983
|
itemsAmount: total,
|
|
9984
|
+
// attempt to init session on failure to update checkout session
|
|
9985
|
+
shouldInitSessionOnFailure: true,
|
|
9981
9986
|
});
|
|
9982
9987
|
stripeStore.isFetchingSession = false;
|
|
9983
9988
|
};
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
100
|
-
const cdnUrl = "https://v1.3.
|
|
100
|
+
const cdnUrl = "https://v1.3.91.js.zonos.com";
|
|
101
101
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
102
102
|
if (!qaUrl &&
|
|
103
103
|
(cdnUrl.includes('test.') ||
|
|
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
|
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
})();
|
|
284
|
-
const ZONOS_URL = "https://v1.3.
|
|
285
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
286
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
287
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
284
|
+
const ZONOS_URL = "https://v1.3.91.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.91";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.91";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.91";
|
|
288
288
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
289
289
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
290
290
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
299
299
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
300
300
|
Zonos._paypalMockResponse = null;
|
|
301
301
|
Zonos.isBigCommerce = false;
|
|
302
|
-
Zonos.releaseDate = "
|
|
302
|
+
Zonos.releaseDate = "1728930718892";
|
|
303
303
|
Zonos.isLegacyCheckout = false;
|
|
304
304
|
/**
|
|
305
305
|
* By default, the package will load from npm
|
|
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
307
307
|
Zonos.isNpm = true;
|
|
308
308
|
Zonos.zonosQaUrl = null;
|
|
309
309
|
Zonos.zonosQaUrlApi = null;
|
|
310
|
-
Zonos.version = `v${"1.3.
|
|
310
|
+
Zonos.version = `v${"1.3.91"}`;
|
|
311
311
|
Zonos.modeAlerted = false;
|
|
312
312
|
Zonos.cartData = null;
|
|
313
313
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-3cc424f9.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
7
7
|
|
|
@@ -448,14 +448,10 @@ const paypalStoreInitButtons = (props) => {
|
|
|
448
448
|
.filter(Boolean);
|
|
449
449
|
return paypalStore.paypalButtons;
|
|
450
450
|
};
|
|
451
|
-
const paypalStoreHasPaypalEnabled = () => {
|
|
452
|
-
return !!paypalStore.paypalButtons.length;
|
|
453
|
-
};
|
|
454
451
|
|
|
455
452
|
exports.isContrastColor = isContrastColor;
|
|
456
453
|
exports.paypalInitScript = paypalInitScript;
|
|
457
454
|
exports.paypalStore = paypalStore;
|
|
458
|
-
exports.paypalStoreHasPaypalEnabled = paypalStoreHasPaypalEnabled;
|
|
459
455
|
exports.paypalStoreInitButtons = paypalStoreInitButtons;
|
|
460
456
|
exports.paypalStoreReset = paypalStoreReset;
|
|
461
457
|
exports.submitGtag = submitGtag;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-6abc29b9.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
10
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
10
|
+
const createCustomEvent = require('./createCustomEvent-68a5819f.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-5a64574c.js');
|
|
12
12
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -1288,9 +1288,9 @@ const ZonosCheckoutFinish = class {
|
|
|
1288
1288
|
};
|
|
1289
1289
|
// TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
|
|
1290
1290
|
this.getPullOrder = async (attempts = 0) => {
|
|
1291
|
-
var _a, _b
|
|
1291
|
+
var _a, _b;
|
|
1292
1292
|
const { baseUrl, order } = await this.pullOrder();
|
|
1293
|
-
const legacyOrderNumberExist = !!((
|
|
1293
|
+
const legacyOrderNumberExist = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
|
|
1294
1294
|
// legacy customers are still using the old order number so we need to wait for legacy order number to attach to dgs order before redirecting
|
|
1295
1295
|
if ((order && attempts >= 5) || legacyOrderNumberExist) {
|
|
1296
1296
|
if (!legacyOrderNumberExist) {
|
|
@@ -1446,11 +1446,11 @@ const ZonosCheckoutFinish = class {
|
|
|
1446
1446
|
var _a, _b;
|
|
1447
1447
|
const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || getGraphQlShortId((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
|
|
1448
1448
|
const isTestMode = createCustomEvent.getIsTestMode();
|
|
1449
|
-
return (index.h(index.Host, { key: '
|
|
1449
|
+
return (index.h(index.Host, { key: 'b39124e58c4b12acbd7b29290808248298239e9c', class: "zonos--checkout-finish zonos--elements", style: {
|
|
1450
1450
|
'--border-radius': getBorderRadius.getBorderRadius({
|
|
1451
1451
|
overrideBorderStyle: this.borderRadius,
|
|
1452
1452
|
}),
|
|
1453
|
-
} }, this.isLoading && (index.h("div", { key: '
|
|
1453
|
+
} }, this.isLoading && (index.h("div", { key: 'e63389c86a1bb0c405e7ae3c852fc1c966320f50', class: "loading-wrapper" }, index.h("zonos-spinner", { key: '0caff7b42ab138ad47f4683ea9641b2fef75f714' }))), !this.isLoading && (index.h("div", { key: 'e305f1c720418a22a376807f17413fa97688af86', class: "zonos--finish-details" }, index.h("div", { key: 'dced8dc9e0a7ae68e4bfa6b00d841ba4eae9e1f3', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '343dade4f02efe9c9fdc4c8087b725f2d4e39177', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (index.h("div", { key: 'aa715a39e3126d7cb108c447fb2eb586279fc768', class: "zonos--order-number" }, "Order #", orderId)), index.h("zonos-text", { key: 'ee58b57b784269145d286e59cc87eb4fb5499cf2', textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), index.h("zonos-button", { key: 'a6781fde72abf7b9939e136aa5fdbbdd513a7cf5', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cart.cartStore.step === 'finish' && (index.h("div", { key: '5fd0ea2aa8f48347d027c5c7df1eb892236e7bb0', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: '7fdfb2af11a60f4b20b3ba083dcca1f0ac90ff56', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: 'd627533d236a8d9cdaadce90d550984e25b64554', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
|
|
1454
1454
|
}
|
|
1455
1455
|
static get assetsDirs() { return ["assets"]; }
|
|
1456
1456
|
};
|
|
@@ -1562,12 +1562,8 @@ const ZonosCheckoutPayment = class {
|
|
|
1562
1562
|
this.showErrorBanner = !this.handleValidate();
|
|
1563
1563
|
}
|
|
1564
1564
|
const isTestMode = createCustomEvent.getIsTestMode();
|
|
1565
|
-
const hasPaypalEnabled = paypal.paypalStoreHasPaypalEnabled();
|
|
1566
1565
|
const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
1567
1566
|
return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
|
|
1568
|
-
if (!hasPaypalEnabled) {
|
|
1569
|
-
return;
|
|
1570
|
-
}
|
|
1571
1567
|
this.continueClickHandler();
|
|
1572
1568
|
}, size: "lg",
|
|
1573
1569
|
// use primary type when on mobile mode
|
|
@@ -2211,7 +2207,7 @@ const ZonosShipping = class {
|
|
|
2211
2207
|
...this.serviceLevelsDAP,
|
|
2212
2208
|
...this.serviceLevelsOther,
|
|
2213
2209
|
];
|
|
2214
|
-
const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.
|
|
2210
|
+
const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.shipmentRatingId === ((_a = cart.cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
|
|
2215
2211
|
if (selectedServiceLevel) {
|
|
2216
2212
|
// keep the selected shipping method
|
|
2217
2213
|
this.selectedShippingMethod = selectedServiceLevel;
|
|
@@ -2239,13 +2235,13 @@ const ZonosShipping = class {
|
|
|
2239
2235
|
if (this.showErrorBanner) {
|
|
2240
2236
|
this.showErrorBanner = !this.handleValidate();
|
|
2241
2237
|
}
|
|
2242
|
-
return (index.h(index.Host, { key: '
|
|
2238
|
+
return (index.h(index.Host, { key: '9c866cd1545c3a695b449113a8dbe40560e5fe26', class: "zonos--shipping zonos--elements" }, index.h("div", { key: '7d683e7d7b2c3e25758240ac2299eac06b7f4a51', class: "zonos--group" }, index.h("zonos-text", { key: '5710e5185b2628e7793e59251073fdd8cb8cfd2e', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'afdd98898cb3305d90bfe06832a0b9f672183b47', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: '07543d3f7aec9494311d3cdb38306661d5789f4a', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
|
|
2243
2239
|
!!this.serviceLevelsDAP.length && (index.h("button", { class: classes.classes([
|
|
2244
2240
|
'zonos--shipping-options-collapse-trigger',
|
|
2245
2241
|
this.collapsedDAPOptions && 'collapsed',
|
|
2246
2242
|
]), onClick: () => {
|
|
2247
2243
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
2248
|
-
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '
|
|
2244
|
+
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '7dc61c1435b40731463279f5824b60cf67e1470d', class: "zonos--group-btn" }, index.h("zonos-button", { key: 'eea4d432ad5cfb7001fcd0c7b795b2ee3ebbbac5', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
2249
2245
|
// use primary type when on mobile mode
|
|
2250
2246
|
variant: this.submitBtnType }, cart.translate('Go to payment'))))));
|
|
2251
2247
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
|
+
const paypal = require('./paypal-6abc29b9.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
9
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
9
|
+
const createCustomEvent = require('./createCustomEvent-68a5819f.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
12
12
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-3cc424f9.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-3cc424f9.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-3cc424f9.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
|
-
const paypal = require('./paypal-
|
|
10
|
+
const paypal = require('./paypal-6abc29b9.js');
|
|
11
11
|
require('./isDarkColor-5efc8367.js');
|
|
12
12
|
require('./getBorderRadius-5a64574c.js');
|
|
13
13
|
|
|
@@ -93,9 +93,9 @@ export class ZonosCheckoutFinish {
|
|
|
93
93
|
};
|
|
94
94
|
// TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
|
|
95
95
|
this.getPullOrder = async (attempts = 0) => {
|
|
96
|
-
var _a, _b
|
|
96
|
+
var _a, _b;
|
|
97
97
|
const { baseUrl, order } = await this.pullOrder();
|
|
98
|
-
const legacyOrderNumberExist = !!((
|
|
98
|
+
const legacyOrderNumberExist = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
|
|
99
99
|
// legacy customers are still using the old order number so we need to wait for legacy order number to attach to dgs order before redirecting
|
|
100
100
|
if ((order && attempts >= 5) || legacyOrderNumberExist) {
|
|
101
101
|
if (!legacyOrderNumberExist) {
|
|
@@ -251,11 +251,11 @@ export class ZonosCheckoutFinish {
|
|
|
251
251
|
var _a, _b;
|
|
252
252
|
const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || getGraphQlShortId((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
|
|
253
253
|
const isTestMode = getIsTestMode();
|
|
254
|
-
return (h(Host, { key: '
|
|
254
|
+
return (h(Host, { key: 'b39124e58c4b12acbd7b29290808248298239e9c', class: "zonos--checkout-finish zonos--elements", style: {
|
|
255
255
|
'--border-radius': getBorderRadius({
|
|
256
256
|
overrideBorderStyle: this.borderRadius,
|
|
257
257
|
}),
|
|
258
|
-
} }, this.isLoading && (h("div", { key: '
|
|
258
|
+
} }, this.isLoading && (h("div", { key: 'e63389c86a1bb0c405e7ae3c852fc1c966320f50', class: "loading-wrapper" }, h("zonos-spinner", { key: '0caff7b42ab138ad47f4683ea9641b2fef75f714' }))), !this.isLoading && (h("div", { key: 'e305f1c720418a22a376807f17413fa97688af86', class: "zonos--finish-details" }, h("div", { key: 'dced8dc9e0a7ae68e4bfa6b00d841ba4eae9e1f3', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '343dade4f02efe9c9fdc4c8087b725f2d4e39177', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("div", { key: 'aa715a39e3126d7cb108c447fb2eb586279fc768', class: "zonos--order-number" }, "Order #", orderId)), h("zonos-text", { key: 'ee58b57b784269145d286e59cc87eb4fb5499cf2', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: 'a6781fde72abf7b9939e136aa5fdbbdd513a7cf5', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: '5fd0ea2aa8f48347d027c5c7df1eb892236e7bb0', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '7fdfb2af11a60f4b20b3ba083dcca1f0ac90ff56', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'd627533d236a8d9cdaadce90d550984e25b64554', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
|
|
259
259
|
}
|
|
260
260
|
static get is() { return "zonos-checkout-finish"; }
|
|
261
261
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { cartStore } from "../../../store/checkout/cart";
|
|
3
|
-
import { paypalStore
|
|
3
|
+
import { paypalStore } from "../../../store/checkout/paypal";
|
|
4
4
|
import { stripeStore } from "../../../store/checkout/stripe";
|
|
5
5
|
import { translate } from "../../../store/translationStore";
|
|
6
6
|
import { getIsTestMode } from "../../../utils/checkout/getIsTestMode";
|
|
@@ -51,12 +51,8 @@ export class ZonosCheckoutPayment {
|
|
|
51
51
|
this.showErrorBanner = !this.handleValidate();
|
|
52
52
|
}
|
|
53
53
|
const isTestMode = getIsTestMode();
|
|
54
|
-
const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
|
|
55
54
|
const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
56
55
|
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
|
|
57
|
-
if (!hasPaypalEnabled) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
56
|
this.continueClickHandler();
|
|
61
57
|
}, size: "lg",
|
|
62
58
|
// use primary type when on mobile mode
|
|
@@ -118,7 +118,7 @@ export class ZonosShipping {
|
|
|
118
118
|
...this.serviceLevelsDAP,
|
|
119
119
|
...this.serviceLevelsOther,
|
|
120
120
|
];
|
|
121
|
-
const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.
|
|
121
|
+
const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.shipmentRatingId === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
|
|
122
122
|
if (selectedServiceLevel) {
|
|
123
123
|
// keep the selected shipping method
|
|
124
124
|
this.selectedShippingMethod = selectedServiceLevel;
|
|
@@ -146,13 +146,13 @@ export class ZonosShipping {
|
|
|
146
146
|
if (this.showErrorBanner) {
|
|
147
147
|
this.showErrorBanner = !this.handleValidate();
|
|
148
148
|
}
|
|
149
|
-
return (h(Host, { key: '
|
|
149
|
+
return (h(Host, { key: '9c866cd1545c3a695b449113a8dbe40560e5fe26', class: "zonos--shipping zonos--elements" }, h("div", { key: '7d683e7d7b2c3e25758240ac2299eac06b7f4a51', class: "zonos--group" }, h("zonos-text", { key: '5710e5185b2628e7793e59251073fdd8cb8cfd2e', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'afdd98898cb3305d90bfe06832a0b9f672183b47', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '07543d3f7aec9494311d3cdb38306661d5789f4a', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
|
|
150
150
|
!!this.serviceLevelsDAP.length && (h("button", { class: classes([
|
|
151
151
|
'zonos--shipping-options-collapse-trigger',
|
|
152
152
|
this.collapsedDAPOptions && 'collapsed',
|
|
153
153
|
]), onClick: () => {
|
|
154
154
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
155
|
-
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '
|
|
155
|
+
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '7dc61c1435b40731463279f5824b60cf67e1470d', class: "zonos--group-btn" }, h("zonos-button", { key: 'eea4d432ad5cfb7001fcd0c7b795b2ee3ebbbac5', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
156
156
|
// use primary type when on mobile mode
|
|
157
157
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
158
158
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
|
-
import { stripeStore, stripeStoreReset, stripeStoreUpdateCheckoutSession, } from "./stripe";
|
|
2
|
+
import { stripeStore, stripeStoreInitCheckoutSession, stripeStoreReset, stripeStoreUpdateCheckoutSession, } from "./stripe";
|
|
3
3
|
import { localizationStore } from "../hello/localization";
|
|
4
4
|
import { translate } from "../translationStore";
|
|
5
5
|
import { log } from "../../utils/logging/log";
|
|
@@ -170,7 +170,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
170
170
|
cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
|
-
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
|
|
173
|
+
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, shouldInitSessionOnFailure, }) => {
|
|
174
174
|
var _a;
|
|
175
175
|
if (landedCostId && cartStore.selectedLandedCost) {
|
|
176
176
|
// update cart total right away if we have landed cost id to avoid order total flickering
|
|
@@ -184,7 +184,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
184
184
|
}
|
|
185
185
|
// update checkout session
|
|
186
186
|
if (!cartStore.checkoutSessionId) {
|
|
187
|
-
|
|
187
|
+
log('Could not update cart total without checkout session id', 'info');
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
190
|
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
@@ -198,13 +198,16 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
198
198
|
});
|
|
199
199
|
if (errors.length > 0 || !json) {
|
|
200
200
|
// do nothing if we can't get checkout session
|
|
201
|
-
logError('Error occurs when updating checkout session');
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
201
|
+
logError('Error occurs when updating checkout session.');
|
|
202
|
+
if (shouldInitSessionOnFailure) {
|
|
203
|
+
log('Initiating checkout session on failure', 'info');
|
|
204
|
+
const success = await stripeStoreInitCheckoutSession();
|
|
205
|
+
log(`stripeStoreInitCheckoutSession: ${success}`);
|
|
206
|
+
if (!success) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
208
211
|
return false;
|
|
209
212
|
}
|
|
210
213
|
if (!landedCostId) {
|
|
@@ -322,6 +325,8 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
322
325
|
currency: currency,
|
|
323
326
|
dutiesTaxesFeesEstimate: 0,
|
|
324
327
|
itemsAmount: total,
|
|
328
|
+
// attempt to init session on failure to update checkout session
|
|
329
|
+
shouldInitSessionOnFailure: true,
|
|
325
330
|
});
|
|
326
331
|
stripeStore.isFetchingSession = false;
|
|
327
332
|
};
|
|
@@ -9824,7 +9824,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
9824
9824
|
cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
|
|
9825
9825
|
}
|
|
9826
9826
|
};
|
|
9827
|
-
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
|
|
9827
|
+
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, shouldInitSessionOnFailure, }) => {
|
|
9828
9828
|
var _a;
|
|
9829
9829
|
if (landedCostId && cartStore.selectedLandedCost) {
|
|
9830
9830
|
// update cart total right away if we have landed cost id to avoid order total flickering
|
|
@@ -9838,7 +9838,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
9838
9838
|
}
|
|
9839
9839
|
// update checkout session
|
|
9840
9840
|
if (!cartStore.checkoutSessionId) {
|
|
9841
|
-
|
|
9841
|
+
log('Could not update cart total without checkout session id', 'info');
|
|
9842
9842
|
return false;
|
|
9843
9843
|
}
|
|
9844
9844
|
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
@@ -9852,13 +9852,16 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
9852
9852
|
});
|
|
9853
9853
|
if (errors.length > 0 || !json) {
|
|
9854
9854
|
// do nothing if we can't get checkout session
|
|
9855
|
-
logError('Error occurs when updating checkout session');
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9855
|
+
logError('Error occurs when updating checkout session.');
|
|
9856
|
+
if (shouldInitSessionOnFailure) {
|
|
9857
|
+
log('Initiating checkout session on failure', 'info');
|
|
9858
|
+
const success = await stripeStoreInitCheckoutSession();
|
|
9859
|
+
log(`stripeStoreInitCheckoutSession: ${success}`);
|
|
9860
|
+
if (!success) {
|
|
9861
|
+
return false;
|
|
9862
|
+
}
|
|
9863
|
+
return true;
|
|
9864
|
+
}
|
|
9862
9865
|
return false;
|
|
9863
9866
|
}
|
|
9864
9867
|
if (!landedCostId) {
|
|
@@ -9976,6 +9979,8 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
9976
9979
|
currency: currency,
|
|
9977
9980
|
dutiesTaxesFeesEstimate: 0,
|
|
9978
9981
|
itemsAmount: total,
|
|
9982
|
+
// attempt to init session on failure to update checkout session
|
|
9983
|
+
shouldInitSessionOnFailure: true,
|
|
9979
9984
|
});
|
|
9980
9985
|
stripeStore.isFetchingSession = false;
|
|
9981
9986
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { d as cartStore, l as localizationStore } from './cart-66d67627.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { h as handleFetch } from './handleFetch-0133265e.js';
|
|
4
4
|
|
package/dist/esm/index.js
CHANGED
|
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
97
|
-
const cdnUrl = "https://v1.3.
|
|
97
|
+
const cdnUrl = "https://v1.3.91.js.zonos.com";
|
|
98
98
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
99
99
|
if (!qaUrl &&
|
|
100
100
|
(cdnUrl.includes('test.') ||
|
|
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
|
|
|
278
278
|
}
|
|
279
279
|
return null;
|
|
280
280
|
})();
|
|
281
|
-
const ZONOS_URL = "https://v1.3.
|
|
282
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
283
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
284
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
281
|
+
const ZONOS_URL = "https://v1.3.91.js.zonos.com";
|
|
282
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.91";
|
|
283
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.91";
|
|
284
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.91";
|
|
285
285
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
286
286
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
287
287
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
296
296
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
297
297
|
Zonos._paypalMockResponse = null;
|
|
298
298
|
Zonos.isBigCommerce = false;
|
|
299
|
-
Zonos.releaseDate = "
|
|
299
|
+
Zonos.releaseDate = "1728930718892";
|
|
300
300
|
Zonos.isLegacyCheckout = false;
|
|
301
301
|
/**
|
|
302
302
|
* By default, the package will load from npm
|
|
@@ -304,7 +304,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
304
304
|
Zonos.isNpm = true;
|
|
305
305
|
Zonos.zonosQaUrl = null;
|
|
306
306
|
Zonos.zonosQaUrlApi = null;
|
|
307
|
-
Zonos.version = `v${"1.3.
|
|
307
|
+
Zonos.version = `v${"1.3.91"}`;
|
|
308
308
|
Zonos.modeAlerted = false;
|
|
309
309
|
Zonos.cartData = null;
|
|
310
310
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-0dc7a947.js';
|
|
2
|
-
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-
|
|
2
|
+
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-66d67627.js';
|
|
3
3
|
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-0133265e.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-b3afa948.js';
|
|
5
5
|
|
|
@@ -446,8 +446,5 @@ const paypalStoreInitButtons = (props) => {
|
|
|
446
446
|
.filter(Boolean);
|
|
447
447
|
return paypalStore.paypalButtons;
|
|
448
448
|
};
|
|
449
|
-
const paypalStoreHasPaypalEnabled = () => {
|
|
450
|
-
return !!paypalStore.paypalButtons.length;
|
|
451
|
-
};
|
|
452
449
|
|
|
453
|
-
export { paypalStore as a, paypalStoreReset as b,
|
|
450
|
+
export { paypalStore as a, paypalStoreReset as b, paypalStoreInitButtons as c, isContrastColor as i, paypalInitScript as p, submitGtag as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { j as stripeStore, P as getFallbackDefaultCountryCode, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { j as stripeStore, P as getFallbackDefaultCountryCode, l as localizationStore, t as translate } from './cart-66d67627.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { a as logError, l as log } from './handleFetch-0133265e.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|