@zonos/elements 1.3.267 → 1.3.269
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-ed2de167.js → cart-87fbbb5a.js} +129 -4
- package/dist/cjs/{debounce-606d1801.js → debounce-7990f5ea.js} +1 -1
- package/dist/cjs/{getBorderRadius-a91911e7.js → getBorderRadius-fc683d94.js} +1 -1
- package/dist/cjs/{getContrastColor-ce80dbe7.js → getContrastColor-d5134ef3.js} +2 -2
- package/dist/cjs/{hasInclusivePrice-bf31fbdb.js → hasInclusivePrice-c86ed1f5.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-542c23e7.js → invoice-952f32c4.js} +3 -3
- package/dist/cjs/{isCollectMobileTablet-fe8149a5.js → isCollectMobileTablet-1cb21c59.js} +3 -3
- package/dist/cjs/{isContrastColor-a02c4889.js → isContrastColor-76592c92.js} +1 -1
- package/dist/cjs/{isDarkColor-e317bb06.js → isDarkColor-5d6ca405.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-66d378ab.js → localization-a969f224.js} +660 -3
- package/dist/cjs/{paypal-d8282578.js → paypal-cfe1e8e9.js} +60 -18
- package/dist/cjs/{placeTestOrder-0a4b9dd7.js → placeTestOrder-613878fb.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-ac9083d9.js → renderCheckoutCurrency-5a333d29.js} +2 -2
- package/dist/cjs/{submitGtag-07a3b09e.js → submitGtag-4906b161.js} +1 -1
- package/dist/cjs/{throttle-8aebac7d.js → throttle-02c2e917.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-a9a97194.js → updateCheckoutSessionAttributes-47d73942.js} +1 -1
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +7 -7
- package/dist/cjs/zonos-address_4.cjs.entry.js +7 -7
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +8 -8
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +94 -27
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +124 -154
- package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -5
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
- package/dist/cjs/zonos-collect.cjs.entry.js +9 -9
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -47
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +7 -7
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
- package/dist/cjs/zonos-invoice.cjs.entry.js +9 -9
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/{zonos-store-credit.cjs.entry.js → zonos-policy-consent_2.cjs.entry.js} +91 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +5 -5
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-0662b95f.js → zonosStore-45a87908.js} +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +7 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +66 -12
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +103 -75
- package/dist/collection/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.css +93 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.js +93 -0
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +2 -44
- package/dist/collection/components/store/checkout/paypal.js +57 -14
- package/dist/collection/components/store/checkout/policyConsent.js +58 -0
- package/dist/collection/components/store/checkout/stripe.js +66 -0
- package/dist/collection/components/store/hello/localization.js +12 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +21 -0
- package/dist/collection/components/store/translationStore/strings.base.js +21 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +21 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +21 -0
- package/dist/collection/components/store/translationStore/strings.french.js +21 -0
- package/dist/collection/components/store/translationStore/strings.german.js +21 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +21 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +21 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -0
- package/dist/collection/components/store/zonosStore.js +1 -0
- package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +28 -0
- package/dist/collection/components/utils/checkout/removeBigcommerceCartShipping.js +83 -0
- package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +61 -0
- package/dist/collection/types/generated/graphql.internal.types.js +64 -0
- package/dist/collection/utils/toggleBigcommerceNativeCurrencySelector.js +2 -1
- package/dist/esm/{cart-49082718.js → cart-663ef7d5.js} +125 -5
- package/dist/esm/{debounce-ab526ca0.js → debounce-58e4ff3e.js} +1 -1
- package/dist/esm/{getBorderRadius-98c64be8.js → getBorderRadius-d23f47a6.js} +1 -1
- package/dist/esm/{getContrastColor-0aa643c1.js → getContrastColor-f0bd5b65.js} +2 -2
- package/dist/esm/{hasInclusivePrice-2323d514.js → hasInclusivePrice-f8bd057d.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-16c688e7.js → invoice-db7211a6.js} +3 -3
- package/dist/esm/{isCollectMobileTablet-910aea2e.js → isCollectMobileTablet-24c912b1.js} +3 -3
- package/dist/esm/{isContrastColor-6bad285e.js → isContrastColor-fbddacb6.js} +1 -1
- package/dist/esm/{isDarkColor-0a8453e7.js → isDarkColor-566f04c5.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-33a9f7ff.js → localization-dc19e8bb.js} +657 -4
- package/dist/esm/{paypal-2e9aa4ba.js → paypal-cdbe69ef.js} +60 -18
- package/dist/esm/{placeTestOrder-35c9b460.js → placeTestOrder-ba67e208.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-b84a6da7.js → renderCheckoutCurrency-fb1cbd28.js} +2 -2
- package/dist/esm/{submitGtag-ae9d5d91.js → submitGtag-c7ea1f2a.js} +1 -1
- package/dist/esm/{throttle-882b1f47.js → throttle-f09d0659.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-da7fdd37.js → updateCheckoutSessionAttributes-40e301a4.js} +1 -1
- package/dist/esm/zonos-address-display_8.entry.js +7 -7
- package/dist/esm/zonos-address_4.entry.js +7 -7
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +8 -8
- package/dist/esm/zonos-cart-items_12.entry.js +94 -27
- package/dist/esm/zonos-checkbox_2.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +113 -143
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -5
- package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
- package/dist/esm/zonos-collect.entry.js +9 -9
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +4 -47
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +7 -7
- package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
- package/dist/esm/zonos-invoice.entry.js +9 -9
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/{zonos-store-credit.entry.js → zonos-policy-consent_2.entry.js} +91 -7
- package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
- package/dist/esm/zonos-stripe-input.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-9662b071.js → zonosStore-8e19daff.js} +1 -0
- package/dist/esm-es5/cart-663ef7d5.js +1 -0
- package/dist/esm-es5/{debounce-ab526ca0.js → debounce-58e4ff3e.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-98c64be8.js → getBorderRadius-d23f47a6.js} +1 -1
- package/dist/esm-es5/{getContrastColor-0aa643c1.js → getContrastColor-f0bd5b65.js} +1 -1
- package/dist/esm-es5/{hasInclusivePrice-2323d514.js → hasInclusivePrice-f8bd057d.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-16c688e7.js → invoice-db7211a6.js} +1 -1
- package/dist/esm-es5/{isCollectMobileTablet-910aea2e.js → isCollectMobileTablet-24c912b1.js} +1 -1
- package/dist/esm-es5/{isContrastColor-6bad285e.js → isContrastColor-fbddacb6.js} +1 -1
- package/dist/esm-es5/{isDarkColor-0a8453e7.js → isDarkColor-566f04c5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-dc19e8bb.js +1 -0
- package/dist/esm-es5/{paypal-2e9aa4ba.js → paypal-cdbe69ef.js} +2 -2
- package/dist/esm-es5/{placeTestOrder-35c9b460.js → placeTestOrder-ba67e208.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-b84a6da7.js → renderCheckoutCurrency-fb1cbd28.js} +1 -1
- package/dist/esm-es5/{submitGtag-ae9d5d91.js → submitGtag-c7ea1f2a.js} +1 -1
- package/dist/esm-es5/throttle-f09d0659.js +1 -0
- package/dist/esm-es5/{updateCheckoutSessionAttributes-da7fdd37.js → updateCheckoutSessionAttributes-40e301a4.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.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_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.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-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-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-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -0
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.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-9662b071.js → zonosStore-8e19daff.js} +1 -1
- package/dist/scripts/index.d.ts +80 -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-policy-consent/zonos-policy-consent.d.ts +3 -0
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +0 -1
- package/dist/types/components/store/checkout/policyConsent.d.ts +41 -0
- package/dist/types/components/store/checkout/stripe.d.ts +13 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +21 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +9 -0
- package/dist/types/components/utils/checkout/removeBigcommerceCartShipping.d.ts +18 -0
- package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +16 -0
- package/dist/types/components.d.ts +13 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +23 -6
- package/dist/types/types/checkout/CheckoutConfig.d.ts +23 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +170 -23
- package/dist/types/types/generated/graphql.internal.types.ts +152 -23
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-90c932fd.entry.js → p-049fc407.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a8fcb71.system.entry.js → p-0581cfc9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-097d7819.js +1 -0
- package/dist/zonos-elements/{p-e850e6e7.system.entry.js → p-09d32e53.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1325bbd6.system.entry.js → p-0daed059.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-79e5a629.system.entry.js → p-0e36a7cf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6df4cc2.system.entry.js → p-134c5010.system.entry.js} +1 -1
- package/dist/zonos-elements/p-14d6542f.system.js +1 -0
- package/dist/zonos-elements/{p-0207c91e.system.js → p-18af6aaa.system.js} +1 -1
- package/dist/zonos-elements/p-1bde60d5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9a5a2043.js → p-243dda5f.js} +1 -1
- package/dist/zonos-elements/p-263d14da.system.entry.js +1 -0
- package/dist/zonos-elements/{p-6b6cfc59.system.entry.js → p-26ae4ee7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-71fb6126.entry.js → p-2afecda7.entry.js} +1 -1
- package/dist/zonos-elements/{p-458df669.js → p-2be4335f.js} +1 -1
- package/dist/zonos-elements/p-33a37c42.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d28be518.js → p-33d4be28.js} +1 -1
- package/dist/zonos-elements/{p-26c85188.entry.js → p-344a1fee.entry.js} +1 -1
- package/dist/zonos-elements/p-3b28fc76.js +1 -0
- package/dist/zonos-elements/{p-db3b101a.js → p-3dc3596b.js} +1 -1
- package/dist/zonos-elements/{p-3689821f.system.js → p-3e7ee89d.system.js} +1 -1
- package/dist/zonos-elements/{p-843ced6c.js → p-44147850.js} +1 -1
- package/dist/zonos-elements/{p-71c7a1ff.entry.js → p-488c1af1.entry.js} +1 -1
- package/dist/zonos-elements/{p-3516340a.system.entry.js → p-48ec0b61.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4af88255.entry.js +1 -0
- package/dist/zonos-elements/p-4b6e367d.system.js +1 -0
- package/dist/zonos-elements/{p-ab0b23f2.js → p-4df08fc4.js} +1 -1
- package/dist/zonos-elements/{p-0ed70279.entry.js → p-513e8278.entry.js} +1 -1
- package/dist/zonos-elements/p-52bd7be3.system.js +1 -0
- package/dist/zonos-elements/{p-deaf0e38.system.entry.js → p-536cbab5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-56711a61.js +1 -0
- package/dist/zonos-elements/{p-01497a20.entry.js → p-57b55808.entry.js} +1 -1
- package/dist/zonos-elements/p-57c3c68f.entry.js +1 -0
- package/dist/zonos-elements/{p-a49ba3ae.system.entry.js → p-5b4e5608.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1bf9a1b9.system.js → p-5d65be06.system.js} +1 -1
- package/dist/zonos-elements/{p-1957af5a.system.entry.js → p-5f92db80.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a6be4a5.entry.js → p-658ab5e2.entry.js} +1 -1
- package/dist/zonos-elements/{p-8f9e95c2.entry.js → p-680da401.entry.js} +1 -1
- package/dist/zonos-elements/{p-4f718ef9.system.js → p-699276f2.system.js} +1 -1
- package/dist/zonos-elements/{p-f3cfd8fa.js → p-701d9a7c.js} +1 -1
- package/dist/zonos-elements/{p-ce103c66.system.entry.js → p-71528303.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8570e88a.system.js → p-7662d32a.system.js} +1 -1
- package/dist/zonos-elements/{p-27061873.entry.js → p-777d396e.entry.js} +1 -1
- package/dist/zonos-elements/{p-46071125.entry.js → p-7aca66cd.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb99a625.system.js → p-7d9d2407.system.js} +1 -1
- package/dist/zonos-elements/{p-7003d093.system.entry.js → p-80df7e0b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b7e4a020.system.entry.js → p-82ce355d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e1799bc.entry.js → p-84d4f04d.entry.js} +1 -1
- package/dist/zonos-elements/{p-180d3e3d.entry.js → p-858103a0.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e0cb5b3.system.entry.js → p-882fb843.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-648f3ada.entry.js → p-889a44fc.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c89d04a.js → p-896fb969.js} +1 -1
- package/dist/zonos-elements/{p-2c854197.system.entry.js → p-8a24701c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cb966d16.system.entry.js → p-8f0bdb87.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8f817a47.system.js +18 -0
- package/dist/zonos-elements/{p-a78bc004.entry.js → p-9092f655.entry.js} +1 -1
- package/dist/zonos-elements/p-90d22087.system.js +1 -0
- package/dist/zonos-elements/{p-1ec9b3b0.entry.js → p-9377b5c2.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6db8883.entry.js → p-9799193c.entry.js} +1 -1
- package/dist/zonos-elements/{p-55fb4ea3.system.entry.js → p-98bea13e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ba9e2612.system.entry.js → p-990d1495.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-601bb27e.entry.js → p-9a509268.entry.js} +1 -1
- package/dist/zonos-elements/{p-a1bad0c3.system.entry.js → p-9ea67d63.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9f5fb332.js +1 -0
- package/dist/zonos-elements/{p-d950b0b4.entry.js → p-a237429e.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d823ea7.system.js → p-a3a79b2f.system.js} +1 -1
- package/dist/zonos-elements/p-ac8cfdc0.js +1 -0
- package/dist/zonos-elements/p-accccb9c.entry.js +1 -0
- package/dist/zonos-elements/p-b0ed0fe7.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b4b23475.entry.js → p-b35a0b1e.entry.js} +1 -1
- package/dist/zonos-elements/{p-bf5c3dd7.system.entry.js → p-b59fc3fa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-db5f6b8c.entry.js → p-ba127f51.entry.js} +1 -1
- package/dist/zonos-elements/p-bbef037c.js +1 -0
- package/dist/zonos-elements/{p-6a195559.system.js → p-bc919de1.system.js} +1 -1
- package/dist/zonos-elements/p-be64a52e.entry.js +1 -0
- package/dist/zonos-elements/{p-665bfd4f.entry.js → p-c1463da7.entry.js} +1 -1
- package/dist/zonos-elements/{p-311ba000.system.js → p-c2023a08.system.js} +1 -1
- package/dist/zonos-elements/{p-8d5f413c.system.entry.js → p-c4ef873a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c5caf47b.system.js +1 -0
- package/dist/zonos-elements/{p-baf0b24c.system.entry.js → p-c62293d5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-79f3c227.system.entry.js → p-c92a5ae5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cd34ecf2.js +1 -0
- package/dist/zonos-elements/p-cd5444b0.js +17 -0
- package/dist/zonos-elements/{p-cfb0059f.js → p-d437bc28.js} +1 -1
- package/dist/zonos-elements/p-d932973f.system.js +1 -0
- package/dist/zonos-elements/{p-28e2ac3b.entry.js → p-dae881f2.entry.js} +1 -1
- package/dist/zonos-elements/{p-087520f2.system.entry.js → p-df0c8fb6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8571f3ce.entry.js → p-df55536b.entry.js} +1 -1
- package/dist/zonos-elements/p-e05e5825.entry.js +1 -0
- package/dist/zonos-elements/{p-928291e5.entry.js → p-e548b8ec.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e6f85f0.system.js → p-f053975e.system.js} +1 -1
- package/dist/zonos-elements/{p-175c04a4.system.js → p-f5684fc2.system.js} +1 -1
- package/dist/zonos-elements/{p-22ba60f6.system.entry.js → p-fc270539.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-49082718.js +0 -1
- package/dist/esm-es5/localization-33a9f7ff.js +0 -1
- package/dist/esm-es5/throttle-882b1f47.js +0 -1
- package/dist/esm-es5/zonos-store-credit.entry.js +0 -1
- package/dist/zonos-elements/p-029be4a8.entry.js +0 -1
- package/dist/zonos-elements/p-034ab928.system.entry.js +0 -1
- package/dist/zonos-elements/p-07a76716.system.js +0 -1
- package/dist/zonos-elements/p-1f256673.entry.js +0 -1
- package/dist/zonos-elements/p-367a72bc.js +0 -1
- package/dist/zonos-elements/p-3b1b3598.system.js +0 -18
- package/dist/zonos-elements/p-40284821.system.js +0 -1
- package/dist/zonos-elements/p-4980facb.js +0 -1
- package/dist/zonos-elements/p-6987f9c9.js +0 -1
- package/dist/zonos-elements/p-6d81901a.js +0 -1
- package/dist/zonos-elements/p-703fc360.entry.js +0 -1
- package/dist/zonos-elements/p-77c2e465.system.js +0 -1
- package/dist/zonos-elements/p-84dbf474.js +0 -17
- package/dist/zonos-elements/p-9b0a6fe5.system.entry.js +0 -1
- package/dist/zonos-elements/p-adb9827c.js +0 -1
- package/dist/zonos-elements/p-b2d276e1.js +0 -1
- package/dist/zonos-elements/p-b5a26334.system.entry.js +0 -1
- package/dist/zonos-elements/p-b6a36c25.system.js +0 -1
- package/dist/zonos-elements/p-becac995.js +0 -1
- package/dist/zonos-elements/p-c9c17d08.system.entry.js +0 -1
- package/dist/zonos-elements/p-e056ae6b.entry.js +0 -1
- package/dist/zonos-elements/p-e3292be8.system.js +0 -1
- package/dist/zonos-elements/p-e5dfccd8.system.js +0 -1
- package/dist/zonos-elements/p-fb712719.entry.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { localizationStore } from "../../../store/hello/localization";
|
|
3
|
+
import { translate } from "../../../store/translationStore";
|
|
3
4
|
import { isCheckoutMobile } from "../../../utils/checkout/isCheckoutMobile";
|
|
4
5
|
import { classes } from "../../../utils/classes";
|
|
5
6
|
import { languages } from "../../../../types/ILanguage";
|
|
@@ -9,6 +10,8 @@ import ChevronDownIcon from "./assets/chevronDownIcon.svg";
|
|
|
9
10
|
import Globe from "./assets/globe.svg";
|
|
10
11
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
11
12
|
import ZonosIconDark from "./assets/zonosIconDark.svg";
|
|
13
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
14
|
+
import ZonosIconLight from "./assets/zonosIconLight.svg";
|
|
12
15
|
export class ZonosCheckoutFooter {
|
|
13
16
|
constructor() {
|
|
14
17
|
/**
|
|
@@ -37,10 +40,12 @@ export class ZonosCheckoutFooter {
|
|
|
37
40
|
const languageLabel = (_a = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
|
|
38
41
|
// reverse color when on desktop. With the coversheet backdrop, the color should be white
|
|
39
42
|
const colorDesktop = this.dataTheme === 'LIGHT' && !this.mobile ? 'gray-0' : 'gray-1000';
|
|
40
|
-
return (h(Host, { key: '
|
|
43
|
+
return (h(Host, { key: '9bf4e1fae3660eb17d04521c533f52651f9b6153', class: classes(['zonos--elements', this.isMobile && 'mobile']) }, h("div", { key: '90b473ca63321395e9fceb48b8d21d90b225c01f', class: "zonos--checkout-footer" }, h("div", { key: '4cd4d63838aae1c26df2b3513cb24f93a497705b', class: "zonos--checkout-locale-wrapper" }, h("zonos-button", { key: '2db346594fdf00329a8f4887c4d431ddedc22e40', 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" }, h("span", { key: '55332b4a8d812976333a9f14853d63c94fc2d3b4', class: "zonos--checkout-locale-label" }, languageLabel, h("zonos-icon", { key: '1c27c4b559974ebbcff5470d6fb7a2ace3e204c2', "aria-hidden": "true", class: "zonos--checkout-locale-chevron", content: ChevronDownIcon, iconColor: colorDesktop, size: 18 }))), h("div", { key: '5e87976476c7fb124c308352587643b009bda3df', class: classes([
|
|
41
44
|
'zonos--checkout-footer-dialog',
|
|
42
45
|
this.showLanguageDialog && 'zonos--checkout-footer-dialog-open',
|
|
43
|
-
]) }, h("zonos-language-select", { key: '
|
|
46
|
+
]) }, h("zonos-language-select", { key: '3ab16dc27d046bd8a0ebab4fd44ba0a10b53b0a5', handleOnClose: () => this.toggleLanguageDialog() }))), h("div", { key: '3d7e9500d281348acb8f6c64f7a792b0248b5347', class: "zonos--checkout-footer-icon-wrapper" }, h("a", { key: '8b2ba4f4d0e962d94e24b08e69ad53310050049b', href: "https://zonos.com/docs/legal/zonos-privacy-policy", rel: "noopener noreferrer", target: "_blank" }, h("zonos-text", { key: '06c700777036ef3e15b2f8586e96ccb020f06850', textColor: colorDesktop }, translate('Privacy policy'))), h("div", { key: '1af786991ea239d2b40a43de0e5b872350f8e171', class: "zonos--checkout-footer-logo" }, h("zonos-text", { key: '889819449f802936510bda4f21b1233e76853613', textColor: colorDesktop }, translate('Powered by')), h("a", { key: '1d2f3f924b78e4e8b37b1504e37a2cdb0b0bfb9b', href: "https://zonos.com", rel: "noopener noreferrer", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '2429284234ffcb51ecff0fd3a98f88bbe8c4c1c5', autoHeight: true, content: colorDesktop === 'gray-1000'
|
|
47
|
+
? ZonosIconLight
|
|
48
|
+
: ZonosIconDark, size: 108 })))))));
|
|
44
49
|
}
|
|
45
50
|
static get is() { return "zonos-checkout-footer"; }
|
|
46
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
2
|
import { cartStore, cartStoreNextStep, } from "../../../store/checkout/cart";
|
|
3
3
|
import { paypalStore } from "../../../store/checkout/paypal";
|
|
4
|
+
import { isPolicyConsentRequired, policyConsentStore, } from "../../../store/checkout/policyConsent";
|
|
4
5
|
import { storeCreditStore, storeCreditStoreCoversFullAmount, } from "../../../store/checkout/storeCredit";
|
|
5
|
-
import { stripeStore } from "../../../store/checkout/stripe";
|
|
6
|
+
import { stripeStore, stripeStoreRecordPolicyConsent, } from "../../../store/checkout/stripe";
|
|
6
7
|
import { storageStore } from "../../../store/storageStore";
|
|
7
8
|
import { translate } from "../../../store/translationStore";
|
|
8
9
|
import { zonosStore } from "../../../store/zonosStore";
|
|
@@ -67,6 +68,30 @@ export class ZonosCheckoutPayment {
|
|
|
67
68
|
}, 10);
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
71
|
+
// Block submit when the merchant requires policy consent and the buyer hasn't accepted.
|
|
72
|
+
if (isPolicyConsentRequired() && !policyConsentStore.accepted) {
|
|
73
|
+
policyConsentStore.showError = true;
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
var _a;
|
|
76
|
+
(_a = this.ele
|
|
77
|
+
.querySelector('zonos-policy-consent')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth' });
|
|
78
|
+
}, 10);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// Lock consent state for the rest of the flow so the buyer can't uncheck
|
|
82
|
+
// during the async work below (which would create a race where the
|
|
83
|
+
// metadata builder sees `accepted=false` and skips writing the consent
|
|
84
|
+
// entry). Cleared on every checkout close.
|
|
85
|
+
if (isPolicyConsentRequired()) {
|
|
86
|
+
policyConsentStore.locked = true;
|
|
87
|
+
}
|
|
88
|
+
// Persist the buyer's consent into the checkout session metadata BEFORE confirming
|
|
89
|
+
// payment, so the recorded consent is durable even if Stripe takes a while or fails.
|
|
90
|
+
// We deliberately don't block payment on a recording failure — a transient network
|
|
91
|
+
// hiccup shouldn't gate the buyer out, and the failure is logged inside the helper
|
|
92
|
+
// via `logError` for observability. The buyer's consent intent is also captured
|
|
93
|
+
// client-side via the checkbox state and `acceptedAt` timestamp.
|
|
94
|
+
await stripeStoreRecordPolicyConsent();
|
|
70
95
|
stripeStore.checkoutSettlementCurrency = currencyCode;
|
|
71
96
|
// submit google tag when the form is complete
|
|
72
97
|
submitAnalytics({
|
|
@@ -106,17 +131,46 @@ export class ZonosCheckoutPayment {
|
|
|
106
131
|
});
|
|
107
132
|
};
|
|
108
133
|
this.placeTestOrder = async () => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
// Staging "Place test order" still represents the buyer placing an order,
|
|
135
|
+
// so apply the same consent gate the real Pay button uses. Consistency
|
|
136
|
+
// matters here: merchants testing the flow should see the same blockers
|
|
137
|
+
// a real buyer would hit.
|
|
138
|
+
if (isPolicyConsentRequired() && !policyConsentStore.accepted) {
|
|
139
|
+
policyConsentStore.showError = true;
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
var _a;
|
|
142
|
+
(_a = this.ele
|
|
143
|
+
.querySelector('zonos-policy-consent')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth' });
|
|
144
|
+
}, 10);
|
|
115
145
|
return;
|
|
116
146
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
147
|
+
const consentWasRequired = isPolicyConsentRequired();
|
|
148
|
+
if (consentWasRequired) {
|
|
149
|
+
policyConsentStore.locked = true;
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
this.internalContinueLoading = true;
|
|
153
|
+
// Don't block the test order on a consent-record failure — failure is logged
|
|
154
|
+
// inside the helper and surfaced in Vercel logs for observability.
|
|
155
|
+
await stripeStoreRecordPolicyConsent();
|
|
156
|
+
const { errors } = await placeTestOrder();
|
|
157
|
+
if (errors.length) {
|
|
158
|
+
this.stagingOrderCreateErrorMessage =
|
|
159
|
+
errors[0] || 'Failed to create staging order. Please try again.';
|
|
160
|
+
this.internalContinueLoading = false;
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.internalContinueLoading = false;
|
|
164
|
+
// continue to the next step
|
|
165
|
+
cartStoreNextStep();
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
// Release the consent lock on every terminal exit so a failed test order
|
|
169
|
+
// doesn't leave the checkbox stuck disabled in the merchant's staging UI.
|
|
170
|
+
if (consentWasRequired) {
|
|
171
|
+
policyConsentStore.locked = false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
120
174
|
};
|
|
121
175
|
}
|
|
122
176
|
continueLoadingWatcher() {
|
|
@@ -155,7 +209,7 @@ export class ZonosCheckoutPayment {
|
|
|
155
209
|
const theme = this.isMobile
|
|
156
210
|
? zonosStore.appearance.theme
|
|
157
211
|
: themeBasedColor;
|
|
158
|
-
return (h(Fragment, null, this.stagingOrderCreateErrorMessage && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), h("zonos-empty-state-payment", { emptyStateText: translate('No payment method needed for staging'), theme: theme }), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
|
|
212
|
+
return (h(Fragment, null, this.stagingOrderCreateErrorMessage && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), h("zonos-empty-state-payment", { emptyStateText: translate('No payment method needed for staging'), theme: theme }), h("zonos-policy-consent", null), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
|
|
159
213
|
void this.placeTestOrder();
|
|
160
214
|
}, size: "lg",
|
|
161
215
|
// use primary type when on mobile mode
|
|
@@ -164,7 +218,7 @@ export class ZonosCheckoutPayment {
|
|
|
164
218
|
return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
|
|
165
219
|
translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), cartStore.customerAuthenticationToken &&
|
|
166
220
|
storeCreditStore.availableBalance != null &&
|
|
167
|
-
storeCreditStore.availableBalance > 0 && (h("zonos-store-credit", null)), storeCreditCoversFullOrder ? (h("zonos-banner", { intent: "info" }, translate('Store credit covers your full order'))) : (h("zonos-payment", null)), h("div", { class: "zonos--group-btn" }, (!isPaypalTabSelected || storeCreditCoversFullOrder) && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
221
|
+
storeCreditStore.availableBalance > 0 && (h("zonos-store-credit", null)), storeCreditCoversFullOrder ? (h("zonos-banner", { intent: "info" }, translate('Store credit covers your full order'))) : (h("zonos-payment", null)), h("zonos-policy-consent", null), h("div", { class: "zonos--group-btn" }, (!isPaypalTabSelected || storeCreditCoversFullOrder) && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
168
222
|
stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
|
|
169
223
|
stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
|
|
170
224
|
if (!cartStore.checkoutSession) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
2
|
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreOnChange, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
3
|
import { paypalInitScript, paypalStore, paypalStoreHasPaypalEnabled, } from "../../store/checkout/paypal";
|
|
4
|
+
import { isPolicyConsentRequired, policyConsentStore, policyConsentStoreReset, } from "../../store/checkout/policyConsent";
|
|
4
5
|
import { storeCreditStoreApplyCredit, storeCreditStoreCoversFullAmount, storeCreditStoreCreateOrder, storeCreditStoreGetEffectiveAmount, } from "../../store/checkout/storeCredit";
|
|
5
6
|
import { getCheckoutSessionBody, initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetPaymentIntent, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStoreOnChange, stripeStorePrefetchLandedCost, stripeStoreReset, stripeStoreRetrievePayment, stripeStoreUpdateCheckoutSessionBaseCurrency, } from "../../store/checkout/stripe";
|
|
6
7
|
import { localizationStore, localizationStoreOnChange, } from "../../store/hello/localization";
|
|
@@ -562,6 +563,12 @@ export class ZonosCheckout {
|
|
|
562
563
|
// reset cart store if it's not preview mode and only when checkout is in the finish step.
|
|
563
564
|
cartStoreReset();
|
|
564
565
|
}
|
|
566
|
+
// Clear policy consent on every close (not just finish) so a buyer who
|
|
567
|
+
// checked the box mid-flow and then closed can't carry the prior
|
|
568
|
+
// acceptance into a new attempt without a fresh checkbox click.
|
|
569
|
+
if (!this.preview) {
|
|
570
|
+
policyConsentStoreReset();
|
|
571
|
+
}
|
|
565
572
|
// reset step to customer info
|
|
566
573
|
cartStore.step = 'customer-info';
|
|
567
574
|
// reset the tab item, so that user needs to click on Continue button to re-quote the landed cost if needed.
|
|
@@ -1390,77 +1397,104 @@ export class ZonosCheckout {
|
|
|
1390
1397
|
stripeStore.shouldRenderPayInUsdButton &&
|
|
1391
1398
|
!this.payInUsdConfirmDialogOpen) {
|
|
1392
1399
|
this.payInUsdConfirmDialogOpen = true;
|
|
1400
|
+
// Don't unlock consent here — the USD-confirm dialog is mid-flow; the
|
|
1401
|
+
// lock should hold until the user resolves the dialog and we re-enter.
|
|
1393
1402
|
return;
|
|
1394
1403
|
}
|
|
1395
1404
|
// Close the dialog after the user confirms to proceed with the payment in USD
|
|
1396
1405
|
this.payInUsdConfirmDialogOpen = false;
|
|
1397
|
-
//
|
|
1398
|
-
|
|
1399
|
-
//
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
// reset inventory check message
|
|
1403
|
-
cartStore.inventoryCheckErrorMessage = null;
|
|
1404
|
-
// Attempt to change settlement currency to USD
|
|
1405
|
-
const baseCurrencyUpdateSuccess = await stripeStoreUpdateCheckoutSessionBaseCurrency();
|
|
1406
|
-
// Should not proceed to confirm payment if base currency update failed
|
|
1407
|
-
if (!baseCurrencyUpdateSuccess) {
|
|
1408
|
-
stripeStore.hasPaymentError = true;
|
|
1409
|
-
stripeStore.customErrorMessage = translate('Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.', {
|
|
1410
|
-
currency: stripeStore.checkoutSettlementCurrency,
|
|
1411
|
-
});
|
|
1412
|
-
this.submitLoading = false;
|
|
1413
|
-
return;
|
|
1414
|
-
}
|
|
1406
|
+
// Track whether consent was required at the start of this flow so we know
|
|
1407
|
+
// whether to release the lock in `finally`. The store reset on checkout
|
|
1408
|
+
// close will catch any stragglers, but releasing here lets the buyer
|
|
1409
|
+
// recover (uncheck / retry) when an async step aborts.
|
|
1410
|
+
const consentWasRequired = isPolicyConsentRequired();
|
|
1415
1411
|
try {
|
|
1416
|
-
//
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
//
|
|
1422
|
-
cartStore.inventoryCheckErrorMessage =
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
this.submitLoading = false;
|
|
1428
|
-
return;
|
|
1429
|
-
}
|
|
1430
|
-
// Apply store credit if customer has selected an amount
|
|
1431
|
-
const storeCreditAmount = storeCreditStoreGetEffectiveAmount();
|
|
1432
|
-
if (storeCreditAmount > 0) {
|
|
1433
|
-
const storeCreditResult = await storeCreditStoreApplyCredit();
|
|
1434
|
-
if (!storeCreditResult.success) {
|
|
1412
|
+
// reset paypal error message
|
|
1413
|
+
paypalStore.paypalErrorMessage = null;
|
|
1414
|
+
// reset error state
|
|
1415
|
+
stripeStore.hasPaymentError = false;
|
|
1416
|
+
this.submitLoading = true;
|
|
1417
|
+
// reset inventory check message
|
|
1418
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
1419
|
+
// Attempt to change settlement currency to USD
|
|
1420
|
+
const baseCurrencyUpdateSuccess = await stripeStoreUpdateCheckoutSessionBaseCurrency();
|
|
1421
|
+
// Should not proceed to confirm payment if base currency update failed
|
|
1422
|
+
if (!baseCurrencyUpdateSuccess) {
|
|
1435
1423
|
stripeStore.hasPaymentError = true;
|
|
1436
|
-
stripeStore.customErrorMessage =
|
|
1437
|
-
|
|
1438
|
-
|
|
1424
|
+
stripeStore.customErrorMessage = translate('Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.', {
|
|
1425
|
+
currency: stripeStore.checkoutSettlementCurrency,
|
|
1426
|
+
});
|
|
1439
1427
|
this.submitLoading = false;
|
|
1440
1428
|
return;
|
|
1441
1429
|
}
|
|
1442
|
-
}
|
|
1443
|
-
// If store credit covers the full order, create order directly without payment
|
|
1444
|
-
if (storeCreditStoreCoversFullAmount()) {
|
|
1445
1430
|
try {
|
|
1446
|
-
//
|
|
1447
|
-
|
|
1448
|
-
|
|
1431
|
+
// check inventory before proceeding to payment
|
|
1432
|
+
cartStore.inventoryCheckErrorMessage =
|
|
1433
|
+
await stripeStoreHandleInventoryCheck();
|
|
1434
|
+
}
|
|
1435
|
+
catch (_a) {
|
|
1436
|
+
// If user provide callback and it throw an exception, default to this message and stop the payment.
|
|
1437
|
+
cartStore.inventoryCheckErrorMessage = translate('Unable to check inventory. Please try again.');
|
|
1438
|
+
}
|
|
1439
|
+
// Don't proceed to payment if there's an error message
|
|
1440
|
+
if (cartStore.inventoryCheckErrorMessage) {
|
|
1441
|
+
// stop the submit loading state
|
|
1442
|
+
this.submitLoading = false;
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
// Apply store credit if customer has selected an amount
|
|
1446
|
+
const storeCreditAmount = storeCreditStoreGetEffectiveAmount();
|
|
1447
|
+
if (storeCreditAmount > 0) {
|
|
1448
|
+
const storeCreditResult = await storeCreditStoreApplyCredit();
|
|
1449
|
+
if (!storeCreditResult.success) {
|
|
1449
1450
|
stripeStore.hasPaymentError = true;
|
|
1450
|
-
stripeStore.customErrorMessage =
|
|
1451
|
+
stripeStore.customErrorMessage =
|
|
1452
|
+
storeCreditResult.error ||
|
|
1453
|
+
translate('Unable to apply store credit. Please try again.');
|
|
1451
1454
|
this.submitLoading = false;
|
|
1452
1455
|
return;
|
|
1453
1456
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1457
|
+
}
|
|
1458
|
+
// If store credit covers the full order, create order directly without payment
|
|
1459
|
+
if (storeCreditStoreCoversFullAmount()) {
|
|
1460
|
+
try {
|
|
1461
|
+
// Validate checkout session (landed cost ID, etc.) before creating order
|
|
1462
|
+
const checkoutSessionStatus = await validateCheckoutSession();
|
|
1463
|
+
if (!checkoutSessionStatus.valid) {
|
|
1464
|
+
stripeStore.hasPaymentError = true;
|
|
1465
|
+
stripeStore.customErrorMessage = checkoutSessionStatus.errorMessage;
|
|
1466
|
+
this.submitLoading = false;
|
|
1467
|
+
return;
|
|
1468
|
+
}
|
|
1469
|
+
const orderResult = await storeCreditStoreCreateOrder();
|
|
1470
|
+
if (!orderResult.success) {
|
|
1471
|
+
stripeStore.hasPaymentError = true;
|
|
1472
|
+
stripeStore.customErrorMessage =
|
|
1473
|
+
orderResult.error ||
|
|
1474
|
+
translate('Unable to place order with store credit. Please try again.');
|
|
1475
|
+
this.submitLoading = false;
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
cartStoreNextStep();
|
|
1479
|
+
cartStoreClearCheckoutInterval();
|
|
1480
|
+
}
|
|
1481
|
+
catch (err) {
|
|
1482
|
+
logError(err);
|
|
1483
|
+
submitAnalytics({
|
|
1484
|
+
event: 'zonos-checkout-payment-fail',
|
|
1485
|
+
metadata: {
|
|
1486
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
1487
|
+
},
|
|
1488
|
+
});
|
|
1456
1489
|
stripeStore.hasPaymentError = true;
|
|
1457
|
-
stripeStore.customErrorMessage =
|
|
1458
|
-
orderResult.error ||
|
|
1459
|
-
translate('Unable to place order with store credit. Please try again.');
|
|
1460
|
-
this.submitLoading = false;
|
|
1461
|
-
return;
|
|
1462
1490
|
}
|
|
1491
|
+
this.submitLoading = false;
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
try {
|
|
1495
|
+
await stripeStoreConfirmPayment();
|
|
1463
1496
|
cartStoreNextStep();
|
|
1497
|
+
// clear the checkout session timeout timer when purchase is complete
|
|
1464
1498
|
cartStoreClearCheckoutInterval();
|
|
1465
1499
|
}
|
|
1466
1500
|
catch (err) {
|
|
@@ -1472,32 +1506,22 @@ export class ZonosCheckout {
|
|
|
1472
1506
|
},
|
|
1473
1507
|
});
|
|
1474
1508
|
stripeStore.hasPaymentError = true;
|
|
1509
|
+
// should request inventory refund if there's an error during payment
|
|
1510
|
+
if (stripeStore.shouldInventoryRefund) {
|
|
1511
|
+
void stripeStoreHandleInventoryRefund();
|
|
1512
|
+
stripeStore.shouldInventoryRefund = false;
|
|
1513
|
+
}
|
|
1475
1514
|
}
|
|
1476
1515
|
this.submitLoading = false;
|
|
1477
|
-
return;
|
|
1478
1516
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
//
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
catch (err) {
|
|
1486
|
-
logError(err);
|
|
1487
|
-
submitAnalytics({
|
|
1488
|
-
event: 'zonos-checkout-payment-fail',
|
|
1489
|
-
metadata: {
|
|
1490
|
-
checkoutSessionId: storageStore.checkoutSessionId,
|
|
1491
|
-
},
|
|
1492
|
-
});
|
|
1493
|
-
stripeStore.hasPaymentError = true;
|
|
1494
|
-
// should request inventory refund if there's an error during payment
|
|
1495
|
-
if (stripeStore.shouldInventoryRefund) {
|
|
1496
|
-
void stripeStoreHandleInventoryRefund();
|
|
1497
|
-
stripeStore.shouldInventoryRefund = false;
|
|
1517
|
+
finally {
|
|
1518
|
+
// Release the consent lock on every terminal exit (success or failure)
|
|
1519
|
+
// so the buyer can re-toggle / retry. On success the cart advances and
|
|
1520
|
+
// the close-handler reset would clean this up anyway.
|
|
1521
|
+
if (consentWasRequired) {
|
|
1522
|
+
policyConsentStore.locked = false;
|
|
1498
1523
|
}
|
|
1499
1524
|
}
|
|
1500
|
-
this.submitLoading = false;
|
|
1501
1525
|
}
|
|
1502
1526
|
async handleFinishClick() {
|
|
1503
1527
|
// reset stripe store
|
|
@@ -1509,6 +1533,8 @@ export class ZonosCheckout {
|
|
|
1509
1533
|
}
|
|
1510
1534
|
// reset cart store
|
|
1511
1535
|
cartStoreReset();
|
|
1536
|
+
// reset policy consent so the next checkout starts un-accepted
|
|
1537
|
+
policyConsentStoreReset();
|
|
1512
1538
|
// redirect to vendor store url if this is legacy checkout.
|
|
1513
1539
|
if (window.Zonos.isLegacyCheckout && window.Zonos.cartData) {
|
|
1514
1540
|
const storeBaseUrl = window.Zonos.cartData.storeBaseUrl ||
|
|
@@ -1710,6 +1736,8 @@ export class ZonosCheckout {
|
|
|
1710
1736
|
stripeStoreReset();
|
|
1711
1737
|
// reset cart store
|
|
1712
1738
|
cartStoreReset();
|
|
1739
|
+
// reset policy consent
|
|
1740
|
+
policyConsentStoreReset();
|
|
1713
1741
|
// cleanup onChange listener
|
|
1714
1742
|
this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
|
|
1715
1743
|
window.removeEventListener('message', this.handleHostedOpenWindowCallback);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: normal;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
font-family: var(--zonos--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: block;
|
|
36
|
+
margin-top: 20px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.zonos--policy-consent {
|
|
40
|
+
background-color: var(--zonos-elements-gray-50);
|
|
41
|
+
border: 1px solid var(--zonos-elements-gray-200);
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
padding: 12px 14px;
|
|
44
|
+
transition: border-color 0.15s ease, background-color 0.15s ease;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.zonos--policy-consent:hover {
|
|
48
|
+
border-color: var(--zonos-elements-gray-300);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.zonos--policy-consent--error {
|
|
52
|
+
background-color: var(--zonos-elements-red-50);
|
|
53
|
+
border-color: var(--zonos-elements-red-400);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.zonos--policy-consent-label {
|
|
57
|
+
align-items: center;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 10px;
|
|
61
|
+
user-select: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.zonos--policy-consent-checkbox {
|
|
65
|
+
accent-color: var(--zonos-elements-blue-600);
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
height: 18px;
|
|
69
|
+
margin: 0;
|
|
70
|
+
width: 18px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.zonos--policy-consent-text {
|
|
74
|
+
color: var(--zonos-elements-gray-800);
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
line-height: 1.45;
|
|
77
|
+
}
|
|
78
|
+
.zonos--policy-consent-text a {
|
|
79
|
+
color: var(--zonos-elements-blue-600);
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
text-underline-offset: 2px;
|
|
82
|
+
}
|
|
83
|
+
.zonos--policy-consent-text a:hover {
|
|
84
|
+
color: var(--zonos-elements-blue-700);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.zonos--policy-consent-error {
|
|
88
|
+
color: var(--zonos-elements-red-600);
|
|
89
|
+
font-size: 13px;
|
|
90
|
+
line-height: 1.4;
|
|
91
|
+
margin-top: 8px;
|
|
92
|
+
padding: 0 4px;
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Fragment, h, Host } from "@stencil/core";
|
|
2
|
+
import { getEnabledPolicies, policyConsentStore, } from "../../../store/checkout/policyConsent";
|
|
3
|
+
import { localizationStore } from "../../../store/hello/localization";
|
|
4
|
+
import { translate } from "../../../store/translationStore";
|
|
5
|
+
import { zonosStore } from "../../../store/zonosStore";
|
|
6
|
+
const POLICIES_SENTINEL = 'POLICIES';
|
|
7
|
+
export class ZonosPolicyConsent {
|
|
8
|
+
render() {
|
|
9
|
+
const policies = getEnabledPolicies();
|
|
10
|
+
if (!policies.length) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
// Build the locale-aware joined list ("X, Y, and Z" in English, equivalent in other locales).
|
|
14
|
+
const ListFormatCtor = Intl
|
|
15
|
+
.ListFormat;
|
|
16
|
+
const parts = ListFormatCtor
|
|
17
|
+
? new ListFormatCtor(localizationStore.selectedLocale, {
|
|
18
|
+
style: 'long',
|
|
19
|
+
type: 'conjunction',
|
|
20
|
+
}).formatToParts(policies.map(p => p.name))
|
|
21
|
+
: // Fallback for environments without Intl.ListFormat: simple ", "-joined list.
|
|
22
|
+
policies.flatMap((p, idx) => idx === 0
|
|
23
|
+
? [{ type: 'element', value: p.name }]
|
|
24
|
+
: [
|
|
25
|
+
{ type: 'literal', value: ', ' },
|
|
26
|
+
{ type: 'element', value: p.name },
|
|
27
|
+
]);
|
|
28
|
+
const listNodes = parts.map(part => {
|
|
29
|
+
if (part.type === 'literal') {
|
|
30
|
+
return part.value;
|
|
31
|
+
}
|
|
32
|
+
// 'element' part — match back to the policy by name to recover its URL.
|
|
33
|
+
const policy = policies.find(p => p.name === part.value);
|
|
34
|
+
if (!policy) {
|
|
35
|
+
return part.value;
|
|
36
|
+
}
|
|
37
|
+
return (h("a", { href: policy.url,
|
|
38
|
+
// Prevent the surrounding <label> from also activating the checkbox
|
|
39
|
+
// when the link is clicked — `stopPropagation` alone doesn't suppress
|
|
40
|
+
// the label's default behavior in every browser. We explicitly open
|
|
41
|
+
// the URL ourselves and call `preventDefault` to swallow the click.
|
|
42
|
+
onClick: (event) => {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
window.open(policy.url, '_blank', 'noopener,noreferrer');
|
|
46
|
+
}, rel: "noopener noreferrer", target: "_blank" }, part.value));
|
|
47
|
+
});
|
|
48
|
+
// Use the merchant-name template when an org name is available, falling back to the generic
|
|
49
|
+
// phrasing otherwise so we never render a stray apostrophe (e.g. " 's Terms...").
|
|
50
|
+
// Reads from `zonosStore` so this works when consumed via the npm package
|
|
51
|
+
// (where `window.Zonos.cartSettings` may not be populated).
|
|
52
|
+
const merchantName = zonosStore.organizationName;
|
|
53
|
+
const template = merchantName
|
|
54
|
+
? translate("I agree to [merchantName]'s [policies]", {
|
|
55
|
+
merchantName,
|
|
56
|
+
policies: POLICIES_SENTINEL,
|
|
57
|
+
})
|
|
58
|
+
: translate('I agree to the [policies]', {
|
|
59
|
+
policies: POLICIES_SENTINEL,
|
|
60
|
+
});
|
|
61
|
+
const [before = '', after = ''] = template.split(POLICIES_SENTINEL);
|
|
62
|
+
const showError = policyConsentStore.showError;
|
|
63
|
+
const errorId = 'zonos--policy-consent-error';
|
|
64
|
+
return (h(Host, { class: "zonos--policy-consent-host" }, h("div", { class: `zonos--policy-consent${showError ? ' zonos--policy-consent--error' : ''}` }, h("label", { class: "zonos--policy-consent-label" }, h("input", { "aria-describedby": showError ? errorId : undefined, "aria-invalid": showError ? 'true' : 'false', checked: policyConsentStore.accepted, class: "zonos--policy-consent-checkbox", disabled: policyConsentStore.locked, onChange: (event) => {
|
|
65
|
+
const isChecked = event.target.checked;
|
|
66
|
+
policyConsentStore.accepted = isChecked;
|
|
67
|
+
if (isChecked) {
|
|
68
|
+
// Snapshot the timestamp at the moment of acceptance so later
|
|
69
|
+
// session-metadata updates don't drift it forward.
|
|
70
|
+
if (!policyConsentStore.acceptedAt) {
|
|
71
|
+
policyConsentStore.acceptedAt = new Date().toISOString();
|
|
72
|
+
}
|
|
73
|
+
policyConsentStore.showError = false;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// If the buyer un-checks, the prior acceptance is no longer valid.
|
|
77
|
+
policyConsentStore.acceptedAt = null;
|
|
78
|
+
}
|
|
79
|
+
}, type: "checkbox" }), h("span", { class: "zonos--policy-consent-text" }, before, h(Fragment, null, listNodes), after))), showError && (h("div", { class: "zonos--policy-consent-error", id: errorId, role: "alert" }, translate('You must accept the policies to place this order')))));
|
|
80
|
+
}
|
|
81
|
+
static get is() { return "zonos-policy-consent"; }
|
|
82
|
+
static get encapsulation() { return "shadow"; }
|
|
83
|
+
static get originalStyleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["zonos-policy-consent.scss"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get styleUrls() {
|
|
89
|
+
return {
|
|
90
|
+
"$": ["zonos-policy-consent.css"]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|