@zonos/elements 1.3.109 → 1.3.111
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-d25b699a.js → cart-a3eab220.js} +235 -75
- package/dist/cjs/createCustomEvent-3e982e57.js +16 -0
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-fd423375.js → paypal-ca479c4b.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +9 -9
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +126 -104
- package/dist/cjs/zonos-checkout.cjs.entry.js +7 -7
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -9
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +5 -5
- package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +108 -86
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +2 -2
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
- package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +11 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +9 -3
- package/dist/collection/components/store/translationStore/strings.base.js +9 -3
- package/dist/collection/components/store/translationStore/strings.chinese.js +10 -4
- package/dist/collection/components/store/translationStore/strings.danish.js +10 -4
- package/dist/collection/components/store/translationStore/strings.dutch.js +10 -4
- package/dist/collection/components/store/translationStore/strings.french.js +9 -3
- package/dist/collection/components/store/translationStore/strings.german.js +10 -4
- package/dist/collection/components/store/translationStore/strings.hebrew.js +10 -4
- package/dist/collection/components/store/translationStore/strings.indonesian.js +10 -4
- package/dist/collection/components/store/translationStore/strings.italian.js +10 -4
- package/dist/collection/components/store/translationStore/strings.japanese.js +10 -4
- package/dist/collection/components/store/translationStore/strings.korean.js +10 -4
- package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -3
- package/dist/collection/components/store/translationStore/strings.polish.js +9 -3
- package/dist/collection/components/store/translationStore/strings.portuguese.js +10 -4
- package/dist/collection/components/store/translationStore/strings.russian.js +10 -4
- package/dist/collection/components/store/translationStore/strings.spanish.js +10 -4
- package/dist/collection/components/store/translationStore/strings.swedish.js +10 -4
- package/dist/collection/components/store/translationStore/strings.turkish.js +10 -4
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -3
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.css +3 -0
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/scripts/cart/_getIsValidCartId.js +15 -0
- package/dist/collection/scripts/cart/_setupCartData.js +4 -2
- package/dist/esm/{CheckoutConfig-4d2a508c.js → CheckoutConfig-32f33d8b.js} +19 -2
- package/dist/esm/{cart-911ba5dd.js → cart-163f4dd9.js} +235 -76
- package/dist/esm/createCustomEvent-31a792d3.js +13 -0
- package/dist/esm/index.js +9 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-04a10fc2.js → paypal-77e8eef2.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +9 -9
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card.entry.js +4 -4
- package/dist/esm/zonos-cart-items_13.entry.js +125 -103
- package/dist/esm/zonos-checkout.entry.js +6 -6
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +9 -9
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +5 -5
- package/dist/esm/zonos-toggle.entry.js +2 -2
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/CheckoutConfig-32f33d8b.js +1 -0
- package/dist/esm-es5/cart-163f4dd9.js +1 -0
- package/dist/esm-es5/createCustomEvent-31a792d3.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-04a10fc2.js → paypal-77e8eef2.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.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-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-component.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-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/scripts/index.d.ts +0 -5
- 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-finish/zonos-checkout-finish.d.ts +0 -1
- package/dist/types/components/store/checkout/stripe.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.base.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.french.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.german.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -3
- 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/CheckoutConfig.d.ts +0 -5
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-58832515.entry.js → p-019028d5.entry.js} +1 -1
- package/dist/zonos-elements/{p-939d363c.system.entry.js → p-02b1e030.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ba3d2965.entry.js → p-06e3c94f.entry.js} +1 -1
- package/dist/zonos-elements/{p-123cabaa.system.entry.js → p-0810568b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a1475a4.system.entry.js → p-0a8b6b4a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-eaf09ccb.entry.js → p-0ad85ec6.entry.js} +1 -1
- package/dist/zonos-elements/p-110ee9ab.entry.js +1 -0
- package/dist/zonos-elements/{p-1e1397fe.entry.js → p-124f5c21.entry.js} +1 -1
- package/dist/zonos-elements/{p-796dbada.entry.js → p-1605dd48.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee14ba06.system.entry.js → p-189aa06e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b8850092.entry.js → p-1a0e138c.entry.js} +1 -1
- package/dist/zonos-elements/{p-32c29205.system.entry.js → p-1c1ab3c8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1a9a51bf.entry.js → p-1c7e19f7.entry.js} +1 -1
- package/dist/zonos-elements/p-1dcaf64f.js +17 -0
- package/dist/zonos-elements/{p-6927d227.system.entry.js → p-2a0c4426.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-84d38e0c.entry.js → p-31acf417.entry.js} +1 -1
- package/dist/zonos-elements/p-33b57fab.system.js +1 -0
- package/dist/zonos-elements/{p-bfd73737.system.entry.js → p-3c90f724.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ff7b0d6b.system.entry.js → p-42b0fca8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9f89f828.system.entry.js → p-42d9d3af.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ae7526a2.system.entry.js → p-442a308c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-24813754.system.entry.js → p-46a71949.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e880ab28.system.js → p-49135023.system.js} +1 -1
- package/dist/zonos-elements/p-56d405d0.js +1 -0
- package/dist/zonos-elements/{p-8b0feb0e.entry.js → p-58e6386b.entry.js} +1 -1
- package/dist/zonos-elements/{p-9d678aea.system.js → p-5929ba9e.system.js} +1 -1
- package/dist/zonos-elements/p-5a011a47.system.js +1 -0
- package/dist/zonos-elements/p-605473a3.entry.js +1 -0
- package/dist/zonos-elements/p-64372f93.system.js +1 -0
- package/dist/zonos-elements/p-7b999a40.js +1 -0
- package/dist/zonos-elements/{p-8632c8f1.entry.js → p-8acdac29.entry.js} +1 -1
- package/dist/zonos-elements/{p-adbcf21c.entry.js → p-8cafdbc9.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4b5f123.entry.js → p-8e6bbf2c.entry.js} +1 -1
- package/dist/zonos-elements/{p-76a4a647.system.entry.js → p-8e85c28f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-45323a2f.system.entry.js → p-932cbdd7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1d15c126.entry.js → p-9d7a79e3.entry.js} +1 -1
- package/dist/zonos-elements/{p-c9e8f159.system.entry.js → p-a45bd823.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a828799f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b7f627ec.system.entry.js → p-ab9af87d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-abc6b881.system.entry.js +1 -0
- package/dist/zonos-elements/{p-71fe8da9.entry.js → p-b34ccbfd.entry.js} +1 -1
- package/dist/zonos-elements/{p-d6de8661.entry.js → p-bcfc229f.entry.js} +1 -1
- package/dist/zonos-elements/p-c44f27be.js +1 -0
- package/dist/zonos-elements/{p-36eaad7e.entry.js → p-c598b3c5.entry.js} +1 -1
- package/dist/zonos-elements/{p-4eb3e354.entry.js → p-c652212b.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-489029d9.system.entry.js → p-d3c1ad61.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e5d1d031.system.entry.js → p-d8a45014.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ddcbf41d.entry.js +1 -0
- package/dist/zonos-elements/{p-1b1f2e33.system.entry.js → p-e4a69ce9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0962536e.system.entry.js → p-e5e63927.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4069df3c.entry.js → p-f20b3656.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/createCustomEvent-4ea7b6dc.js +0 -51
- package/dist/esm/createCustomEvent-6ba5bcde.js +0 -47
- package/dist/esm-es5/CheckoutConfig-4d2a508c.js +0 -1
- package/dist/esm-es5/cart-911ba5dd.js +0 -1
- package/dist/esm-es5/createCustomEvent-6ba5bcde.js +0 -1
- package/dist/zonos-elements/p-018a4b36.js +0 -1
- package/dist/zonos-elements/p-27188a22.system.entry.js +0 -1
- package/dist/zonos-elements/p-272121e2.js +0 -1
- package/dist/zonos-elements/p-39c09f18.system.entry.js +0 -1
- package/dist/zonos-elements/p-60303c84.js +0 -1
- package/dist/zonos-elements/p-631570f0.system.js +0 -1
- package/dist/zonos-elements/p-64f0fcce.system.js +0 -1
- package/dist/zonos-elements/p-8d98fed0.entry.js +0 -1
- package/dist/zonos-elements/p-a0af6dc1.entry.js +0 -1
- package/dist/zonos-elements/p-e2fa7600.entry.js +0 -1
- package/dist/zonos-elements/p-e9771827.system.js +0 -1
- package/dist/zonos-elements/p-ef9d6106.js +0 -17
|
@@ -10,6 +10,7 @@ import { createCustomEvent } from "../../../utils/createCustomEvent";
|
|
|
10
10
|
import { getBorderRadius } from "../../../utils/getBorderRadius";
|
|
11
11
|
import { handleFetch } from "../../../utils/handleFetch";
|
|
12
12
|
import { jsonParse } from "../../../utils/jsonParse";
|
|
13
|
+
import { allLogs, log } from "../../../utils/logging/log";
|
|
13
14
|
import { sendErrorLog } from "../../../utils/logging/sendErrorLog";
|
|
14
15
|
import { submitGtag } from "../../../utils/submitGtag";
|
|
15
16
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
@@ -17,6 +18,10 @@ import RemoveIcon from "./assets/RemoveIcon.svg";
|
|
|
17
18
|
/* Need to use relative import because inline-svg-stencil couldn't resolve absolute path */
|
|
18
19
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
19
20
|
import SuccessIcon from "./assets/SuccessIcon.svg";
|
|
21
|
+
/**
|
|
22
|
+
* Maximum number of retries to pull order info (gap between each retry is 1 second)
|
|
23
|
+
*/
|
|
24
|
+
const MAX_RETRIES = 30;
|
|
20
25
|
export class ZonosCheckoutFinish {
|
|
21
26
|
constructor() {
|
|
22
27
|
this.pullOrder = async () => {
|
|
@@ -51,57 +56,57 @@ export class ZonosCheckoutFinish {
|
|
|
51
56
|
}
|
|
52
57
|
window.location.href = url;
|
|
53
58
|
};
|
|
54
|
-
this.handleSuccessBehavior = () => {
|
|
55
|
-
var _a, _b
|
|
59
|
+
this.handleSuccessBehavior = async () => {
|
|
60
|
+
var _a, _b;
|
|
56
61
|
/**
|
|
57
62
|
* Save placed order info so we can show order info if they try to place the order again
|
|
58
63
|
*/
|
|
59
64
|
this.saveOrderIdForDuplicationIssue();
|
|
60
65
|
const { successBehavior } = zonosStore.checkoutSettings;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
if (legacyOrderNumber) {
|
|
69
|
-
queryParams.set('orderId', legacyOrderNumber);
|
|
70
|
-
}
|
|
71
|
-
const queryString = queryParams.toString();
|
|
72
|
-
const hasQueryString = redirectUrl.includes('?');
|
|
73
|
-
this.redirectToUrl(queryString
|
|
74
|
-
? // Some url already has query string, so we need to append the query string with '&' instead of '?'
|
|
75
|
-
`${redirectUrl}${hasQueryString ? '&' : '?'}${queryString}`
|
|
76
|
-
: redirectUrl);
|
|
77
|
-
}
|
|
78
|
-
switch (successBehavior) {
|
|
79
|
-
case 'REDIRECT_TO_SUCCESS_PAGE': {
|
|
80
|
-
const settingsRedirectUrl = zonosStore.checkoutSettings.successRedirectUrl;
|
|
66
|
+
switch (true) {
|
|
67
|
+
// If the merchant wants to redirect to a different page
|
|
68
|
+
case successBehavior === 'REDIRECT_TO_SUCCESS_PAGE':
|
|
69
|
+
case !!cartStore.externalConfirmationPageURL: {
|
|
70
|
+
const settingsRedirectUrl = cartStore.externalConfirmationPageURL ||
|
|
71
|
+
zonosStore.checkoutSettings.successRedirectUrl;
|
|
81
72
|
const redirectUrl = settingsRedirectUrl;
|
|
73
|
+
// use different default notification message if we are redirecting to a different page
|
|
74
|
+
this.notificationTitle = translate('Order complete!');
|
|
75
|
+
this.notificationMessages = [
|
|
76
|
+
translate('Your order has been successfully placed.'),
|
|
77
|
+
translate("You will be redirected back to the merchant's site in a few seconds."),
|
|
78
|
+
];
|
|
79
|
+
// stop loading spinner to show the redirecting notification
|
|
80
|
+
this.isLoading = false;
|
|
81
|
+
// override title if notification type is success
|
|
82
|
+
this.useOverrideSuccessNotification();
|
|
83
|
+
// attempt to pull order info before redirecting
|
|
84
|
+
await this.getPullOrder();
|
|
85
|
+
// If order is still not ready, should not redirect with no order id as merchant would show an error page and customer may think the order was not placed and retry
|
|
86
|
+
if (!this.order) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const legacyOrderNumber = ((_b = (_a = this.order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value) || null;
|
|
82
90
|
const queryParams = new URLSearchParams();
|
|
83
|
-
if (
|
|
91
|
+
if (this.order.id) {
|
|
84
92
|
queryParams.set('zOrderNumber', this.order.id);
|
|
85
93
|
}
|
|
86
94
|
if (legacyOrderNumber) {
|
|
87
95
|
queryParams.set('orderId', legacyOrderNumber);
|
|
88
96
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
?
|
|
94
|
-
|
|
95
|
-
: redirectUrl);
|
|
96
|
-
}
|
|
97
|
-
// If no redirect URL, break and display Zonos success page
|
|
97
|
+
const queryString = queryParams.toString();
|
|
98
|
+
const hasQueryString = redirectUrl.includes('?');
|
|
99
|
+
this.redirectToUrl(queryString
|
|
100
|
+
? // Some url already has query string, so we need to append the query string with '&' instead of '?'
|
|
101
|
+
`${redirectUrl}${hasQueryString ? '&' : '?'}${queryString}`
|
|
102
|
+
: redirectUrl);
|
|
98
103
|
break;
|
|
99
104
|
}
|
|
100
|
-
case 'CLOSE_MODAL':
|
|
101
|
-
|
|
102
|
-
break;
|
|
103
|
-
case 'ZONOS_SUCCESS_PAGE':
|
|
105
|
+
case successBehavior === 'CLOSE_MODAL':
|
|
106
|
+
case successBehavior === 'ZONOS_SUCCESS_PAGE':
|
|
104
107
|
default:
|
|
108
|
+
// override title if notification type is success
|
|
109
|
+
this.useOverrideSuccessNotification();
|
|
105
110
|
// Do nothing, display Zonos success page
|
|
106
111
|
this.isLoading = false;
|
|
107
112
|
break;
|
|
@@ -110,44 +115,67 @@ export class ZonosCheckoutFinish {
|
|
|
110
115
|
// TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
|
|
111
116
|
this.getPullOrder = async (attempts = 0) => {
|
|
112
117
|
var _a, _b;
|
|
118
|
+
if (attempts === 0) {
|
|
119
|
+
log('=== Start to poll for order info', 'info');
|
|
120
|
+
}
|
|
113
121
|
const { baseUrl, order } = await this.pullOrder();
|
|
114
122
|
const { isLegacyCheckout } = window.Zonos;
|
|
115
123
|
const foundLegacyOrderNumber = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
125
|
+
const maxRetries = parseFloat(new URLSearchParams(window.location.search).get('maxPollingRetries') ||
|
|
126
|
+
'0') || MAX_RETRIES;
|
|
127
|
+
if (
|
|
128
|
+
// Order found and was regular checkout user
|
|
129
|
+
(order && !isLegacyCheckout) ||
|
|
130
|
+
// Order found, in legacy checkout facade and still haven't found the legacy order number
|
|
131
|
+
(order && attempts >= maxRetries) ||
|
|
132
|
+
// Legacy order number is ready in the order
|
|
118
133
|
foundLegacyOrderNumber) {
|
|
119
|
-
|
|
134
|
+
log('=== Order info found', 'info');
|
|
135
|
+
if (isLegacyCheckout && order && !foundLegacyOrderNumber) {
|
|
120
136
|
// We pushed this one through without the legacy order number, so we should log this
|
|
121
|
-
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
122
137
|
void sendErrorLog({
|
|
123
|
-
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order
|
|
124
|
-
errors: [
|
|
138
|
+
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
|
|
139
|
+
errors: [
|
|
140
|
+
`Order found but legacy order number doesn’t exist after ${maxRetries} attempts`,
|
|
141
|
+
],
|
|
142
|
+
metadata: {
|
|
143
|
+
allLogs,
|
|
144
|
+
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
145
|
+
domain: window.location.hostname,
|
|
146
|
+
orderId: order.id,
|
|
147
|
+
storeId: zonosStore.storeId,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
else if (attempts > 10) {
|
|
153
|
+
// Log out all the logs if we have tried more than 10 times
|
|
154
|
+
void sendErrorLog({
|
|
155
|
+
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
|
|
156
|
+
errors: [`Order found after ${attempts} attempts`],
|
|
125
157
|
metadata: {
|
|
158
|
+
allLogs,
|
|
126
159
|
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
127
160
|
domain: window.location.hostname,
|
|
128
|
-
orderId:
|
|
161
|
+
orderId: order.id,
|
|
129
162
|
storeId: zonosStore.storeId,
|
|
130
163
|
},
|
|
131
164
|
});
|
|
132
165
|
}
|
|
133
|
-
void trackConversionEvent('checkout_orderCompleted');
|
|
134
166
|
this.order = order;
|
|
135
|
-
this.handleSuccessBehavior();
|
|
136
167
|
}
|
|
137
|
-
else if ((!order || !foundLegacyOrderNumber) && attempts <
|
|
168
|
+
else if ((!order || !foundLegacyOrderNumber) && attempts < maxRetries) {
|
|
138
169
|
// Wait for 1 second before the next attempt
|
|
139
170
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
140
171
|
await this.getPullOrder(attempts + 1);
|
|
141
172
|
}
|
|
142
173
|
else {
|
|
143
|
-
// Set loading to false to display generic success page and log error
|
|
144
|
-
this.isLoading = false;
|
|
145
|
-
void trackConversionEvent('checkout_orderCompleted');
|
|
146
|
-
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
147
174
|
void sendErrorLog({
|
|
148
175
|
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
|
|
149
|
-
errors: [
|
|
176
|
+
errors: [`Order not found after ${maxRetries} attempts`],
|
|
150
177
|
metadata: {
|
|
178
|
+
allLogs,
|
|
151
179
|
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
152
180
|
domain: window.location.hostname,
|
|
153
181
|
storeId: zonosStore.storeId,
|
|
@@ -157,22 +185,18 @@ export class ZonosCheckoutFinish {
|
|
|
157
185
|
};
|
|
158
186
|
// If user provide override notification text, use it
|
|
159
187
|
this.useOverrideSuccessNotification = () => {
|
|
160
|
-
const {
|
|
188
|
+
const { successPageSubtitleText, successPageTitleText } = zonosStore.checkoutSettings;
|
|
161
189
|
if (successPageTitleText) {
|
|
162
190
|
this.notificationTitle = successPageTitleText;
|
|
163
191
|
}
|
|
164
192
|
if (successPageSubtitleText) {
|
|
165
193
|
this.notificationMessages = successPageSubtitleText;
|
|
166
194
|
}
|
|
167
|
-
if (successPageActionText) {
|
|
168
|
-
this.notificationActionText = successPageActionText;
|
|
169
|
-
}
|
|
170
195
|
};
|
|
171
196
|
this.checkStripePaymentStatus = async () => {
|
|
172
|
-
this.isLoading = true;
|
|
173
197
|
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
|
|
174
198
|
if (clientSecret || this.storybookForceStatus) {
|
|
175
|
-
const { error, messages,
|
|
199
|
+
const { error, messages, paymentIntentId, status } = await stripeStoreRetrievePayment({
|
|
176
200
|
clientSecret,
|
|
177
201
|
storybookForceStatus: this.storybookForceStatus,
|
|
178
202
|
});
|
|
@@ -181,38 +205,41 @@ export class ZonosCheckoutFinish {
|
|
|
181
205
|
this.notificationTitle = error
|
|
182
206
|
? translate('Payment failed')
|
|
183
207
|
: translate("You're all set!");
|
|
184
|
-
|
|
208
|
+
// Payment doesn't go through
|
|
209
|
+
if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
|
|
185
210
|
submitGtag('zonos-checkout-payment-fail');
|
|
211
|
+
void sendErrorLog({
|
|
212
|
+
endpoint: 'Stripe payment failed',
|
|
213
|
+
errors: [
|
|
214
|
+
`Payment intent "${paymentIntentId}" status: ${status} - checkout session: ${cartStore.checkoutSessionId}`,
|
|
215
|
+
],
|
|
216
|
+
metadata: {
|
|
217
|
+
allLogs,
|
|
218
|
+
credentialToken: window.Zonos.zonosApiKey,
|
|
219
|
+
},
|
|
220
|
+
});
|
|
186
221
|
}
|
|
187
222
|
else {
|
|
223
|
+
// Save new order info in case the user reloads before we get order info
|
|
224
|
+
this.saveOrderIdForDuplicationIssue();
|
|
188
225
|
submitGtag('zonos-checkout-success');
|
|
189
|
-
void trackConversionEvent('
|
|
190
|
-
paymentMethod,
|
|
191
|
-
});
|
|
226
|
+
void trackConversionEvent('checkout_orderCompleted');
|
|
192
227
|
const successEvent = createCustomEvent('zonos-checkout-success', {
|
|
193
228
|
message: 'Zonos Checkout successfully processed order',
|
|
194
229
|
});
|
|
195
230
|
document.dispatchEvent(successEvent);
|
|
196
|
-
}
|
|
197
|
-
// Attempt to pull the order details from the graph every second on 5 attempts. Only pull if checkoutSessionId is available
|
|
198
|
-
if (this.notificationType === 'success' && cartStore.checkoutSessionId) {
|
|
199
|
-
// override title if notification type is success
|
|
200
|
-
this.useOverrideSuccessNotification();
|
|
201
231
|
// wait this to finish before resetting store and checkout session id
|
|
202
|
-
await this.
|
|
232
|
+
await this.handleSuccessBehavior();
|
|
203
233
|
}
|
|
204
|
-
else {
|
|
205
|
-
this.isLoading = false;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
this.isLoading = false;
|
|
210
234
|
}
|
|
235
|
+
// Make sure to stop the loading spinner even when there's an error
|
|
236
|
+
this.isLoading = false;
|
|
237
|
+
// reset promo when checkout is finished
|
|
238
|
+
stripeStoreResetPromoCode();
|
|
211
239
|
stripeStoreReset();
|
|
212
240
|
cartStore.checkoutSessionId = null;
|
|
213
241
|
};
|
|
214
242
|
this.checkPaypalPaymentStatus = async () => {
|
|
215
|
-
this.isLoading = true;
|
|
216
243
|
// render error message if there's an error
|
|
217
244
|
if (paypalStore.paypalErrorMessage) {
|
|
218
245
|
this.notificationType = 'error';
|
|
@@ -221,6 +248,8 @@ export class ZonosCheckoutFinish {
|
|
|
221
248
|
this.isLoading = false;
|
|
222
249
|
return;
|
|
223
250
|
}
|
|
251
|
+
// show success message right away when order id is already created
|
|
252
|
+
this.isLoading = false;
|
|
224
253
|
if (paypalStore.orderIdCreated) {
|
|
225
254
|
this.notificationType = 'success';
|
|
226
255
|
this.notificationTitle = translate("You're all set!");
|
|
@@ -229,11 +258,10 @@ export class ZonosCheckoutFinish {
|
|
|
229
258
|
// override title if notification type is success
|
|
230
259
|
this.useOverrideSuccessNotification();
|
|
231
260
|
// wait this to finish before resetting store and checkout session id
|
|
232
|
-
await this.
|
|
261
|
+
await this.handleSuccessBehavior();
|
|
233
262
|
}
|
|
234
263
|
// reset promo when checkout is finished
|
|
235
264
|
stripeStoreResetPromoCode();
|
|
236
|
-
this.isLoading = false;
|
|
237
265
|
stripeStoreReset();
|
|
238
266
|
paypalStoreReset();
|
|
239
267
|
cartStore.checkoutSessionId = null;
|
|
@@ -262,10 +290,11 @@ export class ZonosCheckoutFinish {
|
|
|
262
290
|
this.notificationType = 'success';
|
|
263
291
|
this.notificationTitle = '';
|
|
264
292
|
this.notificationMessages = [];
|
|
265
|
-
this.notificationActionText = translate('Keep shopping');
|
|
266
293
|
this.order = null;
|
|
267
294
|
}
|
|
268
295
|
componentDidLoad() {
|
|
296
|
+
// Reset local storage for placed order info
|
|
297
|
+
localStorage.removeItem('zonos--placed-order-info');
|
|
269
298
|
if (this.overrideNotification) {
|
|
270
299
|
// just show the notification and don't check any of the payment status
|
|
271
300
|
this.notificationType = this.overrideNotification.type;
|
|
@@ -274,8 +303,6 @@ export class ZonosCheckoutFinish {
|
|
|
274
303
|
this.isLoading = false;
|
|
275
304
|
return;
|
|
276
305
|
}
|
|
277
|
-
// Save order info in case the user reloads before we get order info
|
|
278
|
-
this.saveOrderIdForDuplicationIssue();
|
|
279
306
|
if (paypalStore.orderIdCreated) {
|
|
280
307
|
void this.checkPaypalPaymentStatus();
|
|
281
308
|
}
|
|
@@ -284,16 +311,12 @@ export class ZonosCheckoutFinish {
|
|
|
284
311
|
}
|
|
285
312
|
}
|
|
286
313
|
render() {
|
|
287
|
-
var _a, _b, _c, _d;
|
|
288
|
-
const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) ||
|
|
289
|
-
((_d = (_c = (_b = this.order) === null || _b === void 0 ? void 0 : _b.references) === null || _c === void 0 ? void 0 : _c.find(ref => ref.key === 'zonosOrderNumber')) === null || _d === void 0 ? void 0 : _d.value) ||
|
|
290
|
-
null;
|
|
291
314
|
const isTestMode = getIsTestMode();
|
|
292
|
-
return (h(Host, { key: '
|
|
315
|
+
return (h(Host, { key: 'a255ef40504c8e569b44dcdde6a8026745f38c9f', class: "zonos--checkout-finish zonos--elements", style: {
|
|
293
316
|
'--border-radius': getBorderRadius({
|
|
294
317
|
overrideBorderStyle: this.borderRadius,
|
|
295
318
|
}),
|
|
296
|
-
} },
|
|
319
|
+
} }, !this.isLoading && (h("div", { key: 'a14c5a6476b6d77c8b070239b3dbf3b1248d91a1', class: "zonos--finish-details" }, h("div", { key: '7d1d11bc6d1648f6e05fa08c8afa38df2db4f773', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '6e2b00afd313f4724cbd0e3c0ff6d099a4eb0423', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '89ddff1e318401adcc01a1883628651688a39338', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null)))))), isTestMode && cartStore.step === 'finish' && (h("div", { key: '078de76fc1c106538d8ac586edc831639b94e2e1', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '30b68c106ad0eada43b8fadd0b20738d63af0f24', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'a8d092e0a2084ed2c1e2342a7aaf06bf309b559b', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
|
|
297
320
|
}
|
|
298
321
|
static get is() { return "zonos-checkout-finish"; }
|
|
299
322
|
static get encapsulation() { return "shadow"; }
|
|
@@ -380,7 +403,6 @@ export class ZonosCheckoutFinish {
|
|
|
380
403
|
"notificationType": {},
|
|
381
404
|
"notificationTitle": {},
|
|
382
405
|
"notificationMessages": {},
|
|
383
|
-
"notificationActionText": {},
|
|
384
406
|
"order": {}
|
|
385
407
|
};
|
|
386
408
|
}
|
|
@@ -33,10 +33,10 @@ export class ZonosCheckoutFooter {
|
|
|
33
33
|
const languageLabel = (_a = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
|
|
34
34
|
// reverse color when on desktop. With the coversheet backdrop, the color should be white
|
|
35
35
|
const colorDesktop = this.dataTheme === 'LIGHT' && !this.mobile ? 'gray-0' : 'gray-1000';
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: 'c84407b445b03673c739e526407d5daece2465c1', class: classes(['zonos--elements', this.isMobile && 'mobile']) }, h("div", { key: 'de44554ef9af66b36e957ffc7c03c3102eb54289', class: "zonos--checkout-footer" }, h("div", { key: 'c045ebefdfe7e0c78f003ba25478297713726adc', class: "zonos--checkout-locale-wrapper" }, h("zonos-button", { key: 'f9028e5d572a8563f4b223edf28554ecc6bc79a2', buttonColor: colorDesktop, class: "zonos--checkout-footer-language-button", icon: h("zonos-icon", { "aria-label": "Language select", content: Globe, iconColor: colorDesktop }), onClick: () => this.toggleLanguageDialog(), variant: "subtle" }, languageLabel), h("div", { key: 'efa7bd0f7ff692d10eddacdcd922eefd8734dcde', class: classes([
|
|
37
37
|
'zonos--checkout-footer-dialog',
|
|
38
38
|
this.showLanguageDialog && 'zonos--checkout-footer-dialog-open',
|
|
39
|
-
]) }, h("zonos-language-select", { key: '
|
|
39
|
+
]) }, h("zonos-language-select", { key: '4086571d445ad29f824975a6ad107d1351302d78', handleOnClose: () => this.toggleLanguageDialog() }))), h("div", { key: 'f16a9caea53befe23f6fc6f5690635d9cd6e196b', class: "zonos--checkout-footer-icon-wrapper" }, h("a", { key: '5ca1a5aadf50bb038209a505b8bece798c92efc5', href: "https://zonos.com/docs/legal/zonos-privacy-policy", target: "_blank" }, h("zonos-text", { key: 'c60d81728e5ebdddea08429eae156e312e407d35', textColor: colorDesktop }, "Privacy policy")), h("div", { key: 'e50935aea98312ab3ffd3c04e8155843e802791a', class: "zonos--checkout-footer-logo" }, h("zonos-text", { key: 'b8e10c2d63cf5bade264213ae2e37639b10347ae', textColor: colorDesktop }, "Powered by"), h("a", { key: '5f4ad624ac59e6e59d0bc73f70eb98399009cf1a', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'db358784c050fedfb7b0e4e02ca54c9926691963', autoHeight: true, content: ZonosIcon, iconColor: colorDesktop, size: 108 })))))));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "zonos-checkout-footer"; }
|
|
42
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -34,8 +34,8 @@ import MessageIcon from "./assets/MessageIcon.svg";
|
|
|
34
34
|
import RemoveIcon from "./assets/RemoveIcon.svg";
|
|
35
35
|
// 90 minutes
|
|
36
36
|
const CHECKOUT_SESSION_TIMEOUT = 90 * 60 * 1000;
|
|
37
|
-
//
|
|
38
|
-
const ORDER_DUPLICATION_NOTIFICATION_EXPIRATION =
|
|
37
|
+
// 6 hours
|
|
38
|
+
const ORDER_DUPLICATION_NOTIFICATION_EXPIRATION = 6 * 60 * 60 * 1000;
|
|
39
39
|
export class ZonosCheckout {
|
|
40
40
|
constructor() {
|
|
41
41
|
/**
|
|
@@ -172,13 +172,13 @@ export class ZonosShipping {
|
|
|
172
172
|
if (this.showErrorBanner) {
|
|
173
173
|
this.showErrorBanner = !this.handleValidate();
|
|
174
174
|
}
|
|
175
|
-
return (h(Host, { key: '
|
|
175
|
+
return (h(Host, { key: '7b16a998c47d1e834c1de3aaac030461e38e43d5', class: "zonos--shipping zonos--elements" }, h("div", { key: '796d1d43d1a409b6b94a8faa3a41bcfb8d26aeb2', class: "zonos--group" }, h("zonos-text", { key: '78629e22a49733794d6ac3bd56bd48c5c7a2ff5a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!this.serviceLevelsAll.length && (h("zonos-banner", { key: 'fc0367bfad972e86f0f78fd7ac279c69aa51aeb8', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'e79faacea340e54ee6fcde62073d87960dfbfbcf', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !this.serviceLevelsAll.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
|
|
176
176
|
!!this.serviceLevelsDAP.length && (h("button", { class: classes([
|
|
177
177
|
'zonos--shipping-options-collapse-trigger',
|
|
178
178
|
this.collapsedDAPOptions && 'collapsed',
|
|
179
179
|
]), onClick: () => {
|
|
180
180
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
181
|
-
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '
|
|
181
|
+
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '03c7dc8d310db7dc161b064a1f384034e8b5a067', class: "zonos--group-btn" }, h("zonos-button", { key: '33d4afb9f86b8f8e5a8843c2ccfefac3e9ec1d76', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
182
182
|
// use primary type when on mobile mode
|
|
183
183
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
184
184
|
}
|
|
@@ -15,16 +15,16 @@ export class ZonosBadge {
|
|
|
15
15
|
this.dismissHandler = undefined;
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: '0d5b32ba989420e4f68519f519db3227568a3cd9', class: classes(['zonos--elements zonos--badge']), style: {
|
|
19
19
|
'--font-family': zonosStoreFontFamily(),
|
|
20
|
-
} }, h("div", { key: '
|
|
20
|
+
} }, h("div", { key: '43ea955a3005bed1bf30736b9515dc59fc5d9166', class: classes([
|
|
21
21
|
'zonos--badge-content',
|
|
22
22
|
this.badgeColor,
|
|
23
23
|
this.rounded && 'rounded',
|
|
24
24
|
this.iconRight && 'icon-right',
|
|
25
25
|
this.size,
|
|
26
26
|
this.bold && 'bold',
|
|
27
|
-
]) }, this.icon, h("zonos-text", { key: '
|
|
27
|
+
]) }, this.icon, h("zonos-text", { key: '4ba9b812daf3f977eb7558717d1ccdb6337dab81', textColor: `${this.badgeColor}-800` }, h("slot", { key: 'e55243d80edfd4d2ac855b72c3d10f23a2145a6d' })), this.dismissHandler && (h("zonos-icon", { key: 'dcce519c1a2d75021922adabdd640995994a971e', "aria-label": "Remove action", class: "zonos--badge-dismiss", content: RemoveLineIcon, onClick: () => { var _a; return (_a = this.dismissHandler) === null || _a === void 0 ? void 0 : _a.call(this); } })))));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "zonos-badge"; }
|
|
30
30
|
static get encapsulation() { return "shadow"; }
|
|
@@ -121,12 +121,12 @@ export class ZonosButton {
|
|
|
121
121
|
const borderStyle = getBorderRadius({
|
|
122
122
|
overrideBorderStyle: this.borderStyle,
|
|
123
123
|
});
|
|
124
|
-
return (h(Host, { key: '
|
|
124
|
+
return (h(Host, { key: '3bb9845e23e10deb5988e6b2c0904b0ea1afeeea', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
|
|
125
125
|
'--background-color': backgroundColor,
|
|
126
126
|
'--border-radius': borderStyle,
|
|
127
127
|
'--color': color,
|
|
128
128
|
'--font-family': zonosStoreFontFamily(),
|
|
129
|
-
}) }, h("button", { key: '
|
|
129
|
+
}) }, h("button", { key: 'd2237dc9995cd537d77c169880937a83350ae683', class: classes([
|
|
130
130
|
this.hasIcon && 'has-icon',
|
|
131
131
|
this.hasContent && 'has-content',
|
|
132
132
|
this.noBackground && 'no-background',
|
|
@@ -141,7 +141,7 @@ export class ZonosButton {
|
|
|
141
141
|
backgroundColor && variant === 'standard' && 'override-background',
|
|
142
142
|
]), disabled: disabled, style: {
|
|
143
143
|
justifyContent: this.justifyContent,
|
|
144
|
-
} }, this.loading && (h("div", { key: '
|
|
144
|
+
} }, this.loading && (h("div", { key: '4756ec69aa3bcd84406f4039567191fdf831f23f', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: '0bcaad4c29bd28f14ecac8fe11a4ae9a16cee543', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: 'bdfdb5ebc08371dbe4e680cc252c4e9841756ec8', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
|
|
145
145
|
}
|
|
146
146
|
static get is() { return "zonos-button"; }
|
|
147
147
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,16 +22,16 @@ export class ZonosCard {
|
|
|
22
22
|
customRoundRadius: `${this.borderRadius}px`,
|
|
23
23
|
overrideBorderStyle: 'ROUNDED',
|
|
24
24
|
});
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '632905e207d9dd9f8392759cad2885291ce66aea', style: {
|
|
26
26
|
'--font-family': zonosStoreFontFamily(),
|
|
27
|
-
} }, h("div", { key: '
|
|
27
|
+
} }, h("div", { key: '3eff8df6e47265977e82180ee7d6ac2b32861000', class: classes(['styled-card']), style: {
|
|
28
28
|
'--background-color': backgroundColor,
|
|
29
29
|
'--border-radius': borderRadius,
|
|
30
30
|
padding: this.spacing,
|
|
31
|
-
} }, this.label && (h("header", { key: '
|
|
31
|
+
} }, this.label && (h("header", { key: '1eb39042c68381efa46e762e48096366975a1b61', class: "card-header", style: { padding: this.spacing } }, h("zonos-text", { key: '573de073bc15576ad3af98af703aa03a3135aebb', type: "subheader" }, this.label), h("h-stack", { key: '03f11b944d438db45a93ff7448e89b44f82e14fe', spacing: 8 }, this.actions))), h("slot", { key: '582071d03c2866271320aea7f30a4b5d9d63ff41' }), (this.footerActions || this.footerContent) && (h("footer", { key: '6909cb6983ce84f517deef48758271c8797b6ac4', class: "card-footer", style: {
|
|
32
32
|
height: this.footerHeight ? `${this.footerHeight}px` : 'auto',
|
|
33
33
|
padding: this.spacing,
|
|
34
|
-
} }, h("div", { key: '
|
|
34
|
+
} }, h("div", { key: '6ff0f9ba56df40829dfd01663cc6ce528b880fda' }, this.footerContent), h("h-stack", { key: '8270f150b0c1b82dc37cb04a112998e23c110ed2', spacing: 8 }, this.footerActions))))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "zonos-card"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -36,14 +36,14 @@ export class ZonosCheckbox {
|
|
|
36
36
|
customRoundRadius: '4px',
|
|
37
37
|
overrideBorderStyle: this.borderStyle,
|
|
38
38
|
});
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: '5309db6094793a992d4a605a6d1e3c83ced3c9d0', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
40
40
|
'--background-color': backgroundColor,
|
|
41
41
|
'--border-radius': borderStyle,
|
|
42
42
|
'--font-family': zonosStoreFontFamily(),
|
|
43
43
|
'--size': `${this.size}px`,
|
|
44
|
-
} }, h("label", { key: '
|
|
44
|
+
} }, h("label", { key: '06e34043130ada8ca8abd0d0930ba60c7e0b9371', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: 'fe09f13ccd0b15c6d71cb21fc1742c1243c04b66', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
|
|
45
45
|
this.checkboxSelected.emit(e.target.checked);
|
|
46
|
-
}, type: "checkbox" }), h("span", { key: '
|
|
46
|
+
}, type: "checkbox" }), h("span", { key: 'c523e7e7919e8d26cb4a62790af04915d2f939d8', class: "checkmark-container" }, h("svg", { key: '95b0359976b4796a9186069a04c5568a13132b8e', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '68ecd2567b9c8922bd6919290f0f8affcaca0c2c', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { key: '52b38dcd04947a0a0106f565a124cd4a0f9d17db', size: this.fontSize }, this.label)))));
|
|
47
47
|
}
|
|
48
48
|
static get is() { return "zonos-checkbox"; }
|
|
49
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -64,17 +64,17 @@ export class ZonosCheckoutProgressTabs {
|
|
|
64
64
|
color: labelSelectedColor,
|
|
65
65
|
})
|
|
66
66
|
: labelSelectedColor;
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'cb720c17828585b4e5235c0695d1887efacfc232', class: "zonos--elements", style: {
|
|
68
68
|
'--color': contrastLabelColor,
|
|
69
69
|
'--progress-percent': this.getTotalSuccessStep(),
|
|
70
|
-
} }, h("div", { key: '
|
|
70
|
+
} }, h("div", { key: '3249121ebbb26b8a377f0fdf39700e5098374bae', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
|
|
71
71
|
const isSelected = tab.value === selectedStep;
|
|
72
72
|
return (h("button", { class: classes([
|
|
73
73
|
'zonos--tab-item',
|
|
74
74
|
tab.value === selectedStep && 'selected',
|
|
75
75
|
tab.isDone && 'done',
|
|
76
76
|
]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cartStore.step = tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, translate(tab.label))));
|
|
77
|
-
})), h("div", { key: '
|
|
77
|
+
})), h("div", { key: 'da31d2d0a835182509a8199dc4fa9f1278be23e1', class: "zonos--tab-progress" }, h("div", { key: '6523c3e32b0926915b7d06f9cb19f6fc427c0e84', class: "zonos--progress-bar-fill" }))));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "zonos-checkout-progress-tabs"; }
|
|
80
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -42,10 +42,10 @@ export class ZonosCollapse {
|
|
|
42
42
|
// set overflow to hidden to prevent content from showing when collapsed
|
|
43
43
|
this.el.style.overflow = 'hidden';
|
|
44
44
|
}
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '22d1cfa07362c868ff1b58315789d3d65bcce556', class: 'zonos--elements zonos--collapse', style: {
|
|
46
46
|
'--font-family': zonosStoreFontFamily(),
|
|
47
47
|
height: this.getElementHeight(),
|
|
48
|
-
} }, h("div", { key: '
|
|
48
|
+
} }, h("div", { key: 'fa8c388a6497311d4dd4989e3f9ad2f7f3b8ee82' }, h("iframe", { key: 'b93e841bc726709fdca538d7fed38e09470c3ff5', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: 'aac6f96a0d928d372248f3fa1a906cd764f6e0d3' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "zonos-collapse"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -83,13 +83,13 @@ export class ZonosConfirmDialog {
|
|
|
83
83
|
const borderStyle = getBorderRadius();
|
|
84
84
|
// Get theme for the update dialog, inherit from the theme, no from this component theme
|
|
85
85
|
const theme = getZonosStoreTheme(zonosStore.appearance.theme);
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '2ae28cccbc55249c415bdeb1f3b6ebfcd16705fd', class: classes([this.dialogOpen && 'open', 'zonos--elements']), "data-dialog-type": this.dialogType, "data-theme": theme, style: {
|
|
87
87
|
'--border-radius': borderStyle,
|
|
88
88
|
'--dialog-width': `${this.dialogWidth}px`,
|
|
89
89
|
'--font-family': zonosStoreFontFamily(),
|
|
90
|
-
} }, h("div", { key: '
|
|
90
|
+
} }, h("div", { key: '6887502fc45f8726e00875c1533853f170d61b69', class: "zonos--backdrop", tabIndex: -1 }), h("div", { key: '9e303d17187cf0c8d281e4faa9ad65704b7b5f56', "aria-hidden": "true", class: classes(['zonos--confirm-layout', this.dialogIntent]), onClick: e => this.clickOutsideDialogHandler(e) }, h("div", { key: '2a7a8633c62e14bb134ebb6cd08050a558498afc', class: "zonos--confirm-dialog", onBlur: () => {
|
|
91
91
|
this.focusDialog();
|
|
92
|
-
} }, h("div", { key: '
|
|
92
|
+
} }, h("div", { key: '738395a26d051c099893c9d186e711742b87fd0d', class: "wrapper" }, h("div", { key: '6037c59790568e095c42fabd6bc2c02d026e36de', class: "icon-wrapper" }, this.renderIcon()), h("div", { key: '0db72c9e8702e642e6eba5d81d2560f69491742e', class: "content" }, h("div", { key: 'a6e25a16aba531ed8e4f0400c44df1ef5f3bd968', class: "title" }, h("zonos-text", { key: '8d572ed39778bb406bf69791fe8c8685c03a884f', type: "subheader" }, this.dialogTitle)), this.dialogSubtitle && (h("div", { key: 'c4a57430c8fc7003be681857f4a5a5c9588c4a38', class: "subtitle" }, h("zonos-text", { key: '73d8b2ca508ab2e022b92f12a0f6bbc0d4c6abe2', textColor: "gray-800" }, this.dialogSubtitle)))), h("div", { key: 'f7c52a24a3ed7ca4ac63b57dc38dc67b6272d9f3', class: "footer" }, this.dialogType === 'confirm' && (h("zonos-button", { key: '50906e6744254cb190e0e13e51c7509f3560623e', backgroundColor: "gray-0", class: "cancel-button", onClick: () => this.closeDialogHandler(), size: "lg", withBoxShadow: true }, this.dialogCancelBtnText || translate('Cancel'))), h("zonos-button", { key: '9b25a61bca74e9ee10e5f9057232faf3507acbe8', class: "confirm-button", onClick: () => this.confirmDialogHandler(), size: "lg", variant: this.getButtonConfirmVariant() }, this.dialogConfirmBtnText)))))));
|
|
93
93
|
}
|
|
94
94
|
static get is() { return "zonos-confirm-dialog"; }
|
|
95
95
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,9 +44,9 @@ export class ZonosCountrySelect {
|
|
|
44
44
|
? fuseObject.map(country => country.item)
|
|
45
45
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
46
46
|
const isEmpty = !filteredCountries.length;
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: 'ca2d15b7e1b015647a56469047fcde2076eb53f7', class: "zonos--elements", style: {
|
|
48
48
|
'--font-family': zonosStoreFontFamily(),
|
|
49
|
-
} }, h("div", { key: '
|
|
49
|
+
} }, h("div", { key: '7b17008dc0e05f2c0bd7e5d2b8e11f7bbc179f13', class: "zonos--country-select" }, h("zonos-v-stack", { key: '34d80924f011f447c8a1fbd0c70317a7e719afab', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '87b671b9f67ab69f19ead665c28cff0727838f4c', handleOnClose: () => this.handleOnClose(), label: translate('Select a country') }, h("input", { key: '57137401c8dca3d88eb59192e85dc81ae0892c67', autocomplete: "off", autofocus: "autofocus", class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: translate('Search countries'), value: this.inputValue }))), h("div", { key: '99d772c8e074bdd66cc3166388e79bd9cd5b22b7', class: "zonos--country-select-content" }, isEmpty && (h("zonos-text", { key: '7b5958e70d457310fb13704f9681d4002a48cd4d', class: "no-country", textColor: "gray-800" }, translate('No countries found'))), h("zonos-virtual-scroll", { key: 'ae7eb7938141016c5442553fd5b745083e23f44a', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index => {
|
|
50
50
|
const country = filteredCountries[index];
|
|
51
51
|
if (!country) {
|
|
52
52
|
return null;
|
|
@@ -8,9 +8,9 @@ export class ZonosCustomMessage {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const messageWithLinks = formatStringWithLinks(this.message);
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '096cea7d57ab1c8fca1fadf4b68f0285e0e1d3c6', class: "zonos--elements", style: {
|
|
12
12
|
'--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, this.message && (h("zonos-card", { key: '
|
|
13
|
+
} }, this.message && (h("zonos-card", { key: '2718d07d60779749b70045d9554c58d9fd88dd35', class: "zonos--custom-message", spacing: "12px" }, h("div", { key: 'd0cf15bf81ced064b50756bb950e8fa32d8afb1c', class: "zonos--flex-message" }, h("zonos-icon", { key: 'b92ab3807d532f4a267f2d3b176062221f9ea86d', "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { key: '4760b0c6c6a72457b5a8c742b091d2fc5c62b15b', innerHTML: messageWithLinks }))))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-custom-message"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|