@zonos/elements 1.3.275 → 1.3.277
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-73d7ecdc.js → cart-65e8da66.js} +38 -12
- package/dist/cjs/{collect-32ea7a37.js → collect-37c177ab.js} +2 -2
- package/dist/cjs/{hasInclusivePrice-38ebedfb.js → hasInclusivePrice-798ce42d.js} +1 -1
- package/dist/cjs/index.cjs.js +32 -9
- package/dist/cjs/{invoice-df662cd1.js → invoice-96f5c802.js} +2 -2
- package/dist/cjs/{localization-09e91031.js → localization-90650d7d.js} +60 -0
- package/dist/cjs/{paypal-11acb15f.js → paypal-1952f6ec.js} +2 -2
- package/dist/cjs/{placeTestOrder-e0f80338.js → placeTestOrder-30191a8f.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-d902f973.js → renderCheckoutCurrency-fd35b4ef.js} +2 -2
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +4 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +74 -9
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -3
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -2
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +7 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +5 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +18 -4
- 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 +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -4
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +7 -6
- package/dist/cjs/zonos-invoice.cjs.entry.js +5 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +52 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +18 -2
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +16 -3
- package/dist/collection/components/store/checkout/cart.js +21 -11
- 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/components/utils/checkout/isEuDapRemittance.js +15 -0
- package/dist/collection/scripts/_loadStripe.js +20 -2
- package/dist/collection/scripts/_zonosBase.js +5 -0
- package/dist/collection/types/generated/graphql.internal.types.js +78 -0
- package/dist/esm/{cart-c3cd0036.js → cart-402dcde5.js} +38 -13
- package/dist/esm/{collect-a7a4696c.js → collect-b88fe4ca.js} +2 -2
- package/dist/esm/{hasInclusivePrice-93a88196.js → hasInclusivePrice-1589fef9.js} +1 -1
- package/dist/esm/index.js +32 -9
- package/dist/esm/{invoice-5a07bb03.js → invoice-5eb27944.js} +2 -2
- package/dist/esm/{localization-a185c345.js → localization-d49867ed.js} +60 -0
- package/dist/esm/{paypal-cc558697.js → paypal-2d4c9d01.js} +2 -2
- package/dist/esm/{placeTestOrder-92847316.js → placeTestOrder-2ba7c3f2.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-34aaa81e.js → renderCheckoutCurrency-ef71083e.js} +2 -2
- package/dist/esm/zonos-address-display_8.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +2 -2
- package/dist/esm/zonos-airwallex-payment.entry.js +4 -3
- package/dist/esm/zonos-card_5.entry.js +4 -3
- package/dist/esm/zonos-cart-items_12.entry.js +74 -9
- package/dist/esm/zonos-checkout.entry.js +4 -3
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +7 -6
- package/dist/esm/zonos-collect.entry.js +5 -4
- package/dist/esm/zonos-controller.entry.js +18 -4
- 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 +2 -2
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +7 -6
- package/dist/esm/zonos-invoice.entry.js +5 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +4 -3
- package/dist/esm-es5/cart-402dcde5.js +1 -0
- package/dist/esm-es5/{collect-a7a4696c.js → collect-b88fe4ca.js} +1 -1
- package/dist/esm-es5/{hasInclusivePrice-93a88196.js → hasInclusivePrice-1589fef9.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-5a07bb03.js → invoice-5eb27944.js} +1 -1
- package/dist/esm-es5/localization-d49867ed.js +1 -0
- package/dist/esm-es5/{paypal-cc558697.js → paypal-2d4c9d01.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-92847316.js → placeTestOrder-2ba7c3f2.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-34aaa81e.js → renderCheckoutCurrency-ef71083e.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.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-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.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-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +23 -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-cart-subtotal/zonos-cart-subtotal.d.ts +8 -0
- package/dist/types/components/store/checkout/cart.d.ts +2 -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/utils/checkout/isEuDapRemittance.d.ts +15 -0
- package/dist/types/scripts/_zonosBase.d.ts +12 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +94 -0
- package/dist/types/types/generated/graphql.internal.types.ts +114 -7
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-ac762358.entry.js → p-0745e440.entry.js} +1 -1
- package/dist/zonos-elements/p-0b321037.system.entry.js +1 -0
- package/dist/zonos-elements/p-10715fee.system.entry.js +1 -0
- package/dist/zonos-elements/p-144a380d.entry.js +1 -0
- package/dist/zonos-elements/p-18135660.entry.js +1 -0
- package/dist/zonos-elements/{p-38d2da0d.entry.js → p-1e4dcd29.entry.js} +1 -1
- package/dist/zonos-elements/{p-3fa307d1.system.entry.js → p-293183c1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/p-2e0d813f.system.js +1 -0
- package/dist/zonos-elements/{p-03c357f5.system.js → p-2ea73ca2.system.js} +1 -1
- package/dist/zonos-elements/{p-96972001.entry.js → p-3cf22558.entry.js} +1 -1
- package/dist/zonos-elements/p-3cfa4880.js +1 -0
- package/dist/zonos-elements/p-3feff726.entry.js +1 -0
- package/dist/zonos-elements/p-42ba4da5.system.entry.js +1 -0
- package/dist/zonos-elements/p-45535a81.js +1 -0
- package/dist/zonos-elements/p-4596bdca.system.entry.js +1 -0
- package/dist/zonos-elements/p-48627415.system.entry.js +1 -0
- package/dist/zonos-elements/p-4a1c9fa1.entry.js +1 -0
- package/dist/zonos-elements/{p-3e914f69.system.entry.js → p-4a6f9c5e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4b06044f.js +1 -0
- package/dist/zonos-elements/p-4d29dcc8.entry.js +1 -0
- package/dist/zonos-elements/{p-79f58524.system.entry.js → p-4e6e9a3c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-521cbeea.entry.js +1 -0
- package/dist/zonos-elements/p-534057ad.system.entry.js +1 -0
- package/dist/zonos-elements/p-55195dab.entry.js +1 -0
- package/dist/zonos-elements/p-58b56c69.entry.js +1 -0
- package/dist/zonos-elements/p-5ce88ef3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d6d18115.system.entry.js → p-5d3ea491.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5e3b0ef4.entry.js +1 -0
- package/dist/zonos-elements/p-628fe742.system.entry.js +1 -0
- package/dist/zonos-elements/{p-be233925.system.js → p-647438d6.system.js} +1 -1
- package/dist/zonos-elements/p-684e27da.system.js +1 -0
- package/dist/zonos-elements/{p-863cfab2.system.js → p-6ad0f720.system.js} +2 -2
- package/dist/zonos-elements/p-77ac8bfe.entry.js +1 -0
- package/dist/zonos-elements/p-864525b4.system.entry.js +1 -0
- package/dist/zonos-elements/p-89befc63.system.entry.js +1 -0
- package/dist/zonos-elements/{p-12396d79.system.entry.js → p-998f9df5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9fab45aa.system.js +1 -0
- package/dist/zonos-elements/{p-9cb80484.js → p-a02ff788.js} +1 -1
- package/dist/zonos-elements/{p-e3376f43.js → p-a3bc7e97.js} +1 -1
- package/dist/zonos-elements/{p-a1f59d6d.system.entry.js → p-a7050d1e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ac1b60c8.system.entry.js +1 -0
- package/dist/zonos-elements/{p-819f182e.entry.js → p-ac9b9f7d.entry.js} +1 -1
- package/dist/zonos-elements/{p-a7028453.js → p-b1c86a5b.js} +1 -1
- package/dist/zonos-elements/p-b79989a6.entry.js +1 -0
- package/dist/zonos-elements/p-b7e4f1f5.entry.js +1 -0
- package/dist/zonos-elements/p-c209e36d.js +1 -0
- package/dist/zonos-elements/p-c750a2e0.system.entry.js +1 -0
- package/dist/zonos-elements/{p-f97da77c.entry.js → p-d5945ddc.entry.js} +1 -1
- package/dist/zonos-elements/p-d7bda14d.js +1 -0
- package/dist/zonos-elements/p-d90e79e4.system.js +1 -0
- package/dist/zonos-elements/{p-216d31ca.entry.js → p-ee434a71.entry.js} +1 -1
- package/dist/zonos-elements/{p-3ea7643b.system.js → p-f2768c92.system.js} +1 -1
- package/dist/zonos-elements/{p-3980e553.system.js → p-f2d50796.system.js} +1 -1
- package/dist/zonos-elements/{p-a9d01bfa.entry.js → p-f3a73132.entry.js} +1 -1
- package/dist/zonos-elements/{p-4900096c.system.entry.js → p-ffbf87c8.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-c3cd0036.js +0 -1
- package/dist/esm-es5/localization-a185c345.js +0 -1
- package/dist/zonos-elements/p-043e9a84.js +0 -1
- package/dist/zonos-elements/p-1906c8f7.js +0 -1
- package/dist/zonos-elements/p-1de258c3.js +0 -1
- package/dist/zonos-elements/p-2b2122bc.system.entry.js +0 -1
- package/dist/zonos-elements/p-2bdfa429.system.js +0 -1
- package/dist/zonos-elements/p-2c0a627d.js +0 -1
- package/dist/zonos-elements/p-387f33ae.js +0 -1
- package/dist/zonos-elements/p-391ea5c2.entry.js +0 -1
- package/dist/zonos-elements/p-3f8050ab.entry.js +0 -1
- package/dist/zonos-elements/p-51b537a6.system.entry.js +0 -1
- package/dist/zonos-elements/p-5427bf51.entry.js +0 -1
- package/dist/zonos-elements/p-577b543c.entry.js +0 -1
- package/dist/zonos-elements/p-5ce8b3c3.system.entry.js +0 -1
- package/dist/zonos-elements/p-70fd21c4.system.entry.js +0 -1
- package/dist/zonos-elements/p-785d6f43.entry.js +0 -1
- package/dist/zonos-elements/p-8873d332.system.entry.js +0 -1
- package/dist/zonos-elements/p-9295b932.entry.js +0 -1
- package/dist/zonos-elements/p-93c6c2df.system.entry.js +0 -1
- package/dist/zonos-elements/p-9d80357b.entry.js +0 -1
- package/dist/zonos-elements/p-a2353242.system.entry.js +0 -1
- package/dist/zonos-elements/p-a33e1549.system.entry.js +0 -1
- package/dist/zonos-elements/p-b376aba7.system.entry.js +0 -1
- package/dist/zonos-elements/p-b9034a75.system.entry.js +0 -1
- package/dist/zonos-elements/p-b9359002.system.entry.js +0 -1
- package/dist/zonos-elements/p-c68a7f3e.entry.js +0 -1
- package/dist/zonos-elements/p-d1f2e532.system.js +0 -1
- package/dist/zonos-elements/p-d62dab88.system.js +0 -1
- package/dist/zonos-elements/p-e562d953.system.js +0 -1
- package/dist/zonos-elements/p-e5f25b27.entry.js +0 -1
- package/dist/zonos-elements/p-e9e3c951.system.entry.js +0 -1
- package/dist/zonos-elements/p-ee70bd2e.entry.js +0 -1
- package/dist/zonos-elements/p-ee920b9b.entry.js +0 -1
- package/dist/zonos-elements/p-fb830355.entry.js +0 -1
|
@@ -5,6 +5,7 @@ import { storageStore } from "../../../store/storageStore";
|
|
|
5
5
|
import { translate } from "../../../store/translationStore";
|
|
6
6
|
import { zonosStore } from "../../../store/zonosStore";
|
|
7
7
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
8
|
+
import { isEuDapRemittance } from "../../../utils/checkout/isEuDapRemittance";
|
|
8
9
|
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
9
10
|
import { sortServiceLevelOptionsByAmount } from "../../../utils/checkout/sortServiceLevelOptionsByAmount";
|
|
10
11
|
import { classes } from "../../../utils/classes";
|
|
@@ -121,11 +122,12 @@ export class ZonosShipping {
|
|
|
121
122
|
: '';
|
|
122
123
|
const matchedLandedCosts = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.filter(landedCostItem => { var _a; return ((_a = landedCostItem.landedCost) === null || _a === void 0 ? void 0 : _a.shipmentRating.id) === item.id; });
|
|
123
124
|
return ((matchedLandedCosts === null || matchedLandedCosts === void 0 ? void 0 : matchedLandedCosts.map(landedCost => {
|
|
125
|
+
var _a;
|
|
124
126
|
const shippingAmount = landedCost.subtotals.shipping;
|
|
125
127
|
/**
|
|
126
128
|
* For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
|
|
127
129
|
*/
|
|
128
|
-
const method = cartStoreGetMethod(landedCost.landedCost);
|
|
130
|
+
const method = cartStoreGetMethod(landedCost.landedCost, (_a = item.shippingProfile) === null || _a === void 0 ? void 0 : _a.serviceLevel.deliveryType);
|
|
129
131
|
const option = {
|
|
130
132
|
amount: shippingAmount,
|
|
131
133
|
label: `${item.displayName}${this.getLandedCostMethodLabelSuffix(method)}`,
|
|
@@ -211,6 +213,7 @@ export class ZonosShipping {
|
|
|
211
213
|
void this.preselectFirstShippingMethod();
|
|
212
214
|
}
|
|
213
215
|
render() {
|
|
216
|
+
var _a;
|
|
214
217
|
// re-init service levels if the currency is toggled
|
|
215
218
|
if (this.isCurrencyToggled()) {
|
|
216
219
|
this.initServiceLevels();
|
|
@@ -219,6 +222,17 @@ export class ZonosShipping {
|
|
|
219
222
|
...this.serviceLevelsDDP,
|
|
220
223
|
...this.serviceLevelsOther,
|
|
221
224
|
];
|
|
225
|
+
// EU 3-EUR cutover (05CHECK-893): when we collect and remit taxes for an EU
|
|
226
|
+
// POSTAL DAP quote, only duties (not taxes) are charged upon delivery. The
|
|
227
|
+
// delivery type lives on the shipment rating, so match it by id.
|
|
228
|
+
const isEuDapRemittanceQuote = !!((_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.some(landedCostData => {
|
|
229
|
+
var _a, _b, _c, _d;
|
|
230
|
+
return isEuDapRemittance({
|
|
231
|
+
deliveryType: (_c = (_b = (_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.find(shipmentRating => shipmentRating.id === landedCostData.landedCost.shipmentRating.id)) === null || _b === void 0 ? void 0 : _b.shippingProfile) === null || _c === void 0 ? void 0 : _c.serviceLevel.deliveryType,
|
|
232
|
+
landedCost: landedCostData.landedCost,
|
|
233
|
+
shipToCountry: (_d = stripeStore.stripeAddressEventData) === null || _d === void 0 ? void 0 : _d.value.address.country,
|
|
234
|
+
});
|
|
235
|
+
}));
|
|
222
236
|
// start validate on typing after error banner is shown, and hide it if the form is complete
|
|
223
237
|
if (this.showErrorBanner) {
|
|
224
238
|
this.showErrorBanner = !this.handleValidate();
|
|
@@ -235,7 +249,9 @@ export class ZonosShipping {
|
|
|
235
249
|
this.collapsedDAPOptions && 'collapsed',
|
|
236
250
|
]), onClick: () => {
|
|
237
251
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
238
|
-
} }, 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(
|
|
252
|
+
} }, 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(isEuDapRemittanceQuote
|
|
253
|
+
? 'Duties will be charged upon delivery.'
|
|
254
|
+
: '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", { isMobile: this.isMobile, items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod })))));
|
|
239
255
|
};
|
|
240
256
|
return (h(Host, { class: classes([
|
|
241
257
|
'zonos--shipping zonos--elements',
|
package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js
CHANGED
|
@@ -259,7 +259,7 @@ export class ZonosStripePhoneInput {
|
|
|
259
259
|
"mutable": false,
|
|
260
260
|
"complexType": {
|
|
261
261
|
"original": "GenericZonosSettings['countryFields'] | null",
|
|
262
|
-
"resolved": "null | undefined | { EG: CountryFields; MO: CountryFields; PN: CountryFields; KG: CountryFields; LB: CountryFields;
|
|
262
|
+
"resolved": "null | undefined | { EG: CountryFields; MO: CountryFields; PN: CountryFields; KG: CountryFields; LB: CountryFields; BH: CountryFields; ML: CountryFields; NO: CountryFields; CG: CountryFields; CM: CountryFields; MM: CountryFields; AQ: CountryFields; AX: CountryFields; CC: CountryFields; ER: CountryFields; PF: CountryFields; SO: CountryFields; SX: CountryFields; TO: CountryFields; AD: CountryFields; AE: CountryFields; AF: CountryFields; AG: CountryFields; AI: CountryFields; AL: CountryFields; AM: CountryFields; AO: CountryFields; AR: CountryFields; AS: CountryFields; AT: CountryFields; AU: CountryFields; AW: CountryFields; AZ: CountryFields; BA: CountryFields; BB: CountryFields; BD: CountryFields; BE: CountryFields; BF: CountryFields; BG: CountryFields; BI: CountryFields; BJ: CountryFields; BL: CountryFields; BM: CountryFields; BN: CountryFields; BO: CountryFields; BQ: CountryFields; BR: CountryFields; BS: CountryFields; BT: CountryFields; BV: CountryFields; BW: CountryFields; BY: CountryFields; BZ: CountryFields; CA: CountryFields; CD: CountryFields; CF: CountryFields; CH: CountryFields; CI: CountryFields; CK: CountryFields; CL: CountryFields; CN: CountryFields; CO: CountryFields; CR: CountryFields; CU: CountryFields; CV: CountryFields; CW: CountryFields; CX: CountryFields; CY: CountryFields; CZ: CountryFields; DE: CountryFields; DJ: CountryFields; DK: CountryFields; DM: CountryFields; DO: CountryFields; DZ: CountryFields; EC: CountryFields; EE: CountryFields; EH: CountryFields; ES: CountryFields; ET: CountryFields; FI: CountryFields; FJ: CountryFields; FK: CountryFields; FM: CountryFields; FO: CountryFields; FR: CountryFields; GA: CountryFields; GB: CountryFields; GD: CountryFields; GE: CountryFields; GF: CountryFields; GG: CountryFields; GH: CountryFields; GI: CountryFields; GL: CountryFields; GM: CountryFields; GN: CountryFields; GP: CountryFields; GQ: CountryFields; GR: CountryFields; GS: CountryFields; GT: CountryFields; GU: CountryFields; GW: CountryFields; GY: CountryFields; HK: CountryFields; HM: CountryFields; HN: CountryFields; HR: CountryFields; HT: CountryFields; HU: CountryFields; IC: CountryFields; ID: CountryFields; IE: CountryFields; IL: CountryFields; IM: CountryFields; IN: CountryFields; IO: CountryFields; IQ: CountryFields; IR: CountryFields; IS: CountryFields; IT: CountryFields; JE: CountryFields; JM: CountryFields; JO: CountryFields; JP: CountryFields; KE: CountryFields; KH: CountryFields; KI: CountryFields; KM: CountryFields; KN: CountryFields; KP: CountryFields; KR: CountryFields; KW: CountryFields; KY: CountryFields; KZ: CountryFields; LA: CountryFields; LC: CountryFields; LI: CountryFields; LK: CountryFields; LR: CountryFields; LS: CountryFields; LT: CountryFields; LU: CountryFields; LV: CountryFields; LY: CountryFields; MA: CountryFields; MC: CountryFields; MD: CountryFields; ME: CountryFields; MF: CountryFields; MG: CountryFields; MH: CountryFields; MK: CountryFields; MN: CountryFields; MP: CountryFields; MQ: CountryFields; MR: CountryFields; MS: CountryFields; MT: CountryFields; MU: CountryFields; MV: CountryFields; MW: CountryFields; MX: CountryFields; MY: CountryFields; MZ: CountryFields; NA: CountryFields; NC: CountryFields; NE: CountryFields; NF: CountryFields; NG: CountryFields; NI: CountryFields; NL: CountryFields; NP: CountryFields; NR: CountryFields; NU: CountryFields; NZ: CountryFields; OM: CountryFields; PA: CountryFields; PE: CountryFields; PG: CountryFields; PH: CountryFields; PK: CountryFields; PL: CountryFields; PM: CountryFields; PR: CountryFields; PS: CountryFields; PT: CountryFields; PW: CountryFields; PY: CountryFields; QA: CountryFields; RE: CountryFields; RO: CountryFields; RS: CountryFields; RU: CountryFields; RW: CountryFields; SA: CountryFields; SB: CountryFields; SC: CountryFields; SD: CountryFields; SE: CountryFields; SG: CountryFields; SH: CountryFields; SI: CountryFields; SJ: CountryFields; SK: CountryFields; SL: CountryFields; SM: CountryFields; SN: CountryFields; SR: CountryFields; SS: CountryFields; ST: CountryFields; SV: CountryFields; SY: CountryFields; SZ: CountryFields; TC: CountryFields; TD: CountryFields; TF: CountryFields; TG: CountryFields; TH: CountryFields; TJ: CountryFields; TK: CountryFields; TL: CountryFields; TM: CountryFields; TN: CountryFields; TR: CountryFields; TT: CountryFields; TV: CountryFields; TW: CountryFields; TZ: CountryFields; UA: CountryFields; UG: CountryFields; UM: CountryFields; US: CountryFields; UY: CountryFields; UZ: CountryFields; VA: CountryFields; VC: CountryFields; VE: CountryFields; VG: CountryFields; VI: CountryFields; VN: CountryFields; VU: CountryFields; WF: CountryFields; WS: CountryFields; YE: CountryFields; YT: CountryFields; ZA: CountryFields; ZM: CountryFields; ZW: CountryFields; }",
|
|
263
263
|
"references": {
|
|
264
264
|
"GenericZonosSettings": {
|
|
265
265
|
"location": "import",
|
|
@@ -207,7 +207,7 @@ export class ZonosController {
|
|
|
207
207
|
zonosStore.zonosApiKey = this.zonosApiKey;
|
|
208
208
|
// running with scope async function to avoid blocking the main thread
|
|
209
209
|
(async () => {
|
|
210
|
-
var _a, _b, _c, _d;
|
|
210
|
+
var _a, _b, _c, _d, _e, _f;
|
|
211
211
|
const { errors, json, zonosMode } = await getZonosSettings();
|
|
212
212
|
if (((_b = (_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.toString()) === '403') {
|
|
213
213
|
log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
@@ -276,6 +276,19 @@ export class ZonosController {
|
|
|
276
276
|
log('zonos controller loaded');
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
+
const hasCartCallback =
|
|
280
|
+
// eslint-disable-next-line deprecation/deprecation -- gating Stripe load also honors the legacy callback
|
|
281
|
+
typeof ((_e = zonosStore.checkoutSettings) === null || _e === void 0 ? void 0 : _e.buildCartDetail) === 'function' ||
|
|
282
|
+
typeof ((_f = zonosStore.checkoutSettings) === null || _f === void 0 ? void 0 : _f.createCartId) === 'function';
|
|
283
|
+
// Checkout also runs without merchant cart callbacks when a cart is
|
|
284
|
+
// prefetched (e.g. `tempCartUUID` -> `cartData`) or when resuming a
|
|
285
|
+
// payment via the Stripe client secret. Stripe must still load for those.
|
|
286
|
+
const clientSecret = new URL(window.location.href).searchParams.get('payment_intent_client_secret') || sessionStorage.getItem('zonos--client-secret');
|
|
287
|
+
const hasPrefetchedCheckoutContext = !!(window.Zonos.cartId && window.Zonos.cartData) || !!clientSecret;
|
|
288
|
+
if (!hasCartCallback && !hasPrefetchedCheckoutContext) {
|
|
289
|
+
log(`Skip loading Stripe because no cart callback (buildCartDetail/createCartId), prefetched cart, or payment client secret is present`, 'warn');
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
279
292
|
// send publishable key out to load stripe
|
|
280
293
|
this.stripeInitEvent.emit({
|
|
281
294
|
publishableKey: publishableKey.token,
|
|
@@ -335,7 +348,7 @@ export class ZonosController {
|
|
|
335
348
|
zonosStore.organizationName = organizationName;
|
|
336
349
|
}
|
|
337
350
|
render() {
|
|
338
|
-
return h(Host, { key: '
|
|
351
|
+
return h(Host, { key: '925af89a63419b44e6372de48c66e0898d039ae0', class: "zonos--elements" });
|
|
339
352
|
}
|
|
340
353
|
static get is() { return "zonos-controller"; }
|
|
341
354
|
static get encapsulation() { return "shadow"; }
|
|
@@ -606,7 +619,7 @@ export class ZonosController {
|
|
|
606
619
|
"signature": "(countryCode: CountryCode) => Promise<void>",
|
|
607
620
|
"parameters": [{
|
|
608
621
|
"name": "countryCode",
|
|
609
|
-
"type": "\"EG\" | \"MO\" | \"PN\" | \"KG\" | \"LB\" | \"
|
|
622
|
+
"type": "\"EG\" | \"MO\" | \"PN\" | \"KG\" | \"LB\" | \"BH\" | \"ML\" | \"NO\" | \"CG\" | \"CM\" | \"MM\" | \"AQ\" | \"AX\" | \"CC\" | \"ER\" | \"PF\" | \"SO\" | \"SX\" | \"TO\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BR\" | \"BS\" | \"BT\" | \"BV\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CD\" | \"CF\" | \"CH\" | \"CI\" | \"CK\" | \"CL\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CV\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DZ\" | \"EC\" | \"EE\" | \"EH\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB\" | \"GD\" | \"GE\" | \"GF\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GP\" | \"GQ\" | \"GR\" | \"GS\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HM\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"IC\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MF\" | \"MG\" | \"MH\" | \"MK\" | \"MN\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NC\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PM\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RE\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SD\" | \"SE\" | \"SG\" | \"SH\" | \"SI\" | \"SJ\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TF\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"UM\" | \"US\" | \"UY\" | \"UZ\" | \"VA\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WF\" | \"WS\" | \"YE\" | \"YT\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
|
610
623
|
"docs": ""
|
|
611
624
|
}],
|
|
612
625
|
"references": {
|
|
@@ -6,6 +6,7 @@ import { storageStore, storageStoreSetEnabledVariantTestKeys, } from "../storage
|
|
|
6
6
|
import { translate } from "../translationStore";
|
|
7
7
|
import { zonosStore } from "../zonosStore";
|
|
8
8
|
import { getIsStagingMode } from "../../utils/checkout/getIsStagingMode";
|
|
9
|
+
import { isEuDapRemittance } from "../../utils/checkout/isEuDapRemittance";
|
|
9
10
|
import { allLogs, log } from "../../utils/logging/log";
|
|
10
11
|
import { logError } from "../../utils/logging/logError";
|
|
11
12
|
import { sendErrorLog } from "../../utils/logging/sendErrorLog";
|
|
@@ -284,13 +285,22 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
284
285
|
/**
|
|
285
286
|
* For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
|
|
286
287
|
*/
|
|
287
|
-
const cartStoreGetMethod = (landedCost) => {
|
|
288
|
-
var _a, _b, _c;
|
|
288
|
+
const cartStoreGetMethod = (landedCost, deliveryType) => {
|
|
289
|
+
var _a, _b, _c, _d;
|
|
289
290
|
// If the landed cost is DAP and the country is domestic, then treat it as DDP since no duty or fee is due at the door
|
|
290
291
|
if (landedCost.method === 'DAP' &&
|
|
291
292
|
((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US'))) {
|
|
292
293
|
return 'DDP';
|
|
293
294
|
}
|
|
295
|
+
// EU 3-EUR cutover (05CHECK-893): keep EU POSTAL remittance quotes as DAP so
|
|
296
|
+
// the shopper is told duties are paid upon delivery, even though we remit.
|
|
297
|
+
if (isEuDapRemittance({
|
|
298
|
+
deliveryType,
|
|
299
|
+
landedCost,
|
|
300
|
+
shipToCountry: (_d = stripeStore.stripeAddressEventData) === null || _d === void 0 ? void 0 : _d.value.address.country,
|
|
301
|
+
})) {
|
|
302
|
+
return 'DAP';
|
|
303
|
+
}
|
|
294
304
|
if (landedCost.method === 'DAP' &&
|
|
295
305
|
landedCost.remittance.length &&
|
|
296
306
|
landedCost.landedCostGuaranteeCode === 'ZONOS') {
|
|
@@ -299,7 +309,7 @@ const cartStoreGetMethod = (landedCost) => {
|
|
|
299
309
|
return landedCost.method;
|
|
300
310
|
};
|
|
301
311
|
const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, landedCostId, selectedShippingOption, }) => {
|
|
302
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
312
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
303
313
|
log('Updating selected shipping option', 'info', {
|
|
304
314
|
landedCostId,
|
|
305
315
|
selectedShippingOption,
|
|
@@ -329,13 +339,13 @@ const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, lande
|
|
|
329
339
|
if (dutiesTaxesFeesEstimate) {
|
|
330
340
|
log(`DAP quote, using estimate: ${dutiesTaxesFeesEstimate}`, 'info');
|
|
331
341
|
}
|
|
332
|
-
cartStore.landedCostMethod = cartStoreGetMethod(selectedLandedCost.landedCost);
|
|
342
|
+
cartStore.landedCostMethod = cartStoreGetMethod(selectedLandedCost.landedCost, (_c = selectedShippingOption.shippingProfile) === null || _c === void 0 ? void 0 : _c.serviceLevel.deliveryType);
|
|
333
343
|
// update shipping value and dutiesTaxFees on selectedShippingOption change
|
|
334
344
|
cartStore.shipping = selectedLandedCost.subtotals.shipping;
|
|
335
345
|
// update deminimis status
|
|
336
|
-
const isGuarantee = ((
|
|
346
|
+
const isGuarantee = ((_d = selectedLandedCost === null || selectedLandedCost === void 0 ? void 0 : selectedLandedCost.landedCost) === null || _d === void 0 ? void 0 : _d.landedCostGuaranteeCode) === 'ZONOS';
|
|
337
347
|
// one item in deminimis with type of duty and tax has threshold value is "ABOVE"
|
|
338
|
-
const isAboveDeminimis = !!((
|
|
348
|
+
const isAboveDeminimis = !!((_f = (_e = selectedLandedCost === null || selectedLandedCost === void 0 ? void 0 : selectedLandedCost.landedCost) === null || _e === void 0 ? void 0 : _e.deMinimis) === null || _f === void 0 ? void 0 : _f.find(item => ['DUTY', 'TAX'].includes(item.type) && item.threshold === 'ABOVE'));
|
|
339
349
|
cartStore.isSelectedShippingAboveDeminimis = isAboveDeminimis;
|
|
340
350
|
cartStore.isSelectedShippingGuarantee = isGuarantee;
|
|
341
351
|
let updateCalculateStatus = false;
|
|
@@ -360,22 +370,22 @@ const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, lande
|
|
|
360
370
|
billToPartyId: stripeStore.partyBillingId,
|
|
361
371
|
cartId: window.Zonos.cartId,
|
|
362
372
|
dutiesTaxesFeesEstimate: dutiesTaxesFeesEstimate,
|
|
363
|
-
landedCostId: (
|
|
373
|
+
landedCostId: (_g = selectedLandedCost.landedCost) === null || _g === void 0 ? void 0 : _g.id,
|
|
364
374
|
shipToPartyId: stripeStore.partyShippingId,
|
|
365
375
|
varianceTestInput: storageStore.enabledVariantTestKeys || [],
|
|
366
376
|
});
|
|
367
377
|
}
|
|
368
378
|
// update conditionally render pay in USD button
|
|
369
|
-
const firstItem = (
|
|
379
|
+
const firstItem = (_h = cartStore.items.find(Boolean)) === null || _h === void 0 ? void 0 : _h.currencyCode;
|
|
370
380
|
// Stripe address event data should be available at this point
|
|
371
|
-
const shipToCountry = ((
|
|
381
|
+
const shipToCountry = ((_j = stripeStore.stripeAddressEventData) === null || _j === void 0 ? void 0 : _j.value.address.country) || 'US';
|
|
372
382
|
// Only show pay in USD button if item's currency is in USD, the setting is enabled and the order presentment currency is not USD, also only in USD settlement ship to country list
|
|
373
383
|
stripeStore.shouldRenderPayInUsdButton =
|
|
374
384
|
firstItem === 'USD' &&
|
|
375
385
|
zonosStore.checkoutSettings.allowedSettlementCurrencies ===
|
|
376
386
|
'LOCAL_AND_USD' &&
|
|
377
|
-
((
|
|
378
|
-
!!((
|
|
387
|
+
((_k = cartStore.checkoutSession) === null || _k === void 0 ? void 0 : _k.subtotals.presentmentCurrencyCode) !== 'USD' &&
|
|
388
|
+
!!((_m = (_l = zonosStore.genericSettings) === null || _l === void 0 ? void 0 : _l.usdSettlementCountryEnabled) === null || _m === void 0 ? void 0 : _m.includes(shipToCountry));
|
|
379
389
|
return updateCalculateStatus;
|
|
380
390
|
};
|
|
381
391
|
const cartStoreStartCheckoutInterval = ({ isPreview, sessionTimeout, }) => {
|
|
@@ -224,6 +224,9 @@ export const stringsArabic = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'ستنطبق الرسوم على جميع الطلبات.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'سيتم فرض الرسوم عند التسليم.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'الرسوم والضرائب والرسوم',
|
|
229
232
|
},
|
|
@@ -225,6 +225,9 @@ export const stringsBase = {
|
|
|
225
225
|
'Duties will apply to all orders.': {
|
|
226
226
|
value: 'Duties will apply to all orders.',
|
|
227
227
|
},
|
|
228
|
+
'Duties will be charged upon delivery.': {
|
|
229
|
+
value: 'Duties will be charged upon delivery.',
|
|
230
|
+
},
|
|
228
231
|
'Duties, taxes, and fees': {
|
|
229
232
|
value: 'Duties, taxes, and fees',
|
|
230
233
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsDanish = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Told vil gælde for alle ordrer.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Told vil blive opkrævet ved levering.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Told, skatter og gebyrer',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsDutch = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Invoerrechten zullen van toepassing zijn op alle bestellingen.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Invoerrechten worden bij levering in rekening gebracht.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Heffingen, belastingen en kosten',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsFrench = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: "Des droits de douane s'appliqueront à toutes les commandes.",
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Les droits seront facturés à la livraison.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Droits, taxes et frais',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsGerman = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Zölle werden auf alle Bestellungen angewendet.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Zölle werden bei Lieferung berechnet.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Zölle, Steuern und Gebühren',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsHebrew = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'חובות יחולו על כל ההזמנות.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'מכס ייגבה בעת המסירה.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'מכס, מסים ועמלות',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsIndonesian = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Bea akan berlaku untuk semua pesanan.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Bea akan dikenakan saat pengiriman.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Bea masuk, pajak, dan biaya',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsItalian = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'I dazi si applicheranno a tutti gli ordini.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'I dazi saranno addebitati alla consegna.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Dazi, tasse e spese',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsJapanese = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'すべての注文に関税が適用されます。',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: '配達時に関税が請求されます。',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: '関税、税金、手数料',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsKorean = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: '모든 주문에 관세가 적용됩니다.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: '관세는 배송 시 부과됩니다.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: '관세, 세금 및 수수료',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsNorwegian = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Avgifter vil gjelde for alle bestillinger.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Avgifter vil bli belastet ved levering.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Avgifter, skatter og gebyrer',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsPolish = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Cła będą miały zastosowanie do wszystkich zamówień.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Cła zostaną naliczone przy dostawie.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Cła, podatki i opłaty',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsPortuguese = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Impostos serão aplicados a todos os pedidos.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'As taxas serão cobradas na entrega.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Impostos, taxas e emolumentos',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsRussian = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Пошлины будут применяться ко всем заказам.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Пошлины будут взиматься при доставке.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Пошлины, налоги и сборы',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsSpanish = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Se aplicarán aranceles a todos los pedidos.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Los aranceles se cobrarán al momento de la entrega.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Aranceles, impuestos y cuotas',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsSwedish = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Tullar kommer att gälla för alla beställningar.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Tullar debiteras vid leverans.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Tull, skatter och avgifter',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsTurkish = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Tüm siparişlere gümrük vergisi uygulanacaktır.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Harçlar teslimatta tahsil edilecektir.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Gümrük vergisi, vergiler ve ücretler',
|
|
229
232
|
},
|
|
@@ -224,6 +224,9 @@ export const stringsVietnamese = {
|
|
|
224
224
|
'Duties will apply to all orders.': {
|
|
225
225
|
value: 'Thuế sẽ áp dụng cho tất cả các đơn hàng.',
|
|
226
226
|
},
|
|
227
|
+
'Duties will be charged upon delivery.': {
|
|
228
|
+
value: 'Thuế sẽ được tính khi giao hàng.',
|
|
229
|
+
},
|
|
227
230
|
'Duties, taxes, and fees': {
|
|
228
231
|
value: 'Thuế, phí và lệ phí',
|
|
229
232
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { euCountryCodes } from "../../../types/checkout/Tax";
|
|
2
|
+
/**
|
|
3
|
+
* EU 3-EUR cutover (05CHECK-893): when shipping to an EU country with a POSTAL
|
|
4
|
+
* service level whose DAP landed cost has remittance available, we keep treating
|
|
5
|
+
* the quote as DAP (duties paid upon delivery) instead of converting it to DDP.
|
|
6
|
+
* The cart subtotals then show taxes and fees as collected while duties are
|
|
7
|
+
* estimated and paid on delivery.
|
|
8
|
+
*
|
|
9
|
+
* @see [[cartStoreGetMethod]] for the DAP/DDP conversion this guards.
|
|
10
|
+
*/
|
|
11
|
+
export const isEuDapRemittance = ({ deliveryType, landedCost, shipToCountry, }) => landedCost.method === 'DAP' &&
|
|
12
|
+
deliveryType === 'POSTAL' &&
|
|
13
|
+
landedCost.remittance.length > 0 &&
|
|
14
|
+
!!shipToCountry &&
|
|
15
|
+
euCountryCodes.includes(shipToCountry);
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
// Execute our own script injection after a tick to give users time to do their
|
|
2
2
|
import { initStripe, zonosStripeLoadScript, } from "./_stripe";
|
|
3
3
|
// own script injection.
|
|
4
|
-
const
|
|
4
|
+
const hasCheckoutCartCallback = () => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return typeof window !== 'undefined' &&
|
|
7
|
+
(typeof ((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.createCartId) === 'function' ||
|
|
8
|
+
typeof ((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.buildCartDetail) === 'function');
|
|
9
|
+
};
|
|
10
|
+
const stripePromise = Promise.resolve().then(() => {
|
|
11
|
+
// Skip eagerly loading Stripe when no checkout cart callback is configured
|
|
12
|
+
// (e.g. a Hello-only integration). Stripe is loaded on demand instead.
|
|
13
|
+
if (!hasCheckoutCartCallback()) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return zonosStripeLoadScript(null);
|
|
17
|
+
});
|
|
5
18
|
let loadCalled = false;
|
|
6
19
|
stripePromise.catch((err) => {
|
|
7
20
|
if (!loadCalled) {
|
|
@@ -10,7 +23,12 @@ stripePromise.catch((err) => {
|
|
|
10
23
|
}
|
|
11
24
|
});
|
|
12
25
|
export const zonosLoadStripe = async (...args) => {
|
|
26
|
+
var _a;
|
|
13
27
|
loadCalled = true;
|
|
14
28
|
const startTime = Date.now();
|
|
15
|
-
|
|
29
|
+
// Fall back to loading Stripe on demand if the eager preload was skipped
|
|
30
|
+
// (callbacks set after the microtask, or Collect/Invoice flows that don't
|
|
31
|
+
// use cart callbacks). `zonosStripeLoadScript` is idempotent.
|
|
32
|
+
const maybeStripe = (_a = (await stripePromise)) !== null && _a !== void 0 ? _a : (await zonosStripeLoadScript(null));
|
|
33
|
+
return initStripe(maybeStripe, args, startTime);
|
|
16
34
|
};
|
|
@@ -87,6 +87,11 @@ Zonos.logIntervalId = null;
|
|
|
87
87
|
Zonos.init = async (params) => {
|
|
88
88
|
const { appearance, checkoutSettings, currencyConverter, helloSettings, onCountryChange, overrideCurrencyFormat, storeId, zonosApiKey, } = params;
|
|
89
89
|
_a.cartId = getCartIdFromQueryParam();
|
|
90
|
+
// Expose the checkout cart callbacks on the global so Stripe loading can be
|
|
91
|
+
// gated on whether at least one of them is configured.
|
|
92
|
+
_a.createCartId = checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.createCartId;
|
|
93
|
+
// eslint-disable-next-line deprecation/deprecation -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
|
|
94
|
+
_a.buildCartDetail = checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.buildCartDetail;
|
|
90
95
|
if (_a.doneInit) {
|
|
91
96
|
// do nothing if zonos is already initialized
|
|
92
97
|
return;
|