@zonos/elements 1.3.139 → 1.3.141
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-0070bff2.js → cart-e1b59d03.js} +180 -1
- package/dist/cjs/index.cjs.js +41 -13
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-7c8a99b0.js → paypal-86cc51e4.js} +13 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +49 -7
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -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-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- 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-payment/zonos-checkout-payment.js +24 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -2
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +11 -4
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +1 -1
- package/dist/collection/components/store/checkout/paypal.js +14 -1
- package/dist/collection/components/store/checkout/stripe.js +9 -0
- package/dist/collection/components/store/hello/localization.js +3 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +6 -0
- package/dist/collection/components/store/translationStore/strings.base.js +6 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +6 -0
- package/dist/collection/components/store/translationStore/strings.french.js +6 -0
- package/dist/collection/components/store/translationStore/strings.german.js +6 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +6 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +6 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +6 -0
- package/dist/collection/components/utils/api/getCheckoutSession.js +14 -0
- package/dist/collection/components/utils/resetToSelectedTab.js +17 -0
- package/dist/collection/components/utils/validateCheckoutSession.js +39 -0
- package/dist/collection/scripts/_zonosBase.js +34 -6
- package/dist/esm/{cart-e5fb3abe.js → cart-709f053f.js} +181 -3
- package/dist/esm/index.js +41 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-9636651e.js → paypal-77a60c44.js} +13 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_13.entry.js +49 -7
- package/dist/esm/zonos-checkout.entry.js +5 -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-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +2 -2
- 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-709f053f.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/paypal-77a60c44.js +17 -0
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.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-elements.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.d.ts +1 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +6 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +6 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/getCheckoutSession.d.ts +9 -0
- package/dist/types/components/utils/resetToSelectedTab.d.ts +12 -0
- package/dist/types/components/utils/validateCheckoutSession.d.ts +9 -0
- package/dist/types/scripts/_zonosBase.d.ts +1 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +5 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +112 -0
- package/dist/types/types/generated/graphql.internal.types.ts +102 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-85545d0b.system.entry.js → p-01ad5be8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0c027d2e.entry.js +1 -0
- package/dist/zonos-elements/{p-d66cbed3.system.entry.js → p-1c4ff7b2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-30f75fc0.system.entry.js → p-22d69480.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3316bcb0.system.entry.js → p-25c7e4fa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-456d8ac3.system.entry.js → p-289ded20.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8d7bad6.entry.js → p-35b8dcde.entry.js} +1 -1
- package/dist/zonos-elements/{p-daf800c5.system.entry.js → p-49e4ca08.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d374ef35.system.entry.js → p-64a04391.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6b0aa1bb.system.js +17 -0
- package/dist/zonos-elements/{p-59f7cc80.entry.js → p-8368a79e.entry.js} +1 -1
- package/dist/zonos-elements/{p-e176da08.system.entry.js → p-896d62a4.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8f9affb3.system.entry.js +1 -0
- package/dist/zonos-elements/p-a58731ec.system.js +1 -0
- package/dist/zonos-elements/{p-9138a10d.entry.js → p-ad1d6ea2.entry.js} +1 -1
- package/dist/zonos-elements/p-afffdfc2.js +1 -0
- package/dist/zonos-elements/{p-3f71bac6.entry.js → p-b832ec52.entry.js} +1 -1
- package/dist/zonos-elements/{p-0931f518.entry.js → p-b9efc660.entry.js} +1 -1
- package/dist/zonos-elements/p-be2feba6.entry.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-244fe3a1.system.entry.js → p-cf72603f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d35376d3.js +17 -0
- package/dist/zonos-elements/{p-035571bf.entry.js → p-e6c31531.entry.js} +1 -1
- package/dist/zonos-elements/{p-99190477.entry.js → p-f2867195.entry.js} +1 -1
- package/dist/zonos-elements/{p-d58b6247.entry.js → p-f8ca3e71.entry.js} +1 -1
- package/dist/zonos-elements/p-f8e8b50e.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +2 -1
- package/dist/esm-es5/cart-e5fb3abe.js +0 -1
- package/dist/esm-es5/paypal-9636651e.js +0 -17
- package/dist/zonos-elements/p-1037c75b.system.js +0 -1
- package/dist/zonos-elements/p-4e4a45cb.js +0 -17
- package/dist/zonos-elements/p-75048606.system.js +0 -1
- package/dist/zonos-elements/p-79a8c9ef.system.js +0 -17
- package/dist/zonos-elements/p-b7652a21.system.entry.js +0 -1
- package/dist/zonos-elements/p-e3112267.entry.js +0 -1
- package/dist/zonos-elements/p-f64e4276.js +0 -1
- package/dist/zonos-elements/p-f66fbfe8.entry.js +0 -1
|
@@ -29,9 +29,8 @@ const ZONOS_URL = process.env.NEXT_PUBLIC_ZONOS_CDN_URL;
|
|
|
29
29
|
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || process.env.NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL;
|
|
30
30
|
const UNPKG_ZONOS_URL = process.env.NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL;
|
|
31
31
|
const CDNJS_ZONOS_URL = process.env.NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL;
|
|
32
|
-
const INTER_FONT_URL = 'https://rsms.me';
|
|
33
32
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
34
|
-
const
|
|
33
|
+
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
35
34
|
export class Zonos {
|
|
36
35
|
}
|
|
37
36
|
_a = Zonos;
|
|
@@ -136,6 +135,8 @@ Zonos.init = async (params) => {
|
|
|
136
135
|
document.body.appendChild(hiddenButton);
|
|
137
136
|
}
|
|
138
137
|
log('init zonos');
|
|
138
|
+
// inject custom script for hosted checkout if can find it in metadata
|
|
139
|
+
_a.injectCustomScriptForHostedCheckout();
|
|
139
140
|
// inject zonos cdn
|
|
140
141
|
_a.injectZonosCdn();
|
|
141
142
|
// inject css for zonos elements
|
|
@@ -155,6 +156,33 @@ Zonos.init = async (params) => {
|
|
|
155
156
|
});
|
|
156
157
|
_a.doneInit = true;
|
|
157
158
|
};
|
|
159
|
+
Zonos.injectCustomScriptForHostedCheckout = () => {
|
|
160
|
+
const cartData = _a.cartData;
|
|
161
|
+
const metadata = (cartData === null || cartData === void 0 ? void 0 : cartData.metadata) || [];
|
|
162
|
+
const headerScript = metadata.find(meta => meta.key === 'customHeaderScript');
|
|
163
|
+
const footerScript = metadata.find(meta => meta.key === 'customFooterScript');
|
|
164
|
+
// Only inject the script if checkout is on Zonos hosted checkout and custom script is available
|
|
165
|
+
if (!window.Zonos.isLegacyCheckout || (!headerScript && !footerScript)) {
|
|
166
|
+
log('Skip injecting custom script for hosted checkout', 'info', {
|
|
167
|
+
footerScript,
|
|
168
|
+
headerScript,
|
|
169
|
+
isLegacyCheckout: window.Zonos.isLegacyCheckout,
|
|
170
|
+
});
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (headerScript) {
|
|
174
|
+
log('Injecting custom header script');
|
|
175
|
+
const script = document.createElement('script');
|
|
176
|
+
script.textContent = headerScript.value;
|
|
177
|
+
document.head.appendChild(script);
|
|
178
|
+
}
|
|
179
|
+
if (footerScript) {
|
|
180
|
+
log('Injecting custom footer script');
|
|
181
|
+
const script = document.createElement('script');
|
|
182
|
+
script.textContent = footerScript.value;
|
|
183
|
+
document.body.appendChild(script);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
158
186
|
Zonos.displayCurrency = () => {
|
|
159
187
|
const zonosHello = document.querySelector('zonos-hello');
|
|
160
188
|
if (zonosHello) {
|
|
@@ -389,13 +417,13 @@ Zonos.injectZonosCss = () => {
|
|
|
389
417
|
};
|
|
390
418
|
Zonos.injectFonts = () => {
|
|
391
419
|
const findFont = () => {
|
|
392
|
-
const links = document.querySelectorAll(`link[rel="stylesheet"][href^="${
|
|
420
|
+
const links = document.querySelectorAll(`link[rel="stylesheet"][href^="${GOOGLE_FONT_URL}"]`);
|
|
393
421
|
for (let i = 0; i < links.length; i++) {
|
|
394
422
|
const link = links[i];
|
|
395
423
|
if (!link) {
|
|
396
424
|
continue;
|
|
397
425
|
}
|
|
398
|
-
if (
|
|
426
|
+
if (GOOGLE_FONT_REGEX.test(link.href)) {
|
|
399
427
|
continue;
|
|
400
428
|
}
|
|
401
429
|
return link;
|
|
@@ -410,12 +438,12 @@ Zonos.injectFonts = () => {
|
|
|
410
438
|
// inject font css for zonos elements
|
|
411
439
|
const fontPreconnect = document.createElement('link');
|
|
412
440
|
fontPreconnect.rel = 'preconnect';
|
|
413
|
-
fontPreconnect.href =
|
|
441
|
+
fontPreconnect.href = GOOGLE_FONT_URL;
|
|
414
442
|
headOrBody.appendChild(fontPreconnect);
|
|
415
443
|
// inject font css for zonos elements
|
|
416
444
|
const font = document.createElement('link');
|
|
417
445
|
font.rel = 'stylesheet';
|
|
418
|
-
font.href = `${
|
|
446
|
+
font.href = `${GOOGLE_FONT_URL}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`;
|
|
419
447
|
headOrBody.appendChild(font);
|
|
420
448
|
log('Zonos font injected!');
|
|
421
449
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-c493c4fe.js';
|
|
2
|
-
import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, j as jsonParse } from './handleFetch-22cb914b.js';
|
|
2
|
+
import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, b as allLogs, j as jsonParse } from './handleFetch-22cb914b.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor-c6924924.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-bdd709e7.js';
|
|
5
5
|
|
|
@@ -175,6 +175,9 @@ const stringsArabic = {
|
|
|
175
175
|
'No countries found': {
|
|
176
176
|
value: 'لم يتم العثور على دول',
|
|
177
177
|
},
|
|
178
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
179
|
+
value: 'لم يتم اختيار تقييم الشحنة. يرجى العودة إلى خطوة "الشحن" واختيار تقييم الشحنة للمتابعة.',
|
|
180
|
+
},
|
|
178
181
|
'No shipping method selected': {
|
|
179
182
|
value: 'لم يتم تحديد طريقة الشحن',
|
|
180
183
|
},
|
|
@@ -370,6 +373,9 @@ const stringsArabic = {
|
|
|
370
373
|
'Unable to check inventory. Please try again.': {
|
|
371
374
|
value: 'تعذر التحقق من المخزون. حاول مرة أخرى.',
|
|
372
375
|
},
|
|
376
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
377
|
+
value: 'غير قادر على استرداد جلسة الدفع في الوقت الحالي. يرجى المحاولة مرة أخرى أو الاتصال بفريق الدعم لدينا.',
|
|
378
|
+
},
|
|
373
379
|
'Update address': {
|
|
374
380
|
value: 'تحديث العنوان',
|
|
375
381
|
},
|
|
@@ -613,6 +619,9 @@ const stringsBase = {
|
|
|
613
619
|
'No countries found': {
|
|
614
620
|
value: 'No countries found',
|
|
615
621
|
},
|
|
622
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
623
|
+
value: 'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.',
|
|
624
|
+
},
|
|
616
625
|
'No shipping method selected': {
|
|
617
626
|
value: 'No shipping method selected',
|
|
618
627
|
},
|
|
@@ -808,6 +817,9 @@ const stringsBase = {
|
|
|
808
817
|
'Unable to check inventory. Please try again.': {
|
|
809
818
|
value: 'Unable to check inventory. Please try again.',
|
|
810
819
|
},
|
|
820
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
821
|
+
value: 'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.',
|
|
822
|
+
},
|
|
811
823
|
'Update address': {
|
|
812
824
|
value: 'Update address',
|
|
813
825
|
},
|
|
@@ -1051,6 +1063,9 @@ const stringsChinese = {
|
|
|
1051
1063
|
'No countries found': {
|
|
1052
1064
|
value: '未找到国家',
|
|
1053
1065
|
},
|
|
1066
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
1067
|
+
value: '未选择运费评级。请返回到"运输"步骤并选择运费评级以继续。',
|
|
1068
|
+
},
|
|
1054
1069
|
'No shipping method selected': {
|
|
1055
1070
|
value: '未选择运输方式',
|
|
1056
1071
|
},
|
|
@@ -1246,6 +1261,9 @@ const stringsChinese = {
|
|
|
1246
1261
|
'Unable to check inventory. Please try again.': {
|
|
1247
1262
|
value: '无法检查库存。请再试一次。',
|
|
1248
1263
|
},
|
|
1264
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
1265
|
+
value: '目前无法检索结账会话。请重试或联系我们的支持团队。',
|
|
1266
|
+
},
|
|
1249
1267
|
'Update address': {
|
|
1250
1268
|
value: '更新地址',
|
|
1251
1269
|
},
|
|
@@ -1489,6 +1507,9 @@ const stringsDanish = {
|
|
|
1489
1507
|
'No countries found': {
|
|
1490
1508
|
value: 'Ingen lande fundet',
|
|
1491
1509
|
},
|
|
1510
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
1511
|
+
value: 'Ingen forsendelsesvurdering valgt. Gå venligst tilbage til "Forsendelse"-trinnet og vælg en forsendelsesvurdering for at fortsætte.',
|
|
1512
|
+
},
|
|
1492
1513
|
'No shipping method selected': {
|
|
1493
1514
|
value: 'Ingen leveringsmetode valgt',
|
|
1494
1515
|
},
|
|
@@ -1684,6 +1705,9 @@ const stringsDanish = {
|
|
|
1684
1705
|
'Unable to check inventory. Please try again.': {
|
|
1685
1706
|
value: 'Kunne ikke tjekke lagerbeholdningen. Prøv venligst igen.',
|
|
1686
1707
|
},
|
|
1708
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
1709
|
+
value: 'Kan ikke hente betalingssessionen i øjeblikket. Prøv venligst igen eller kontakt vores supportteam.',
|
|
1710
|
+
},
|
|
1687
1711
|
'Update address': {
|
|
1688
1712
|
value: 'Opdater adresse',
|
|
1689
1713
|
},
|
|
@@ -1927,6 +1951,9 @@ const stringsDutch = {
|
|
|
1927
1951
|
'No countries found': {
|
|
1928
1952
|
value: 'Geen landen gevonden',
|
|
1929
1953
|
},
|
|
1954
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
1955
|
+
value: 'Geen verzendbeoordeling geselecteerd. Ga alstublieft terug naar de stap "Verzending" en selecteer een verzendbeoordeling om door te gaan.',
|
|
1956
|
+
},
|
|
1930
1957
|
'No shipping method selected': {
|
|
1931
1958
|
value: 'Geen verzendmethode geselecteerd',
|
|
1932
1959
|
},
|
|
@@ -2122,6 +2149,9 @@ const stringsDutch = {
|
|
|
2122
2149
|
'Unable to check inventory. Please try again.': {
|
|
2123
2150
|
value: 'Kon de voorraad niet controleren. Probeer het opnieuw.',
|
|
2124
2151
|
},
|
|
2152
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
2153
|
+
value: 'Kan de betaal sessie momenteel niet ophalen. Probeer het opnieuw of neem contact op met ons ondersteuningsteam.',
|
|
2154
|
+
},
|
|
2125
2155
|
'Update address': {
|
|
2126
2156
|
value: 'Adres bijwerken',
|
|
2127
2157
|
},
|
|
@@ -2365,6 +2395,9 @@ const stringsFrench = {
|
|
|
2365
2395
|
'No countries found': {
|
|
2366
2396
|
value: 'Aucun pays trouvé',
|
|
2367
2397
|
},
|
|
2398
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
2399
|
+
value: `Aucune évaluation d'expédition sélectionnée. Veuillez revenir à l'étape "Expédition" et sélectionner une évaluation d'expédition pour continuer.`,
|
|
2400
|
+
},
|
|
2368
2401
|
'No shipping method selected': {
|
|
2369
2402
|
value: 'Aucune méthode de livraison sélectionnée',
|
|
2370
2403
|
},
|
|
@@ -2560,6 +2593,9 @@ const stringsFrench = {
|
|
|
2560
2593
|
'Unable to check inventory. Please try again.': {
|
|
2561
2594
|
value: "Impossible de vérifier l'inventaire. Veuillez réessayer.",
|
|
2562
2595
|
},
|
|
2596
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
2597
|
+
value: "Impossible de récupérer la session de paiement pour le moment. Veuillez réessayer ou contacter notre équipe d'assistance.",
|
|
2598
|
+
},
|
|
2563
2599
|
'Update address': {
|
|
2564
2600
|
value: "Mettre à jour l'adresse",
|
|
2565
2601
|
},
|
|
@@ -2803,6 +2839,9 @@ const stringsGerman = {
|
|
|
2803
2839
|
'No countries found': {
|
|
2804
2840
|
value: 'Keine Länder gefunden',
|
|
2805
2841
|
},
|
|
2842
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
2843
|
+
value: 'Keine Versandbewertung ausgewählt. Bitte gehen Sie zurück zum Schritt "Versand" und wählen Sie eine Versandbewertung aus, um fortzufahren.',
|
|
2844
|
+
},
|
|
2806
2845
|
'No shipping method selected': {
|
|
2807
2846
|
value: 'Keine Versandart ausgewählt',
|
|
2808
2847
|
},
|
|
@@ -2998,6 +3037,9 @@ const stringsGerman = {
|
|
|
2998
3037
|
'Unable to check inventory. Please try again.': {
|
|
2999
3038
|
value: 'Inventar konnte nicht überprüft werden. Bitte versuchen Sie es erneut.',
|
|
3000
3039
|
},
|
|
3040
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
3041
|
+
value: 'Die Checkout-Sitzung kann momentan nicht abgerufen werden. Bitte versuchen Sie es erneut oder kontaktieren Sie unser Support-Team.',
|
|
3042
|
+
},
|
|
3001
3043
|
'Update address': {
|
|
3002
3044
|
value: 'Adresse aktualisieren',
|
|
3003
3045
|
},
|
|
@@ -3241,6 +3283,9 @@ const stringsHebrew = {
|
|
|
3241
3283
|
'No countries found': {
|
|
3242
3284
|
value: 'לא נמצאו מדינות',
|
|
3243
3285
|
},
|
|
3286
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
3287
|
+
value: 'לא נבחר דירוג משלוח. אנא חזור לשלב "משלוח" ובחר דירוג משלוח כדי להמשיך.',
|
|
3288
|
+
},
|
|
3244
3289
|
'No shipping method selected': {
|
|
3245
3290
|
value: 'לא נבחרה שיטת משלוח',
|
|
3246
3291
|
},
|
|
@@ -3436,6 +3481,9 @@ const stringsHebrew = {
|
|
|
3436
3481
|
'Unable to check inventory. Please try again.': {
|
|
3437
3482
|
value: 'לא ניתן היה לבדוק את המלאי. אנא נסה שוב.',
|
|
3438
3483
|
},
|
|
3484
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
3485
|
+
value: 'לא ניתן לאחזר את מושב התשלום כרגע. אנא נסה שוב או צור קשר עם צוות התמיכה שלנו.',
|
|
3486
|
+
},
|
|
3439
3487
|
'Update address': {
|
|
3440
3488
|
value: 'עדכון כתובת',
|
|
3441
3489
|
},
|
|
@@ -3679,6 +3727,9 @@ const stringsIndonesian = {
|
|
|
3679
3727
|
'No countries found': {
|
|
3680
3728
|
value: 'Tidak ada negara yang ditemukan',
|
|
3681
3729
|
},
|
|
3730
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
3731
|
+
value: 'Tidak ada penilaian pengiriman yang dipilih. Silakan kembali ke langkah "Pengiriman" dan pilih penilaian pengiriman untuk melanjutkan.',
|
|
3732
|
+
},
|
|
3682
3733
|
'No shipping method selected': {
|
|
3683
3734
|
value: 'Tidak ada metode pengiriman yang dipilih',
|
|
3684
3735
|
},
|
|
@@ -3874,6 +3925,9 @@ const stringsIndonesian = {
|
|
|
3874
3925
|
'Unable to check inventory. Please try again.': {
|
|
3875
3926
|
value: 'Tidak dapat memeriksa inventaris. Silakan coba lagi.',
|
|
3876
3927
|
},
|
|
3928
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
3929
|
+
value: 'Tidak dapat mengambil sesi checkout saat ini. Silakan coba lagi atau hubungi tim dukungan kami.',
|
|
3930
|
+
},
|
|
3877
3931
|
'Update address': {
|
|
3878
3932
|
value: 'Perbarui alamat',
|
|
3879
3933
|
},
|
|
@@ -4117,6 +4171,9 @@ const stringsItalian = {
|
|
|
4117
4171
|
'No countries found': {
|
|
4118
4172
|
value: 'Nessun paese trovato',
|
|
4119
4173
|
},
|
|
4174
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
4175
|
+
value: 'Nessuna valutazione di spedizione selezionata. Si prega di tornare al passaggio "Spedizione" e selezionare una valutazione di spedizione per procedere.',
|
|
4176
|
+
},
|
|
4120
4177
|
'No shipping method selected': {
|
|
4121
4178
|
value: 'Nessun metodo di spedizione selezionato',
|
|
4122
4179
|
},
|
|
@@ -4312,6 +4369,9 @@ const stringsItalian = {
|
|
|
4312
4369
|
'Unable to check inventory. Please try again.': {
|
|
4313
4370
|
value: "Impossibile verificare l'inventario. Si prega di riprovare.",
|
|
4314
4371
|
},
|
|
4372
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
4373
|
+
value: 'Impossibile recuperare la sessione di pagamento al momento. Si prega di riprovare o contattare il nostro team di supporto.',
|
|
4374
|
+
},
|
|
4315
4375
|
'Update address': {
|
|
4316
4376
|
value: 'Aggiorna indirizzo',
|
|
4317
4377
|
},
|
|
@@ -4555,6 +4615,9 @@ const stringsJapanese = {
|
|
|
4555
4615
|
'No countries found': {
|
|
4556
4616
|
value: '国が見つかりません',
|
|
4557
4617
|
},
|
|
4618
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
4619
|
+
value: '配送評価が選択されていません。「配送」ステップに戻り、配送評価を選択して続行してください。',
|
|
4620
|
+
},
|
|
4558
4621
|
'No shipping method selected': {
|
|
4559
4622
|
value: '配送方法が選択されていません',
|
|
4560
4623
|
},
|
|
@@ -4750,6 +4813,9 @@ const stringsJapanese = {
|
|
|
4750
4813
|
'Unable to check inventory. Please try again.': {
|
|
4751
4814
|
value: '在庫を確認できません。再試行してください。',
|
|
4752
4815
|
},
|
|
4816
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
4817
|
+
value: '現在、チェックアウトセッションを取得できません。もう一度お試しいただくか、サポートチームにお問い合わせください。',
|
|
4818
|
+
},
|
|
4753
4819
|
'Update address': {
|
|
4754
4820
|
value: '住所を更新',
|
|
4755
4821
|
},
|
|
@@ -4993,6 +5059,9 @@ const stringsKorean = {
|
|
|
4993
5059
|
'No countries found': {
|
|
4994
5060
|
value: '국가를 찾을 수 없습니다',
|
|
4995
5061
|
},
|
|
5062
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
5063
|
+
value: '배송 등급이 선택되지 않았습니다. "배송" 단계로 돌아가서 배송 등급을 선택하여 진행하세요.',
|
|
5064
|
+
},
|
|
4996
5065
|
'No shipping method selected': {
|
|
4997
5066
|
value: '선택된 배송 방법이 없습니다',
|
|
4998
5067
|
},
|
|
@@ -5188,6 +5257,9 @@ const stringsKorean = {
|
|
|
5188
5257
|
'Unable to check inventory. Please try again.': {
|
|
5189
5258
|
value: '재고를 확인할 수 없습니다. 다시 시도해 주세요.',
|
|
5190
5259
|
},
|
|
5260
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
5261
|
+
value: '현재 결제 세션을 가져올 수 없습니다. 다시 시도하거나 지원 팀에 문의하십시오.',
|
|
5262
|
+
},
|
|
5191
5263
|
'Update address': {
|
|
5192
5264
|
value: '주소 업데이트',
|
|
5193
5265
|
},
|
|
@@ -5431,6 +5503,9 @@ const stringsNorwegian = {
|
|
|
5431
5503
|
'No countries found': {
|
|
5432
5504
|
value: 'Ingen land funnet',
|
|
5433
5505
|
},
|
|
5506
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
5507
|
+
value: 'Ingen forsendelsesvurdering valgt. Vennligst gå tilbake til "Frakt"-trinnet og velg en forsendelsesvurdering for å fortsette.',
|
|
5508
|
+
},
|
|
5434
5509
|
'No shipping method selected': {
|
|
5435
5510
|
value: 'Ingen fraktmetode valgt',
|
|
5436
5511
|
},
|
|
@@ -5626,6 +5701,9 @@ const stringsNorwegian = {
|
|
|
5626
5701
|
'Unable to check inventory. Please try again.': {
|
|
5627
5702
|
value: 'Kunne ikke sjekke lagerbeholdningen. Vennligst prøv igjen.',
|
|
5628
5703
|
},
|
|
5704
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
5705
|
+
value: 'Kan ikke hente utsjekkingsøkten for øyeblikket. Vennligst prøv igjen eller kontakt vårt supportteam.',
|
|
5706
|
+
},
|
|
5629
5707
|
'Update address': {
|
|
5630
5708
|
value: 'Oppdater adresse',
|
|
5631
5709
|
},
|
|
@@ -5869,6 +5947,9 @@ const stringsPolish = {
|
|
|
5869
5947
|
'No countries found': {
|
|
5870
5948
|
value: 'Nie znaleziono krajów',
|
|
5871
5949
|
},
|
|
5950
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
5951
|
+
value: 'Nie wybrano oceny przesyłki. Proszę wrócić do kroku "Wysyłka" i wybrać ocenę przesyłki, aby kontynuować.',
|
|
5952
|
+
},
|
|
5872
5953
|
'No shipping method selected': {
|
|
5873
5954
|
value: 'Nie wybrano metody wysyłki',
|
|
5874
5955
|
},
|
|
@@ -6064,6 +6145,9 @@ const stringsPolish = {
|
|
|
6064
6145
|
'Unable to check inventory. Please try again.': {
|
|
6065
6146
|
value: 'Nie można sprawdzić stanu magazynu. Spróbuj ponownie.',
|
|
6066
6147
|
},
|
|
6148
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
6149
|
+
value: 'Nie można pobrać sesji kasy w tej chwili. Proszę spróbować ponownie lub skontaktować się z naszym zespołem wsparcia.',
|
|
6150
|
+
},
|
|
6067
6151
|
'Update address': {
|
|
6068
6152
|
value: 'Zaktualizuj adres',
|
|
6069
6153
|
},
|
|
@@ -6307,6 +6391,9 @@ const stringsPortuguese = {
|
|
|
6307
6391
|
'No countries found': {
|
|
6308
6392
|
value: 'Nenhum país encontrado',
|
|
6309
6393
|
},
|
|
6394
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
6395
|
+
value: 'Nenhuma classificação de envio selecionada. Por favor, volte para a etapa de "Envio" e selecione uma classificação de envio para prosseguir.',
|
|
6396
|
+
},
|
|
6310
6397
|
'No shipping method selected': {
|
|
6311
6398
|
value: 'Nenhum método de envio selecionado',
|
|
6312
6399
|
},
|
|
@@ -6502,6 +6589,9 @@ const stringsPortuguese = {
|
|
|
6502
6589
|
'Unable to check inventory. Please try again.': {
|
|
6503
6590
|
value: 'Não foi possível verificar o inventário. Por favor, tente novamente.',
|
|
6504
6591
|
},
|
|
6592
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
6593
|
+
value: 'Não é possível recuperar a sessão de checkout no momento. Por favor, tente novamente ou entre em contato com nossa equipe de suporte.',
|
|
6594
|
+
},
|
|
6505
6595
|
'Update address': {
|
|
6506
6596
|
value: 'Atualizar endereço',
|
|
6507
6597
|
},
|
|
@@ -6745,6 +6835,9 @@ const stringsRussian = {
|
|
|
6745
6835
|
'No countries found': {
|
|
6746
6836
|
value: 'Страны не найдены',
|
|
6747
6837
|
},
|
|
6838
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
6839
|
+
value: 'Не выбран рейтинг доставки. Пожалуйста, вернитесь к шагу "Доставка" и выберите рейтинг доставки, чтобы продолжить.',
|
|
6840
|
+
},
|
|
6748
6841
|
'No shipping method selected': {
|
|
6749
6842
|
value: 'Метод доставки не выбран',
|
|
6750
6843
|
},
|
|
@@ -6940,6 +7033,9 @@ const stringsRussian = {
|
|
|
6940
7033
|
'Unable to check inventory. Please try again.': {
|
|
6941
7034
|
value: 'Не удалось проверить наличие на складе. Пожалуйста, попробуйте снова.',
|
|
6942
7035
|
},
|
|
7036
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
7037
|
+
value: 'Не удается получить сеанс оформления заказа в данный момент. Пожалуйста, попробуйте еще раз или свяжитесь с нашей службой поддержки.',
|
|
7038
|
+
},
|
|
6943
7039
|
'Update address': {
|
|
6944
7040
|
value: 'Обновить адрес',
|
|
6945
7041
|
},
|
|
@@ -7183,6 +7279,9 @@ const stringsSpanish = {
|
|
|
7183
7279
|
'No countries found': {
|
|
7184
7280
|
value: 'No se encontraron países',
|
|
7185
7281
|
},
|
|
7282
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
7283
|
+
value: 'No se ha seleccionado una calificación de envío. Por favor, regrese al paso de "Envío" y seleccione una calificación de envío para continuar.',
|
|
7284
|
+
},
|
|
7186
7285
|
'No shipping method selected': {
|
|
7187
7286
|
value: 'No se ha seleccionado un método de envío',
|
|
7188
7287
|
},
|
|
@@ -7378,6 +7477,9 @@ const stringsSpanish = {
|
|
|
7378
7477
|
'Unable to check inventory. Please try again.': {
|
|
7379
7478
|
value: 'No se pudo verificar el inventario. Por favor, inténtelo de nuevo.',
|
|
7380
7479
|
},
|
|
7480
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
7481
|
+
value: 'No se puede recuperar la sesión de pago en este momento. Por favor, inténtelo de nuevo o contacte a nuestro equipo de soporte.',
|
|
7482
|
+
},
|
|
7381
7483
|
'Update address': {
|
|
7382
7484
|
value: 'Actualizar dirección',
|
|
7383
7485
|
},
|
|
@@ -7621,6 +7723,9 @@ const stringsSwedish = {
|
|
|
7621
7723
|
'No countries found': {
|
|
7622
7724
|
value: 'Inga länder hittades',
|
|
7623
7725
|
},
|
|
7726
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
7727
|
+
value: 'Ingen fraktbedömning vald. Gå tillbaka till steget "Frakt" och välj en fraktbedömning för att fortsätta.',
|
|
7728
|
+
},
|
|
7624
7729
|
'No shipping method selected': {
|
|
7625
7730
|
value: 'Ingen fraktmetod vald',
|
|
7626
7731
|
},
|
|
@@ -7816,6 +7921,9 @@ const stringsSwedish = {
|
|
|
7816
7921
|
'Unable to check inventory. Please try again.': {
|
|
7817
7922
|
value: 'Det gick inte att kontrollera lagret. Försök igen.',
|
|
7818
7923
|
},
|
|
7924
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
7925
|
+
value: 'Kan inte hämta betalningssessionen just nu. Försök igen eller kontakta vårt supportteam.',
|
|
7926
|
+
},
|
|
7819
7927
|
'Update address': {
|
|
7820
7928
|
value: 'Uppdatera adress',
|
|
7821
7929
|
},
|
|
@@ -8059,6 +8167,9 @@ const stringsTurkish = {
|
|
|
8059
8167
|
'No countries found': {
|
|
8060
8168
|
value: 'Ülke bulunamadı',
|
|
8061
8169
|
},
|
|
8170
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
8171
|
+
value: 'Gönderi derecelendirmesi seçilmedi. Lütfen "Kargo" adımına geri dönün ve devam etmek için bir gönderi derecelendirmesi seçin.',
|
|
8172
|
+
},
|
|
8062
8173
|
'No shipping method selected': {
|
|
8063
8174
|
value: 'Kargo yöntemi seçilmedi',
|
|
8064
8175
|
},
|
|
@@ -8254,6 +8365,9 @@ const stringsTurkish = {
|
|
|
8254
8365
|
'Unable to check inventory. Please try again.': {
|
|
8255
8366
|
value: 'Envanter kontrol edilemedi. Lütfen tekrar deneyin.',
|
|
8256
8367
|
},
|
|
8368
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
8369
|
+
value: 'Şu anda ödeme oturumunu alamıyoruz. Lütfen tekrar deneyin veya destek ekibimizle iletişime geçin.',
|
|
8370
|
+
},
|
|
8257
8371
|
'Update address': {
|
|
8258
8372
|
value: 'Adresi güncelle',
|
|
8259
8373
|
},
|
|
@@ -8497,6 +8611,9 @@ const stringsVietnamese = {
|
|
|
8497
8611
|
'No countries found': {
|
|
8498
8612
|
value: 'Không tìm thấy quốc gia nào',
|
|
8499
8613
|
},
|
|
8614
|
+
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
8615
|
+
value: 'Chưa chọn đánh giá vận chuyển. Vui lòng quay lại bước "Vận chuyển" và chọn đánh giá vận chuyển để tiếp tục.',
|
|
8616
|
+
},
|
|
8500
8617
|
'No shipping method selected': {
|
|
8501
8618
|
value: 'Chưa chọn phương thức vận chuyển',
|
|
8502
8619
|
},
|
|
@@ -8692,6 +8809,9 @@ const stringsVietnamese = {
|
|
|
8692
8809
|
'Unable to check inventory. Please try again.': {
|
|
8693
8810
|
value: 'Không thể kiểm tra hàng tồn kho. Vui lòng thử lại.',
|
|
8694
8811
|
},
|
|
8812
|
+
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
8813
|
+
value: 'Không thể truy xuất phiên thanh toán vào lúc này. Vui lòng thử lại hoặc liên hệ với đội ngũ hỗ trợ của chúng tôi.',
|
|
8814
|
+
},
|
|
8695
8815
|
'Update address': {
|
|
8696
8816
|
value: 'Cập nhật địa chỉ',
|
|
8697
8817
|
},
|
|
@@ -9329,6 +9449,7 @@ const getNewLocalization = async () => {
|
|
|
9329
9449
|
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
9330
9450
|
};
|
|
9331
9451
|
const getCustomMessages = async () => {
|
|
9452
|
+
log(`Getting custom messages for ${localizationStore.selectedCountryCode}`);
|
|
9332
9453
|
if (!localizationStore.selectedCountryCode || !zonosStore.storeId) {
|
|
9333
9454
|
return;
|
|
9334
9455
|
}
|
|
@@ -9388,7 +9509,6 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
9388
9509
|
}
|
|
9389
9510
|
localizationStore.targetCurrency = currencyCode;
|
|
9390
9511
|
void getNewLocalization();
|
|
9391
|
-
void getCustomMessages();
|
|
9392
9512
|
// Save the country code to session storage for later use
|
|
9393
9513
|
window.sessionStorage.setItem('zonos--country', selectedCountryCode);
|
|
9394
9514
|
// Update the URL query param with the new country code
|
|
@@ -9449,6 +9569,7 @@ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
|
|
|
9449
9569
|
localizationStore.selectedLocale = newSelectedLocale;
|
|
9450
9570
|
translationStoreUpdateLanguage(newSelectedLocale);
|
|
9451
9571
|
void updateCheckoutSessionLanguage();
|
|
9572
|
+
void getCustomMessages();
|
|
9452
9573
|
};
|
|
9453
9574
|
const initLocalizationStore = async () => {
|
|
9454
9575
|
// all countries from countries.json, shipping zone and localization
|
|
@@ -9464,6 +9585,7 @@ const initLocalizationStore = async () => {
|
|
|
9464
9585
|
initHelloCountryList(allCountries || {});
|
|
9465
9586
|
const { country, locale } = localization;
|
|
9466
9587
|
log(`Country code from localization: ${country}`);
|
|
9588
|
+
log(`Locale from localization: ${locale}`);
|
|
9467
9589
|
// update selected country code in store
|
|
9468
9590
|
localizationStoreUpdateSelectedCountryCode(country);
|
|
9469
9591
|
// use locale from params if it exists, otherwise use locale from localization
|
|
@@ -9912,6 +10034,54 @@ const sortServiceLevelOptionsByAmount = (serviceLevels) => {
|
|
|
9912
10034
|
return sortedServiceLevels;
|
|
9913
10035
|
};
|
|
9914
10036
|
|
|
10037
|
+
const getCheckoutSession = async () => {
|
|
10038
|
+
if (!cartStore.checkoutSessionId) {
|
|
10039
|
+
return {
|
|
10040
|
+
errors: [{ message: 'No checkout session id found' }],
|
|
10041
|
+
json: null,
|
|
10042
|
+
};
|
|
10043
|
+
}
|
|
10044
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
10045
|
+
searchParams.set('checkoutSessionId', cartStore.checkoutSessionId);
|
|
10046
|
+
const { errors, json } = await handleFetch(`/api/zonos-elements/get-checkout-session?${searchParams.toString()}`);
|
|
10047
|
+
return { errors, json };
|
|
10048
|
+
};
|
|
10049
|
+
|
|
10050
|
+
/**
|
|
10051
|
+
* Validate checkout session before confirming payment
|
|
10052
|
+
*/
|
|
10053
|
+
const validateCheckoutSession = async () => {
|
|
10054
|
+
var _a;
|
|
10055
|
+
// get checkout session info
|
|
10056
|
+
const { errors, json } = await getCheckoutSession();
|
|
10057
|
+
if (errors.length || !json) {
|
|
10058
|
+
logError('Failed to retrieve checkout session info before confirming payment ', errors);
|
|
10059
|
+
void sendErrorLog({
|
|
10060
|
+
endpoint: 'validateCheckoutSession',
|
|
10061
|
+
errors: errors.map(error => error.message),
|
|
10062
|
+
metadata: { allLogs },
|
|
10063
|
+
});
|
|
10064
|
+
return {
|
|
10065
|
+
errorMessage: translate('Unable to retrieve the checkout session at the moment. Please try again or contact our support team.'),
|
|
10066
|
+
valid: false,
|
|
10067
|
+
};
|
|
10068
|
+
}
|
|
10069
|
+
// Make sure landed cost is found in the checkout session
|
|
10070
|
+
if (!((_a = json.checkoutSession.landedCost) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
10071
|
+
logError('Landed cost is not found in the checkout session before confirming payment.');
|
|
10072
|
+
void sendErrorLog({
|
|
10073
|
+
endpoint: 'validateCheckoutSession',
|
|
10074
|
+
errors: ['No landed cost found before confirming payment'],
|
|
10075
|
+
metadata: { allLogs },
|
|
10076
|
+
});
|
|
10077
|
+
return {
|
|
10078
|
+
errorMessage: translate('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),
|
|
10079
|
+
valid: false,
|
|
10080
|
+
};
|
|
10081
|
+
}
|
|
10082
|
+
return { errorMessage: '', valid: true };
|
|
10083
|
+
};
|
|
10084
|
+
|
|
9915
10085
|
const addressRuleStyle = ({ theme, }) => {
|
|
9916
10086
|
const defaultStyle = {
|
|
9917
10087
|
'.AccordionItem': {
|
|
@@ -9984,6 +10154,7 @@ const defaultVariable = ({ borderStyle, theme, }) => {
|
|
|
9984
10154
|
|
|
9985
10155
|
const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = createStore(() => ({
|
|
9986
10156
|
clientSecret: sessionStorage.getItem('zonos--client-secret') || null,
|
|
10157
|
+
customErrorMessage: null,
|
|
9987
10158
|
fetchingLandedCostAbortController: null,
|
|
9988
10159
|
hasPaymentError: false,
|
|
9989
10160
|
isFetchingLandedCost: false,
|
|
@@ -10430,9 +10601,16 @@ const stripeStoreConfirmPayment = async () => {
|
|
|
10430
10601
|
const stripeElements = stripeStore.stripeElements;
|
|
10431
10602
|
const stripe = stripeStore.stripe;
|
|
10432
10603
|
const stripeClientSecret = stripeStore.clientSecret;
|
|
10604
|
+
stripeStore.customErrorMessage = null;
|
|
10433
10605
|
if (!((_b = cartStore.selectedLandedCost) === null || _b === void 0 ? void 0 : _b.landedCost.id)) {
|
|
10434
10606
|
throw new Error('Attempted to confirm the payment when no landed cost is found in store');
|
|
10435
10607
|
}
|
|
10608
|
+
// Check if the checkout session is valid before proceeding
|
|
10609
|
+
const checkoutSessionStatus = await validateCheckoutSession();
|
|
10610
|
+
if (!checkoutSessionStatus.valid) {
|
|
10611
|
+
stripeStore.customErrorMessage = checkoutSessionStatus.errorMessage;
|
|
10612
|
+
throw new Error(checkoutSessionStatus.errorMessage);
|
|
10613
|
+
}
|
|
10436
10614
|
if (stripe &&
|
|
10437
10615
|
stripeElements &&
|
|
10438
10616
|
stripePaymentReady &&
|
|
@@ -11092,4 +11270,4 @@ const cartStoreResetTabItems = () => {
|
|
|
11092
11270
|
cartStoreResetSelectedShippingOption();
|
|
11093
11271
|
};
|
|
11094
11272
|
|
|
11095
|
-
export { stripeStoreReset as A, localizationStoreOnUpdate as B,
|
|
11273
|
+
export { stripeStoreReset as A, localizationStoreOnUpdate as B, validateCheckoutSession as C, isValidSelector as D, initLocalizationStore as E, setZCountryUrlParam as F, currencyDisplay as G, currencyConvertAndFormat as H, currencyConvert as I, currencyFormat as J, cartStoreHasOneEligibleItem as K, stripeStoreApplyPromoCode as L, stripeStoreRemovePromoCode as M, stripeStoreResetPromoCode as N, stripeStoreMessageBasedOnStatus as O, stripeStoreTranslateAddressToLatin as P, cartStoreUpdateSelectedShippingOption as Q, cartStoreGetShippingTransitInfo as R, sortServiceLevelOptionsByAmount as S, getFallbackDefaultCountryCode as T, localizationStoreUpdateSelectedLocale as U, localizationStoreUpdateSelectedCountryCode as a, stripeStoreCleanupDomesticShippingSession as b, stripeStoreSaveDomesticShippingSession as c, stripeStoreRetrievePayment as d, cartStore as e, stripeStore as f, cartStoreUpdateItems as g, cartStoreReset as h, initStripeElements as i, cartStoreResetTabItems as j, cartStoreClearCheckoutInterval as k, localizationStore as l, stripeStoreInitCheckoutSession as m, cartStoreStartCheckoutInterval as n, getCheckoutSessionBody as o, cartStoreUpdateToErrorState as p, translate as q, getZCountryUrlParam as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, cartStoreSetCheckoutSession as u, stripeStorePrefetchLandedCost as v, cartStoreNextStep as w, stripeStoreHandleInventoryCheck as x, stripeStoreConfirmPayment as y, stripeStoreHandleInventoryRefund as z };
|