@zonos/elements 1.3.110 → 1.3.112
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/{CheckoutConfig-c97f0f83.js → CheckoutConfig-5d7cf0c0.js} +19 -2
- package/dist/cjs/{cart-a3eab220.js → cart-6d966eea.js} +114 -2
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{paypal-ca479c4b.js → paypal-ae7bd9f2.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +14 -12
- 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.js +12 -10
- package/dist/collection/components/store/checkout/cart.js +6 -2
- package/dist/collection/components/store/checkout/stripe.js +48 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
- package/dist/collection/components/store/translationStore/strings.base.js +3 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
- package/dist/collection/components/store/translationStore/strings.french.js +3 -0
- package/dist/collection/components/store/translationStore/strings.german.js +3 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
- package/dist/collection/scripts/cart/_getIsValidCartId.js +15 -0
- package/dist/collection/scripts/cart/_setupCartData.js +4 -2
- package/dist/collection/types/checkout/api/legacy/InventoryCheck.js +1 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/{CheckoutConfig-4d2a508c.js → CheckoutConfig-32f33d8b.js} +19 -2
- package/dist/esm/{cart-163f4dd9.js → cart-89bc298d.js} +114 -3
- package/dist/esm/index.js +9 -9
- package/dist/esm/{paypal-77e8eef2.js → paypal-804a4bcb.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_13.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +14 -12
- 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/CheckoutConfig-32f33d8b.js +1 -0
- package/dist/esm-es5/cart-89bc298d.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-77e8eef2.js → paypal-804a4bcb.js} +1 -1
- 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-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 +11 -4
- 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.d.ts +0 -1
- package/dist/types/components/store/checkout/stripe.d.ts +10 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/scripts/cart/_getIsValidCartId.d.ts +4 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +11 -4
- package/dist/types/types/checkout/api/legacy/InventoryCheck.d.ts +9 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-007c64dc.system.js +1 -0
- package/dist/zonos-elements/{p-bcfc229f.entry.js → p-05d558c2.entry.js} +1 -1
- package/dist/zonos-elements/{p-8cafdbc9.entry.js → p-0c7d7aec.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ad85ec6.entry.js → p-1769c0d2.entry.js} +1 -1
- package/dist/zonos-elements/p-19433a7d.entry.js +1 -0
- package/dist/zonos-elements/p-33b57fab.system.js +1 -0
- package/dist/zonos-elements/{p-8acdac29.entry.js → p-347c0756.entry.js} +1 -1
- package/dist/zonos-elements/{p-46a71949.system.entry.js → p-3c326d01.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-06e3c94f.entry.js → p-3cfa837c.entry.js} +1 -1
- package/dist/zonos-elements/{p-8e85c28f.system.entry.js → p-45214b34.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a45bd823.system.entry.js → p-55735806.system.entry.js} +1 -1
- package/dist/zonos-elements/p-56d405d0.js +1 -0
- package/dist/zonos-elements/{p-49135023.system.js → p-8f9198f2.system.js} +1 -1
- package/dist/zonos-elements/p-97114032.js +1 -0
- package/dist/zonos-elements/p-a43eacf3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d8a45014.system.entry.js → p-b35e67f7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-2a0c4426.system.entry.js → p-d01cfb8b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-932cbdd7.system.entry.js → p-d0ccf2af.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-abc6b881.system.entry.js → p-d1f334d8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0810568b.system.entry.js → p-d49cdf77.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-281e9a06.system.js → p-dc5acdd3.system.js} +1 -1
- package/dist/zonos-elements/{p-1dcaf64f.js → p-e132bc3d.js} +1 -1
- package/dist/zonos-elements/{p-58e6386b.entry.js → p-ead95c3b.entry.js} +1 -1
- package/dist/zonos-elements/{p-189aa06e.system.entry.js → p-ece0b7ab.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-605473a3.entry.js → p-ed222a50.entry.js} +1 -1
- package/dist/zonos-elements/{p-124f5c21.entry.js → p-f26c4392.entry.js} +1 -1
- package/dist/zonos-elements/{p-110ee9ab.entry.js → p-fe781493.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/CheckoutConfig-4d2a508c.js +0 -1
- package/dist/esm-es5/cart-163f4dd9.js +0 -1
- package/dist/zonos-elements/p-272121e2.js +0 -1
- package/dist/zonos-elements/p-505f92e7.entry.js +0 -1
- package/dist/zonos-elements/p-5a011a47.system.js +0 -1
- package/dist/zonos-elements/p-64f0fcce.system.js +0 -1
- package/dist/zonos-elements/p-c44f27be.js +0 -1
- package/dist/zonos-elements/p-cf69d8c2.system.entry.js +0 -1
|
@@ -20,6 +20,7 @@ const { onChange, reset, state: stripeStore, } = createStore(() => ({
|
|
|
20
20
|
hasPaymentError: false,
|
|
21
21
|
isFetchingLandedCost: false,
|
|
22
22
|
isFetchingSession: false,
|
|
23
|
+
shouldInventoryRefund: false,
|
|
23
24
|
stripe: null,
|
|
24
25
|
stripeAddressElement: null,
|
|
25
26
|
stripeAddressEventData: null,
|
|
@@ -348,13 +349,59 @@ const stripeStoreMessageBasedOnStatus = (status) => {
|
|
|
348
349
|
* Handle inventory check and returns error message if the callback provided.
|
|
349
350
|
*/
|
|
350
351
|
const stripeStoreHandleInventoryCheck = async () => {
|
|
352
|
+
var _a, _b;
|
|
351
353
|
const { onInventoryCheck } = zonosStore.checkoutSettings;
|
|
354
|
+
const hasReferenceId = !!((_b = (_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.metadata.find(meta => meta.key === 'referenceId')) === null || _b === void 0 ? void 0 : _b.value);
|
|
355
|
+
// default inventory check is only available for legacy checkout and store has referenceId in metadata
|
|
356
|
+
if (window.Zonos.isLegacyCheckout &&
|
|
357
|
+
window.Zonos.cartData &&
|
|
358
|
+
hasReferenceId) {
|
|
359
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/legacy/inventory-check', {
|
|
360
|
+
body: {
|
|
361
|
+
cartData: window.Zonos.cartData,
|
|
362
|
+
},
|
|
363
|
+
method: 'POST',
|
|
364
|
+
});
|
|
365
|
+
if (errors.length || !json) {
|
|
366
|
+
logError('Error occurs when handling inventory refund', 'warn', JSON.stringify(errors));
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
// Proceed if the item is available
|
|
370
|
+
if (!json.available || json.status === 204) {
|
|
371
|
+
return translate("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.");
|
|
372
|
+
}
|
|
373
|
+
if (json.available || json.status === 200) {
|
|
374
|
+
stripeStore.shouldInventoryRefund = true;
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
352
379
|
if (typeof onInventoryCheck !== 'function') {
|
|
353
380
|
return null;
|
|
354
381
|
}
|
|
355
382
|
const message = await onInventoryCheck({ items: cartStore.items });
|
|
356
383
|
return message;
|
|
357
384
|
};
|
|
385
|
+
/**
|
|
386
|
+
* Handle inventory check and returns error message if the callback provided.
|
|
387
|
+
*/
|
|
388
|
+
const stripeStoreHandleInventoryRefund = async () => {
|
|
389
|
+
var _a, _b;
|
|
390
|
+
const hasReferenceId = !!((_b = (_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.metadata.find(meta => meta.key === 'referenceId')) === null || _b === void 0 ? void 0 : _b.value);
|
|
391
|
+
// inventory refund is only available for legacy checkout and store has referenceId in metadata
|
|
392
|
+
if (!window.Zonos.isLegacyCheckout ||
|
|
393
|
+
!window.Zonos.cartData ||
|
|
394
|
+
!hasReferenceId) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
// handle inventory check on legacy checkout
|
|
398
|
+
await handleFetch('/api/zonos-elements/legacy/inventory-refund', {
|
|
399
|
+
body: {
|
|
400
|
+
cartData: window.Zonos.cartData,
|
|
401
|
+
},
|
|
402
|
+
method: 'POST',
|
|
403
|
+
});
|
|
404
|
+
};
|
|
358
405
|
const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybookForceStatus, }) => {
|
|
359
406
|
if (storybookForceStatus) {
|
|
360
407
|
// return status right away if we are in storybook mode
|
|
@@ -614,4 +661,4 @@ onChange('clientSecret', clientSecret => {
|
|
|
614
661
|
sessionStorage.removeItem('zonos--client-secret');
|
|
615
662
|
}
|
|
616
663
|
});
|
|
617
|
-
export { initStripeElements, stripeCalculateLandedCost, stripeStore, stripeStoreApplyPromoCode, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetDomesticShippingSession, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStoreMessageBasedOnStatus, stripeStorePrefetchLandedCost, stripeStoreRemovePromoCode, stripeStoreReset, stripeStoreResetPromoCode, stripeStoreRetrievePayment, stripeStoreSaveDomesticShippingSession, stripeStoreTranslateAddressToLatin, stripeStoreUpdateCheckoutSession, };
|
|
664
|
+
export { initStripeElements, stripeCalculateLandedCost, stripeStore, stripeStoreApplyPromoCode, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetDomesticShippingSession, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStoreMessageBasedOnStatus, stripeStorePrefetchLandedCost, stripeStoreRemovePromoCode, stripeStoreReset, stripeStoreResetPromoCode, stripeStoreRetrievePayment, stripeStoreSaveDomesticShippingSession, stripeStoreTranslateAddressToLatin, stripeStoreUpdateCheckoutSession, };
|
|
@@ -329,6 +329,9 @@ export const stringsArabic = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'العناصر التالية لا يمكن شحنها إلى بلدك ولا تُضاف إلى إجمالي سلة مشترياتك.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'العنصر الذي تبحث عنه غير متوفر حاليًا في مخزوننا. يرجى التحقق مرة أخرى لاحقًا أو الاتصال بالدعم للحصول على المساعدة بشأن التوافر.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'ينطبق قانون ضريبة السلع والخدمات منخفض القيمة الذي أُقر في 1 يوليو 2018 على هذا التاجر.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsBase = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'The following items are unable to be shipped to your country and are not included in your cart total.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: "The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.",
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'The low-value GST law passed July 1st, 2018 applies to this retailer.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsChinese = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: '以下商品无法运送至您的国家,并且不包括在您购物车的总额中。',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: '您正在寻找的商品目前在我们的库存中不可用。请稍后再查看或联系支持以获取可用性方面的帮助。',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: '2018年7月1日通过的低值GST法适用于本零售商。',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsDanish = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'De følgende varer kan ikke sendes til dit land og er ikke inkluderet i din kurvs total.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Varen, du leder efter, er i øjeblikket ikke tilgængelig i vores lager. Kom venligst tilbage senere eller kontakt support for hjælp med tilgængelighed.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Den lavværdi-GST-lov, der blev vedtaget den 1. juli 2018, gælder for denne forhandler.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsDutch = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'De volgende artikelen kunnen niet naar uw land worden verzonden en zijn niet opgenomen in het totaal van uw winkelwagen.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Het item dat u zoekt, is momenteel niet beschikbaar in onze voorraad. Kom later terug of neem contact op met de ondersteuning voor hulp bij de beschikbaarheid.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'De wet op de laagwaardige GST die op 1 juli 2018 is aangenomen, is van toepassing op deze detailhandelaar.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsFrench = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Les articles suivants ne peuvent pas être expédiés dans votre pays et ne sont pas inclus dans le total de votre panier.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: "L'article que vous recherchez n'est actuellement pas disponible dans notre inventaire. Veuillez revenir plus tard ou contacter le support pour obtenir de l'aide concernant la disponibilité.",
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: "La loi sur la GST à faible valeur adoptée le 1er juillet 2018 s'applique à ce détaillant.",
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsGerman = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Die folgenden Artikel können nicht in Ihr Land versandt werden und sind nicht in der Gesamtsumme Ihres Warenkorbs enthalten.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Der Artikel, den Sie suchen, ist derzeit nicht in unserem Lager verfügbar. Bitte schauen Sie später noch einmal vorbei oder kontaktieren Sie den Support für Unterstützung bei der Verfügbarkeit.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Das am 1. Juli 2018 verabschiedete Niedrigwert-GST-Gesetz gilt für diesen Einzelhändler.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsHebrew = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'הפריטים הבאים לא יכולים להישלח למדינתך ואינם כלולים בסך הכל של עגלתך.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'הפריט שאתה מחפש אינו זמין כרגע במלאי שלנו. אנא בדוק שוב מאוחר יותר או פנה לתמיכה לקבלת סיוע בזמינות.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'חוק GST בעל ערך נמוך שנחקק ב-1 ביולי 2018 חל על קמעונאי זה.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsIndonesian = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Item-item berikut tidak dapat dikirim ke negara Anda dan tidak termasuk dalam total keranjang Anda.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Barang yang Anda cari saat ini tidak tersedia di inventaris kami. Silakan periksa kembali nanti atau hubungi dukungan untuk bantuan ketersediaan.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Undang-undang GST bernilai rendah yang disahkan pada 1 Juli 2018 berlaku untuk pengecer ini.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsItalian = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'I seguenti articoli non possono essere spediti nel tuo paese e non sono inclusi nel totale del tuo carrello.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: "L'articolo che stai cercando non è attualmente disponibile nel nostro inventario. Si prega di ricontrollare più tardi o contattare il supporto per assistenza con la disponibilità.",
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'La legge GST di basso valore approvata il 1° luglio 2018 si applica a questo rivenditore.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsJapanese = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: '以下のアイテムはお客様の国への発送ができませんので、カートの合計には含まれません。',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'お探しの商品は現在、在庫にありません。後で再度確認するか、サポートに連絡して在庫状況の確認をお願いします。',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: '2018年7月1日に可決された低額GST法はこの小売業者に適用されます。',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsKorean = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: '다음 항목은 국가로 배송할 수 없으며 장바구니 총액에 포함되지 않습니다.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: '찾고 계신 상품은 현재 재고에 없습니다. 나중에 다시 확인하거나 지원팀에 연락하여 가용성에 대한 도움을 받으십시오.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: '2018년 7월 1일에 통과된 저가 GST 법은 이 소매업체에 적용됩니다.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsNorwegian = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Følgende varer kan ikke sendes til landet ditt og er ikke inkludert i totalen for handlekurven din.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Varen du leter etter er for øyeblikket ikke tilgjengelig i vårt lager. Vennligst sjekk tilbake senere eller kontakt support for hjelp med tilgjengelighet.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Den lavverdige GST-loven som ble vedtatt 1. juli 2018 gjelder for denne forhandleren.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsPolish = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Następujące przedmioty nie mogą być wysłane do twojego kraju i nie są wliczone do sumy twojego koszyka.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Przedmiot, którego szukasz, jest obecnie niedostępny w naszym magazynie. Proszę sprawdzić ponownie później lub skontaktować się z pomocą techniczną w celu uzyskania pomocy w sprawie dostępności.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Prawo niskowartościowego GST przyjęte 1 lipca 2018 r. dotyczy tego sprzedawcy.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsPortuguese = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Os seguintes itens não podem ser enviados para o seu país e não estão incluídos no total do seu carrinho.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'O item que você está procurando está atualmente indisponível em nosso estoque. Por favor, verifique novamente mais tarde ou entre em contato com o suporte para obter assistência com a disponibilidade.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'A lei de GST de baixo valor aprovada em 1º de julho de 2018 se aplica a este varejista.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsRussian = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Следующие товары не могут быть доставлены в вашу страну и не включены в итоговую сумму вашей корзины.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Товар, который вы ищете, в настоящее время недоступен в нашем инвентаре. Пожалуйста, проверьте позже или свяжитесь с поддержкой для получения помощи с доступностью.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Закон о низкой стоимости GST, принятый 1 июля 2018 года, применяется к этому розничному продавцу.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsSpanish = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Los siguientes artículos no se pueden enviar a su país y no están incluidos en el total de su carrito.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'El artículo que buscas no está disponible actualmente en nuestro inventario. Por favor, vuelve a comprobar más tarde o contacta con el soporte para obtener ayuda con la disponibilidad.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'La ley de GST de bajo valor aprobada el 1 de julio de 2018 se aplica a este minorista.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsSwedish = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Följande artiklar kan inte skickas till ditt land och är inte inkluderade i din varukorgs totala belopp.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Artikeln du letar efter är för närvarande inte tillgänglig i vårt lager. Vänligen återkom senare eller kontakta supporten för hjälp med tillgänglighet.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Lågvärde-GST-lagen som antogs den 1 juli 2018 gäller för denna återförsäljare.',
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsTurkish = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Aşağıdaki ürünler ülkenize gönderilemiyor ve sepet toplamınıza dahil edilmiyor.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Aradığınız ürün şu anda envanterimizde mevcut değil. Lütfen daha sonra tekrar kontrol edin veya uygunluk konusunda yardım için destekle iletişime geçin.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: "1 Temmuz 2018'de yürürlüğe giren düşük değerli GST yasası bu perakendeci için geçerlidir.",
|
|
334
337
|
},
|
|
@@ -329,6 +329,9 @@ export const stringsVietnamese = {
|
|
|
329
329
|
'The following items are unable to be shipped to your country and are not included in your cart total.': {
|
|
330
330
|
value: 'Các mặt hàng sau không thể được vận chuyển đến quốc gia của bạn và không được tính vào tổng số giỏ hàng của bạn.',
|
|
331
331
|
},
|
|
332
|
+
"The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.": {
|
|
333
|
+
value: 'Mặt hàng bạn đang tìm kiếm hiện không có sẵn trong kho của chúng tôi. Vui lòng kiểm tra lại sau hoặc liên hệ với bộ phận hỗ trợ để được trợ giúp về tình trạng sẵn có.',
|
|
334
|
+
},
|
|
332
335
|
'The low-value GST law passed July 1st, 2018 applies to this retailer.': {
|
|
333
336
|
value: 'Luật GST giá trị thấp được thông qua ngày 1 tháng 7 năm 2018 áp dụng cho nhà bán lẻ này.',
|
|
334
337
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const baseRe = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
2
|
+
const uuidRe = new RegExp(`^${baseRe.source}$`);
|
|
3
|
+
const cartUuidRe = new RegExp(`^cart_${baseRe.source}$`);
|
|
4
|
+
export const _getIsValidCartId = (cartId) => {
|
|
5
|
+
if (!cartId) {
|
|
6
|
+
return { isDgsCartId: false, isLegacyCartId: false };
|
|
7
|
+
}
|
|
8
|
+
if (cartUuidRe.test(cartId)) {
|
|
9
|
+
return { isDgsCartId: true, isLegacyCartId: false };
|
|
10
|
+
}
|
|
11
|
+
if (uuidRe.test(cartId)) {
|
|
12
|
+
return { isDgsCartId: false, isLegacyCartId: true };
|
|
13
|
+
}
|
|
14
|
+
return { isDgsCartId: false, isLegacyCartId: false };
|
|
15
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { log } from "../../components/utils/logging/log";
|
|
2
2
|
import { logError } from "../../components/utils/logging/logError";
|
|
3
3
|
import { getTempCartById } from "../_getTempCartBy";
|
|
4
|
+
import { _getIsValidCartId } from "./_getIsValidCart";
|
|
4
5
|
export const setupCartData = async (cartId) => {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const { isDgsCartId, isLegacyCartId } = _getIsValidCartId(cartId);
|
|
7
|
+
if (!isLegacyCartId && !isDgsCartId) {
|
|
8
|
+
logError('[ZONOS - loadZonos] invalid cart id');
|
|
7
9
|
return null;
|
|
8
10
|
}
|
|
9
11
|
const tempCartResult = await getTempCartById({ cartId, retries: 5 });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import "./global.d";
|
|
|
3
3
|
export * from '../components.d';
|
|
4
4
|
export * from './checkout/api/CalculateLandedCost';
|
|
5
5
|
export * from './checkout/api/CheckoutSession';
|
|
6
|
+
export * from './checkout/api/legacy/InventoryCheck';
|
|
6
7
|
export * from './checkout/api/NormalizedTempCart';
|
|
7
8
|
export * from './checkout/api/Paypal';
|
|
8
9
|
export * from './checkout/api/StoreDiscountEnabled';
|
|
@@ -25,9 +25,26 @@ const getTempCartById = async ({ cartId, retries, }) => {
|
|
|
25
25
|
return json;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
const baseRe = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
29
|
+
const uuidRe = new RegExp(`^${baseRe.source}$`);
|
|
30
|
+
const cartUuidRe = new RegExp(`^cart_${baseRe.source}$`);
|
|
31
|
+
const _getIsValidCartId = (cartId) => {
|
|
32
|
+
if (!cartId) {
|
|
33
|
+
return { isDgsCartId: false, isLegacyCartId: false };
|
|
34
|
+
}
|
|
35
|
+
if (cartUuidRe.test(cartId)) {
|
|
36
|
+
return { isDgsCartId: true, isLegacyCartId: false };
|
|
37
|
+
}
|
|
38
|
+
if (uuidRe.test(cartId)) {
|
|
39
|
+
return { isDgsCartId: false, isLegacyCartId: true };
|
|
40
|
+
}
|
|
41
|
+
return { isDgsCartId: false, isLegacyCartId: false };
|
|
42
|
+
};
|
|
43
|
+
|
|
28
44
|
const setupCartData = async (cartId) => {
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
const { isDgsCartId, isLegacyCartId } = _getIsValidCartId(cartId);
|
|
46
|
+
if (!isLegacyCartId && !isDgsCartId) {
|
|
47
|
+
logError('[ZONOS - loadZonos] invalid cart id');
|
|
31
48
|
return null;
|
|
32
49
|
}
|
|
33
50
|
const tempCartResult = await getTempCartById({ cartId, retries: 5 });
|