@zonos/elements 1.3.38 → 1.3.40
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-c7212410.js → cart-775440b7.js} +240 -7
- package/dist/cjs/{getBorderRadius-074b46ef.js → getBorderRadius-9ae7890c.js} +1 -1
- package/dist/cjs/{index-b071017b.js → index-ef8b2c76.js} +234 -167
- package/dist/cjs/index.cjs.js +10 -4
- package/dist/cjs/{isDarkColor-371a3b1a.js → isDarkColor-5f56770b.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/paypal-25c84e33.js +461 -0
- package/dist/cjs/{submitGtag-7a679d92.js → sendErrorLog-7818b288.js} +2 -19
- package/dist/cjs/zonos-address_8.cjs.entry.js +8 -8
- package/dist/cjs/zonos-badge_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +73 -35
- package/dist/cjs/zonos-checkout.cjs.entry.js +50 -70
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +15 -15
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +5 -5
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- 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_2.cjs.entry.js → zonos-notification_3.cjs.entry.js} +59 -7
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/cjs/{zonosStore-4c6c85da.js → zonosStore-b6c72408.js} +5 -1
- package/dist/collection/__tests__/build-utils/urlCheckOne.js +3 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +39 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +37 -22
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +37 -60
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +1 -0
- package/dist/collection/components/main/zonos-controller.js +22 -8
- package/dist/collection/components/paypal/zonos-paypal-payment.css +37 -0
- package/dist/collection/components/paypal/zonos-paypal-payment.js +92 -0
- package/dist/collection/components/store/checkout/cart.js +26 -1
- package/dist/collection/components/store/checkout/paypal.js +219 -0
- package/dist/collection/components/store/checkout/stripe.js +16 -4
- package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
- package/dist/collection/components/store/translationStore/strings.base.js +9 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
- package/dist/collection/components/store/translationStore/strings.french.js +9 -0
- package/dist/collection/components/store/translationStore/strings.german.js +9 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
- package/dist/collection/components/store/zonosStore.js +4 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -3
- package/dist/collection/components/utils/api/getZonosSettings.js +3 -3
- package/dist/collection/components/utils/api/paypalCaptureOrder.js +8 -0
- package/dist/collection/components/utils/api/paypalCreateOrder.js +8 -0
- package/dist/collection/components/utils/getContrastColor.js +6 -2
- package/dist/collection/components/utils/handleFetch.js +6 -1
- package/dist/collection/components/utils/isContrastColor.js +7 -0
- package/dist/collection/environment.js +4 -5
- package/dist/collection/scripts/_getZonosQaUrl.js +4 -0
- package/dist/collection/scripts/_zonosBase.js +2 -0
- package/dist/collection/styles/stripe/addressRuleStyle.js +6 -0
- package/dist/collection/types/generated/graphql.customer.types.js +35 -0
- package/dist/esm/{cart-eb75b113.js → cart-e9cd8286.js} +236 -8
- package/dist/esm/{getBorderRadius-947c24de.js → getBorderRadius-3c75c4c1.js} +1 -1
- package/dist/esm/{index-3b46f3c3.js → index-5a37ccde.js} +234 -167
- package/dist/esm/index.js +10 -4
- package/dist/esm/{isDarkColor-f8324c10.js → isDarkColor-3eb31a6d.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/paypal-da2b3db1.js +453 -0
- package/dist/esm/{submitGtag-0bc0baa0.js → sendErrorLog-2fcf78a2.js} +3 -19
- package/dist/esm/zonos-address_8.entry.js +8 -8
- package/dist/esm/zonos-badge_2.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +4 -4
- package/dist/esm/zonos-card.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +60 -22
- package/dist/esm/zonos-checkout.entry.js +41 -61
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +15 -15
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_3.entry.js +5 -5
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +5 -5
- package/dist/esm/zonos-input.entry.js +3 -3
- 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_2.entry.js → zonos-notification_3.entry.js} +60 -9
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm/{zonosStore-ba9e541e.js → zonosStore-425abc1b.js} +5 -1
- package/dist/esm-es5/cart-e9cd8286.js +1 -0
- package/dist/esm-es5/{getBorderRadius-947c24de.js → getBorderRadius-3c75c4c1.js} +1 -1
- package/dist/esm-es5/index-5a37ccde.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-f8324c10.js → isDarkColor-3eb31a6d.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/paypal-da2b3db1.js +17 -0
- package/dist/esm-es5/sendErrorLog-2fcf78a2.js +1 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.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_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.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_3.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 -0
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-ba9e541e.js → zonosStore-425abc1b.js} +1 -1
- package/dist/scripts/index.d.ts +91 -6
- 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 +2 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +8 -4
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -20
- package/dist/types/components/main/zonos-controller.d.ts +6 -0
- package/dist/types/components/paypal/zonos-paypal-payment.d.ts +17 -0
- package/dist/types/components/store/checkout/cart.d.ts +19 -1
- package/dist/types/components/store/checkout/paypal.d.ts +28 -0
- package/dist/types/components/store/checkout/stripe.d.ts +10 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +4 -0
- package/dist/types/components/utils/api/getZonosSettings.d.ts +2 -0
- package/dist/types/components/utils/api/paypalCaptureOrder.d.ts +10 -0
- package/dist/types/components/utils/api/paypalCreateOrder.d.ts +9 -0
- package/dist/types/components/utils/handleFetch.d.ts +4 -0
- package/dist/types/components/utils/isContrastColor.d.ts +4 -0
- package/dist/types/components.d.ts +50 -6
- package/dist/types/scripts/_zonosBase.d.ts +9 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -10
- package/dist/types/types/checkout/CheckoutConfig.d.ts +14 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +71 -11
- package/dist/types/types/generated/graphql.customer.types.ts +103 -11
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-ed333de6.system.entry.js → p-01bd2187.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f06bb776.system.entry.js → p-14b53e8f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-15ecad81.entry.js +1 -0
- package/dist/zonos-elements/p-1b499bcc.system.js +1 -0
- package/dist/zonos-elements/{p-d2992457.system.entry.js → p-1daa3b1e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-085548f2.entry.js → p-1debb7b2.entry.js} +1 -1
- package/dist/zonos-elements/{p-9de374a7.system.entry.js → p-2bfb5e4b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-01304a58.system.entry.js → p-2c03ac78.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3447ef24.system.js +17 -0
- package/dist/zonos-elements/{p-699a5376.entry.js → p-3496183d.entry.js} +1 -1
- package/dist/zonos-elements/{p-59f37de3.entry.js → p-36df9785.entry.js} +1 -1
- package/dist/zonos-elements/p-3996d025.system.js +1 -0
- package/dist/zonos-elements/p-3b6a7200.entry.js +1 -0
- package/dist/zonos-elements/p-3d98f422.system.entry.js +1 -0
- package/dist/zonos-elements/{p-31b3d26b.js → p-3da1bc42.js} +1 -1
- package/dist/zonos-elements/{p-a21ec316.system.entry.js → p-445fb353.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3541e6dd.entry.js → p-54101ed6.entry.js} +1 -1
- package/dist/zonos-elements/p-54971a77.system.js +1 -0
- package/dist/zonos-elements/{p-c0fcc0fa.system.entry.js → p-5a5d1a12.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c21802e9.entry.js → p-5e55dcbc.entry.js} +1 -1
- package/dist/zonos-elements/{p-71882ac9.system.entry.js → p-5f68f356.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-73ba4398.system.entry.js → p-61842b4f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3523c3b4.entry.js → p-657be9e9.entry.js} +1 -1
- package/dist/zonos-elements/p-6897be29.entry.js +1 -0
- package/dist/zonos-elements/{p-3f5e2e5c.system.entry.js → p-6f39051c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-966ab4e7.system.entry.js → p-70b024ad.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-22882fd6.entry.js → p-71037fe5.entry.js} +1 -1
- package/dist/zonos-elements/p-7dd54a63.entry.js +1 -0
- package/dist/zonos-elements/{p-e3c014ae.entry.js → p-7f96d3b4.entry.js} +1 -1
- package/dist/zonos-elements/p-800db524.system.js +1 -0
- package/dist/zonos-elements/{p-9a1c0d02.js → p-890f5788.js} +1 -1
- package/dist/zonos-elements/{p-62ed4236.entry.js → p-8d149b99.entry.js} +1 -1
- package/dist/zonos-elements/p-916adba7.entry.js +1 -0
- package/dist/zonos-elements/{p-5821856c.js → p-92bebe7a.js} +1 -1
- package/dist/zonos-elements/p-94279862.system.js +1 -0
- package/dist/zonos-elements/{p-b903af96.system.entry.js → p-97dadd90.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e37440ad.system.js → p-b2007124.system.js} +1 -1
- package/dist/zonos-elements/p-b55b557a.system.js +2 -0
- package/dist/zonos-elements/{p-18b28104.entry.js → p-bfa5ec2b.entry.js} +1 -1
- package/dist/zonos-elements/p-c55a5fe4.system.entry.js +1 -0
- package/dist/zonos-elements/p-c5a5512a.system.entry.js +1 -0
- package/dist/zonos-elements/p-c87113fb.system.entry.js +1 -0
- package/dist/zonos-elements/p-ca58f16e.system.entry.js +1 -0
- package/dist/zonos-elements/{p-6c3390b7.entry.js → p-d46fa40a.entry.js} +1 -1
- package/dist/zonos-elements/p-d6135575.js +1 -0
- package/dist/zonos-elements/p-d95cb86a.system.js +1 -0
- package/dist/zonos-elements/{p-d8c1eb99.entry.js → p-d9d5ee2f.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a45c837.system.entry.js → p-da15b587.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8acdf43b.system.entry.js → p-dc6a17fe.system.entry.js} +1 -1
- package/dist/zonos-elements/p-dd61b7a0.js +2 -0
- package/dist/zonos-elements/p-e252d86f.entry.js +1 -0
- package/dist/zonos-elements/{p-da2e5289.system.entry.js → p-e6efc2e1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-63a27875.entry.js → p-efdc7748.entry.js} +1 -1
- package/dist/zonos-elements/{p-2aa72606.entry.js → p-f643035f.entry.js} +1 -1
- package/dist/zonos-elements/p-f98f7066.js +17 -0
- package/dist/zonos-elements/{p-9d29f3f4.system.entry.js → p-fa02dd07.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c3619b3d.entry.js → p-fa95c3dc.entry.js} +1 -1
- package/dist/zonos-elements/p-fb63bd03.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/loader/cdn.js +1 -2
- package/loader/index.cjs.js +1 -2
- package/loader/index.d.ts +3 -0
- package/loader/index.es2017.js +1 -2
- package/loader/index.js +1 -2
- package/package.json +12 -11
- package/dist/esm-es5/cart-eb75b113.js +0 -1
- package/dist/esm-es5/index-3b46f3c3.js +0 -2
- package/dist/esm-es5/submitGtag-0bc0baa0.js +0 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +0 -1
- package/dist/zonos-elements/p-02405211.system.entry.js +0 -1
- package/dist/zonos-elements/p-0b538ed4.system.js +0 -1
- package/dist/zonos-elements/p-357322ea.system.entry.js +0 -1
- package/dist/zonos-elements/p-467f934c.system.entry.js +0 -1
- package/dist/zonos-elements/p-53acc999.js +0 -1
- package/dist/zonos-elements/p-548ac127.entry.js +0 -1
- package/dist/zonos-elements/p-5609876a.system.entry.js +0 -1
- package/dist/zonos-elements/p-57617755.entry.js +0 -1
- package/dist/zonos-elements/p-6f9448bb.entry.js +0 -1
- package/dist/zonos-elements/p-70262120.system.js +0 -1
- package/dist/zonos-elements/p-878293fe.js +0 -1
- package/dist/zonos-elements/p-a8b934c2.entry.js +0 -1
- package/dist/zonos-elements/p-a8cb25de.system.js +0 -1
- package/dist/zonos-elements/p-abe8ea12.system.js +0 -1
- package/dist/zonos-elements/p-ad37d20e.system.js +0 -1
- package/dist/zonos-elements/p-ae04d3ff.entry.js +0 -1
- package/dist/zonos-elements/p-b684f8aa.system.entry.js +0 -1
- package/dist/zonos-elements/p-ce347974.js +0 -2
- package/dist/zonos-elements/p-d99232c5.system.js +0 -2
- package/dist/zonos-elements/p-e0bf9666.system.js +0 -1
- package/dist/zonos-elements/p-e1db1bc9.entry.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
|
-
import { cartStore, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
|
-
import {
|
|
2
|
+
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
|
+
import { paypalInitScript } from "../../store/checkout/paypal";
|
|
4
|
+
import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
|
|
4
5
|
import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
|
|
5
6
|
import { translate } from "../../store/translationStore";
|
|
6
7
|
import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
|
|
@@ -62,7 +63,6 @@ export class ZonosCheckout {
|
|
|
62
63
|
this.open = this.forceDialogOpen;
|
|
63
64
|
this.stripe = window.Zonos.stripe;
|
|
64
65
|
this.submitLoading = false;
|
|
65
|
-
this.paymentError = false;
|
|
66
66
|
this.collapseReviewMobile = true;
|
|
67
67
|
this.isAttachError = false;
|
|
68
68
|
this.isMobile = false;
|
|
@@ -72,8 +72,6 @@ export class ZonosCheckout {
|
|
|
72
72
|
this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
|
|
73
73
|
this.isLegacyCheckout = false;
|
|
74
74
|
this.confirmDialogOpen = false;
|
|
75
|
-
this.showSessionTimoutScreen = false;
|
|
76
|
-
this.checkoutTimeoutInterval = null;
|
|
77
75
|
this.inventoryCheckErrorMessage = null;
|
|
78
76
|
}
|
|
79
77
|
/**
|
|
@@ -115,7 +113,7 @@ export class ZonosCheckout {
|
|
|
115
113
|
// reset the tab item, so that user needs to click on Continue button to re-quote the landed cost if needed.
|
|
116
114
|
cartStoreResetTabItems();
|
|
117
115
|
// clear the checkout session timeout timer when checkout dialog close action is triggered
|
|
118
|
-
|
|
116
|
+
cartStoreClearCheckoutInterval();
|
|
119
117
|
/**
|
|
120
118
|
* Trigger callback when the checkout is closed
|
|
121
119
|
*/
|
|
@@ -148,30 +146,6 @@ export class ZonosCheckout {
|
|
|
148
146
|
await this.applyStripeTheme();
|
|
149
147
|
return true;
|
|
150
148
|
}
|
|
151
|
-
clearCheckoutTimeoutInterval() {
|
|
152
|
-
if (this.checkoutTimeoutInterval) {
|
|
153
|
-
clearTimeout(this.checkoutTimeoutInterval);
|
|
154
|
-
this.checkoutTimeoutInterval = null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
startCheckoutTimeoutInterval() {
|
|
158
|
-
// do nothing if in preview mode
|
|
159
|
-
if (this.preview) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const timeoutQuery = new URLSearchParams(window.location.search).get('zonosCheckoutTimeout');
|
|
163
|
-
const timeout =
|
|
164
|
-
// timeout query is mainly for testing purpose
|
|
165
|
-
timeoutQuery && !isNaN(parseInt(timeoutQuery, 10))
|
|
166
|
-
? parseInt(timeoutQuery, 10)
|
|
167
|
-
: CHECKOUT_SESSION_TIMEOUT;
|
|
168
|
-
log(`==START CHECKOUT TIMEOUT - ${timeout}==`);
|
|
169
|
-
// start a timer to validate the price
|
|
170
|
-
this.checkoutTimeoutInterval = setTimeout(() => {
|
|
171
|
-
// Show session timeout alert
|
|
172
|
-
this.showSessionTimoutScreen = true;
|
|
173
|
-
}, timeout);
|
|
174
|
-
}
|
|
175
149
|
reloadCheckoutSession() {
|
|
176
150
|
window.location.reload();
|
|
177
151
|
}
|
|
@@ -191,6 +165,9 @@ export class ZonosCheckout {
|
|
|
191
165
|
// do nothing if event is already attached
|
|
192
166
|
return;
|
|
193
167
|
}
|
|
168
|
+
log(`attached event to button ${buttonAnchorSelector}`, 'info', {
|
|
169
|
+
button,
|
|
170
|
+
});
|
|
194
171
|
button.addEventListener('click', async (e) => {
|
|
195
172
|
// do nothing if it's not shippable country
|
|
196
173
|
if (!isShippableCountry()) {
|
|
@@ -209,7 +186,10 @@ export class ZonosCheckout {
|
|
|
209
186
|
throw new Error('Error building cart');
|
|
210
187
|
}
|
|
211
188
|
// start the timer to validate the price
|
|
212
|
-
|
|
189
|
+
cartStoreStartCheckoutInterval({
|
|
190
|
+
isPreview: this.preview,
|
|
191
|
+
sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
|
|
192
|
+
});
|
|
213
193
|
submitGtag('zonos-checkout-start');
|
|
214
194
|
void trackConversionEvent('checkout_open');
|
|
215
195
|
}
|
|
@@ -223,6 +203,10 @@ export class ZonosCheckout {
|
|
|
223
203
|
title: translate('Error creating Checkout'),
|
|
224
204
|
});
|
|
225
205
|
}
|
|
206
|
+
}, {
|
|
207
|
+
// Trigger this event before any other event
|
|
208
|
+
capture: true,
|
|
209
|
+
passive: false,
|
|
226
210
|
});
|
|
227
211
|
if (!zonosStore.checkoutSettings.disablePlaceOrderButtonActivation) {
|
|
228
212
|
button.removeAttribute('disabled');
|
|
@@ -372,6 +356,10 @@ export class ZonosCheckout {
|
|
|
372
356
|
const interval = setInterval(() => {
|
|
373
357
|
if (cartStore.landedCostData || !stripeStore.isFetchingLandedCost) {
|
|
374
358
|
if (cartStore.landedCostData) {
|
|
359
|
+
// start init paypal with the presentment currency when landed cost is fetched
|
|
360
|
+
void paypalInitScript({
|
|
361
|
+
currency: cartStore.currency,
|
|
362
|
+
});
|
|
375
363
|
// only go to next step if landed cost data is ready
|
|
376
364
|
cartStoreNextStep();
|
|
377
365
|
}
|
|
@@ -390,41 +378,31 @@ export class ZonosCheckout {
|
|
|
390
378
|
}
|
|
391
379
|
handleInventoryCheckDialogCancel() {
|
|
392
380
|
// reset inventory check message to close the inventory check alert
|
|
393
|
-
|
|
381
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
394
382
|
}
|
|
395
383
|
handleInventoryCheckDialogConfirm() {
|
|
396
384
|
// reset inventory check message to close the inventory check alert
|
|
397
|
-
|
|
385
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
398
386
|
// close the dialog
|
|
399
387
|
void this.closeDialogHandler({ confirmed: true });
|
|
400
388
|
}
|
|
401
|
-
|
|
402
|
-
* Handle inventory check and returns error message if the callback provided.
|
|
403
|
-
*/
|
|
404
|
-
async handleInventoryCheck() {
|
|
405
|
-
const { onInventoryCheck } = zonosStore.checkoutSettings;
|
|
406
|
-
if (typeof onInventoryCheck !== 'function') {
|
|
407
|
-
return null;
|
|
408
|
-
}
|
|
409
|
-
const message = await onInventoryCheck({ items: cartStore.items });
|
|
410
|
-
return message;
|
|
411
|
-
}
|
|
412
|
-
async handleCheckoutPaymentContinue() {
|
|
389
|
+
async handleStripePaymentContinue() {
|
|
413
390
|
// reset error state
|
|
414
|
-
|
|
391
|
+
stripeStore.hasPaymentError = false;
|
|
415
392
|
this.submitLoading = true;
|
|
416
393
|
// reset inventory check message
|
|
417
|
-
|
|
394
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
418
395
|
try {
|
|
419
396
|
// check inventory before proceeding to payment
|
|
420
|
-
|
|
397
|
+
cartStore.inventoryCheckErrorMessage =
|
|
398
|
+
await stripeStoreHandleInventoryCheck();
|
|
421
399
|
}
|
|
422
400
|
catch (err) {
|
|
423
401
|
// If user provide callback and it throw an exception, default to this message and stop the payment.
|
|
424
|
-
|
|
402
|
+
cartStore.inventoryCheckErrorMessage = translate('Unable to check inventory. Please try again.');
|
|
425
403
|
}
|
|
426
404
|
// Don't proceed to payment if there's an error message
|
|
427
|
-
if (
|
|
405
|
+
if (cartStore.inventoryCheckErrorMessage) {
|
|
428
406
|
// stop the submit loading state
|
|
429
407
|
this.submitLoading = false;
|
|
430
408
|
return;
|
|
@@ -433,11 +411,11 @@ export class ZonosCheckout {
|
|
|
433
411
|
await stripeStoreConfirmPayment();
|
|
434
412
|
cartStoreNextStep();
|
|
435
413
|
// clear the checkout session timeout timer when purchase is complete
|
|
436
|
-
|
|
414
|
+
cartStoreClearCheckoutInterval();
|
|
437
415
|
}
|
|
438
416
|
catch (err) {
|
|
439
417
|
logError(err);
|
|
440
|
-
|
|
418
|
+
stripeStore.hasPaymentError = true;
|
|
441
419
|
}
|
|
442
420
|
this.submitLoading = false;
|
|
443
421
|
}
|
|
@@ -553,14 +531,16 @@ export class ZonosCheckout {
|
|
|
553
531
|
this.isMobile ? '--zonos-elements-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
|
|
554
532
|
};
|
|
555
533
|
const renderContent = () => {
|
|
556
|
-
if (
|
|
534
|
+
if (cartStore.checkoutSessionTimeoutShow) {
|
|
557
535
|
return (h("zonos-rest-state", { class: "zonos--session-timeout", restStateSubtitle: translate('Your checkout session has expired. Please reload the page to continue.'), restStateTitle: translate('Session timed out'), restStateType: 'Warning' }, h("zonos-button", { onClick: () => this.reloadCheckoutSession(), variant: "primary" }, translate('Reload'))));
|
|
558
536
|
}
|
|
559
537
|
return (h("div", { class: 'zonos--content', style: {
|
|
560
538
|
'--border-radius': getBorderRadius({ overrideBorderStyle: style }),
|
|
561
539
|
} }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
|
|
562
540
|
'--primary-color': !this.isMobile ? colorPrimary : '',
|
|
563
|
-
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked:
|
|
541
|
+
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: async () => {
|
|
542
|
+
await this.handleStripePaymentContinue();
|
|
543
|
+
}, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
564
544
|
// do nothing if it's not mobile
|
|
565
545
|
if (!this.isMobile) {
|
|
566
546
|
return;
|
|
@@ -589,9 +569,9 @@ export class ZonosCheckout {
|
|
|
589
569
|
// Mark user selected confirm to close the dialog
|
|
590
570
|
onConfirmClicked: () => this.closeDialogHandler({ confirmed: true }) }), h("zonos-confirm-dialog", { class: "zonos--inventory-check-failure-dialog", dialogConfirmBtnText: translate('Return to cart'), dialogIntent: "danger",
|
|
591
571
|
// Show dialog if inventory check error message is not null
|
|
592
|
-
dialogOpen: !!
|
|
572
|
+
dialogOpen: !!cartStore.inventoryCheckErrorMessage,
|
|
593
573
|
// If diallog is in open state, the message should not be null
|
|
594
|
-
dialogSubtitle:
|
|
574
|
+
dialogSubtitle: cartStore.inventoryCheckErrorMessage, dialogTitle: translate("Couldn't place order"), dialogType: "alert", onCancelClicked: () => {
|
|
595
575
|
this.handleInventoryCheckDialogCancel();
|
|
596
576
|
},
|
|
597
577
|
// Mark user selected confirm to close the dialog
|
|
@@ -720,7 +700,6 @@ export class ZonosCheckout {
|
|
|
720
700
|
"open": {},
|
|
721
701
|
"stripe": {},
|
|
722
702
|
"submitLoading": {},
|
|
723
|
-
"paymentError": {},
|
|
724
703
|
"collapseReviewMobile": {},
|
|
725
704
|
"isAttachError": {},
|
|
726
705
|
"isMobile": {},
|
|
@@ -730,8 +709,6 @@ export class ZonosCheckout {
|
|
|
730
709
|
"legacyCheckoutHiddenBtnSelector": {},
|
|
731
710
|
"isLegacyCheckout": {},
|
|
732
711
|
"confirmDialogOpen": {},
|
|
733
|
-
"showSessionTimoutScreen": {},
|
|
734
|
-
"checkoutTimeoutInterval": {},
|
|
735
712
|
"inventoryCheckErrorMessage": {}
|
|
736
713
|
};
|
|
737
714
|
}
|
|
@@ -791,7 +768,7 @@ export class ZonosCheckout {
|
|
|
791
768
|
"PaymentIntent": {
|
|
792
769
|
"location": "import",
|
|
793
770
|
"path": "@stripe/stripe-js",
|
|
794
|
-
"id": ""
|
|
771
|
+
"id": "node_modules::PaymentIntent"
|
|
795
772
|
}
|
|
796
773
|
},
|
|
797
774
|
"return": "Promise<void>"
|
|
@@ -93,22 +93,22 @@ export class ZonosController {
|
|
|
93
93
|
// running with scope async function to avoid blocking the main thread
|
|
94
94
|
(async () => {
|
|
95
95
|
var _a, _b;
|
|
96
|
-
const { errors, json } = await getZonosSettings();
|
|
96
|
+
const { errors, json, zonosMode } = await getZonosSettings();
|
|
97
97
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
98
98
|
log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
// init zonos notification
|
|
102
102
|
this.initZonosNotification();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
103
|
+
// override subscription status
|
|
104
|
+
const config = Object.assign(Object.assign({}, this.config), { checkoutSettings: this.config.checkoutSettings
|
|
105
|
+
? Object.assign(Object.assign({}, this.config.checkoutSettings), { subscriptionStatus: undefined }) : undefined });
|
|
107
106
|
// load default setting if fail to load user setting
|
|
108
107
|
zonosStoreInitSetting({
|
|
109
108
|
overrideSettings: config,
|
|
110
109
|
zonosSettings: json,
|
|
111
110
|
});
|
|
111
|
+
zonosStore.zonosMode = zonosMode;
|
|
112
112
|
// setup google font after store loaded
|
|
113
113
|
void this.setupGoogleFont();
|
|
114
114
|
if (zonosStore.helloSettings) {
|
|
@@ -136,7 +136,6 @@ export class ZonosController {
|
|
|
136
136
|
this.stripeInitEvent.emit({
|
|
137
137
|
publishableKey: publishableKey.token,
|
|
138
138
|
});
|
|
139
|
-
log('zonos controller loaded');
|
|
140
139
|
})();
|
|
141
140
|
}
|
|
142
141
|
/**
|
|
@@ -187,7 +186,7 @@ export class ZonosController {
|
|
|
187
186
|
zonosStore.organizationName = organizationName;
|
|
188
187
|
}
|
|
189
188
|
render() {
|
|
190
|
-
return h(Host, { key: '
|
|
189
|
+
return h(Host, { key: '4d1ae97e6273df35aeab31462394a189c17090b6', class: "zonos--elements" });
|
|
191
190
|
}
|
|
192
191
|
static get is() { return "zonos-controller"; }
|
|
193
192
|
static get encapsulation() { return "shadow"; }
|
|
@@ -245,6 +244,21 @@ export class ZonosController {
|
|
|
245
244
|
}
|
|
246
245
|
static get events() {
|
|
247
246
|
return [{
|
|
247
|
+
"method": "paypalInitEvent",
|
|
248
|
+
"name": "paypalInitEvent",
|
|
249
|
+
"bubbles": true,
|
|
250
|
+
"cancelable": true,
|
|
251
|
+
"composed": true,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": "Event emitted to initialize paypal"
|
|
255
|
+
},
|
|
256
|
+
"complexType": {
|
|
257
|
+
"original": "{ paypalClientId: string }",
|
|
258
|
+
"resolved": "{ paypalClientId: string; }",
|
|
259
|
+
"references": {}
|
|
260
|
+
}
|
|
261
|
+
}, {
|
|
248
262
|
"method": "stripeInitEvent",
|
|
249
263
|
"name": "stripeInitEvent",
|
|
250
264
|
"bubbles": true,
|
|
@@ -279,7 +293,7 @@ export class ZonosController {
|
|
|
279
293
|
"Stripe": {
|
|
280
294
|
"location": "import",
|
|
281
295
|
"path": "@stripe/stripe-js",
|
|
282
|
-
"id": ""
|
|
296
|
+
"id": "node_modules::Stripe"
|
|
283
297
|
}
|
|
284
298
|
},
|
|
285
299
|
"return": "Promise<void>"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: var(--font-family, Inter), Inter;
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: normal;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
font-family: var(--font-family, Inter), Inter;
|
|
8
|
+
}
|
|
9
|
+
:host img {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
}
|
|
12
|
+
:host dl,
|
|
13
|
+
:host dd,
|
|
14
|
+
:host h1,
|
|
15
|
+
:host h2,
|
|
16
|
+
:host h3,
|
|
17
|
+
:host h4,
|
|
18
|
+
:host h5,
|
|
19
|
+
:host h6,
|
|
20
|
+
:host hr,
|
|
21
|
+
:host figure,
|
|
22
|
+
:host p,
|
|
23
|
+
:host pre {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* All sets of variable are here */
|
|
28
|
+
/* smooth font rendering */
|
|
29
|
+
:host {
|
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { h, Host, } from "@stencil/core";
|
|
3
|
+
import { paypalStoreInitButtons } from "../store/checkout/paypal";
|
|
4
|
+
import { log } from "../utils/logging/log";
|
|
5
|
+
/**
|
|
6
|
+
* This component is a wrapper for the paypal authentication element that would render default style object
|
|
7
|
+
*/
|
|
8
|
+
export class ZonosPaypalPayment {
|
|
9
|
+
async loadPaypal() {
|
|
10
|
+
if (!window.Zonos.paypal) {
|
|
11
|
+
log('Paypal is not available');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// Init paypal store buttons
|
|
15
|
+
const paypalButtons = paypalStoreInitButtons({
|
|
16
|
+
onPaypalFail: () => {
|
|
17
|
+
log('onPaypalFail');
|
|
18
|
+
this.paypalSessionFail.emit();
|
|
19
|
+
},
|
|
20
|
+
onPaypalSessionDone: ({ orderId }) => {
|
|
21
|
+
log('onPaypalSessionDone', 'info', { orderId });
|
|
22
|
+
this.paypalSessionDone.emit({ orderId });
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
if (!(paypalButtons === null || paypalButtons === void 0 ? void 0 : paypalButtons.length)) {
|
|
26
|
+
log('There are no paypal buttons available');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const container = this.el.querySelector('.zonos--payment-paypal-container');
|
|
30
|
+
if (!container) {
|
|
31
|
+
log('Cannot find container element for paypal buttons');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// render paypal buttons
|
|
35
|
+
paypalButtons.forEach(async (paypalButton) => {
|
|
36
|
+
await paypalButton.render(container);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
componentDidLoad() {
|
|
40
|
+
// @Watch doesn't get trigger on initial load
|
|
41
|
+
void this.loadPaypal();
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h(Host, { key: '036a9d43da99e1c08293936d89ca5f97d5acdf10', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: 'f38290dce670024e001d8219d2d8d1e9fde1f9e2', class: "zonos--payment-paypal-container" })));
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "zonos-paypal-payment"; }
|
|
47
|
+
static get encapsulation() { return "scoped"; }
|
|
48
|
+
static get originalStyleUrls() {
|
|
49
|
+
return {
|
|
50
|
+
"$": ["zonos-paypal-payment.scss"]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static get styleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["zonos-paypal-payment.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get events() {
|
|
59
|
+
return [{
|
|
60
|
+
"method": "paypalSessionDone",
|
|
61
|
+
"name": "paypalSessionDone",
|
|
62
|
+
"bubbles": true,
|
|
63
|
+
"cancelable": true,
|
|
64
|
+
"composed": true,
|
|
65
|
+
"docs": {
|
|
66
|
+
"tags": [],
|
|
67
|
+
"text": "Event to emit when the paypal session is done"
|
|
68
|
+
},
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "{ orderId: string }",
|
|
71
|
+
"resolved": "{ orderId: string; }",
|
|
72
|
+
"references": {}
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
"method": "paypalSessionFail",
|
|
76
|
+
"name": "paypalSessionFail",
|
|
77
|
+
"bubbles": true,
|
|
78
|
+
"cancelable": true,
|
|
79
|
+
"composed": true,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": "Event to emit when the paypal session is failed"
|
|
83
|
+
},
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "void",
|
|
86
|
+
"resolved": "void",
|
|
87
|
+
"references": {}
|
|
88
|
+
}
|
|
89
|
+
}];
|
|
90
|
+
}
|
|
91
|
+
static get elementRef() { return "el"; }
|
|
92
|
+
}
|
|
@@ -8,11 +8,14 @@ import { log } from "../../utils/logging/log";
|
|
|
8
8
|
import { logError } from "../../utils/logging/logError";
|
|
9
9
|
const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
10
10
|
checkoutSessionId: sessionStorage.getItem('zonos--checkout-session-id') || null,
|
|
11
|
+
checkoutSessionTimeoutShow: false,
|
|
12
|
+
checkoutTimeoutInterval: null,
|
|
11
13
|
currency: 'USD',
|
|
12
14
|
doneSteps: [],
|
|
13
15
|
dutiesTaxFees: 0,
|
|
14
16
|
error: null,
|
|
15
17
|
exchangeRate: null,
|
|
18
|
+
inventoryCheckErrorMessage: null,
|
|
16
19
|
isSelectedShippingAboveDeminimis: false,
|
|
17
20
|
isSelectedShippingGuarantee: false,
|
|
18
21
|
items: [],
|
|
@@ -219,6 +222,28 @@ onChange('checkoutSessionId', () => {
|
|
|
219
222
|
}
|
|
220
223
|
sessionStorage.setItem('zonos--checkout-session-id', cartStore.checkoutSessionId);
|
|
221
224
|
});
|
|
225
|
+
const cartStoreStartCheckoutInterval = ({ isPreview, sessionTimeout, }) => {
|
|
226
|
+
// do nothing if in preview mode
|
|
227
|
+
if (isPreview) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const timeoutQuery = new URLSearchParams(window.location.search).get('zonosCheckoutTimeout');
|
|
231
|
+
const timeout =
|
|
232
|
+
// timeout query is mainly for testing purpose
|
|
233
|
+
timeoutQuery && !isNaN(parseInt(timeoutQuery, 10))
|
|
234
|
+
? parseInt(timeoutQuery, 10)
|
|
235
|
+
: sessionTimeout;
|
|
236
|
+
log(`==START CHECKOUT TIMEOUT - ${timeout}==`);
|
|
237
|
+
cartStore.checkoutTimeoutInterval = setTimeout(() => {
|
|
238
|
+
cartStore.checkoutSessionTimeoutShow = true;
|
|
239
|
+
}, timeout);
|
|
240
|
+
};
|
|
241
|
+
const cartStoreClearCheckoutInterval = () => {
|
|
242
|
+
if (cartStore.checkoutTimeoutInterval) {
|
|
243
|
+
clearTimeout(cartStore.checkoutTimeoutInterval);
|
|
244
|
+
cartStore.checkoutTimeoutInterval = null;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
222
247
|
const getCartItemToUse = (items) => items.map(item => (Object.assign(Object.assign({}, item), { isRestricted: false })));
|
|
223
248
|
const cartStoreResetCartItems = () => {
|
|
224
249
|
// mark all items as not restricted
|
|
@@ -276,4 +301,4 @@ const cartStoreResetTabItems = () => {
|
|
|
276
301
|
cartStore.tabItems = Object.assign(Object.assign({}, cartStore.tabItems), { 'customer-info': Object.assign(Object.assign({}, cartStore.tabItems['customer-info']), { isDone: false }), payment: Object.assign(Object.assign({}, cartStore.tabItems.payment), { isDone: false }), shipping: Object.assign(Object.assign({}, cartStore.tabItems.shipping), { isDone: false }) });
|
|
277
302
|
cartStoreResetSelectedShippingOption();
|
|
278
303
|
};
|
|
279
|
-
export { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStoreGetShippingTransitInfo, cartStoreHasOneEligibleItem, cartStoreNextStep, cartStoreReCalculateTotal, cartStoreReset, cartStoreResetCartItems, cartStoreResetTabItems, cartStoreUpdateItems, cartStoreUpdateSelectedShippingOption, cartStoreUpdateToErrorState, };
|
|
304
|
+
export { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStoreClearCheckoutInterval, cartStoreGetShippingTransitInfo, cartStoreHasOneEligibleItem, cartStoreNextStep, cartStoreReCalculateTotal, cartStoreReset, cartStoreResetCartItems, cartStoreResetTabItems, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateSelectedShippingOption, cartStoreUpdateToErrorState, };
|