@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
|
@@ -15,6 +15,7 @@ import { getHelloWidgetSize } from "../../utils/hello/getHelloWidgetSize";
|
|
|
15
15
|
import { getProductsOnPage } from "../../utils/hello/getProductsOnPage";
|
|
16
16
|
import { getZCountryUrlParam } from "../../utils/hello/getZCountryUrlParam";
|
|
17
17
|
import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
|
|
18
|
+
import { shouldShowHelloWidget } from "../../utils/hello/shouldShowHelloWidget";
|
|
18
19
|
import { log } from "../../utils/logging/log";
|
|
19
20
|
import { mergeConfig } from "../../utils/mergeConfig";
|
|
20
21
|
const PEEK_MESSAGE_CLOSE_DELAY_MS = 3000;
|
|
@@ -203,49 +204,6 @@ export class ZonosHello {
|
|
|
203
204
|
return hasMoreSpaceOnRight;
|
|
204
205
|
}
|
|
205
206
|
};
|
|
206
|
-
this.shouldRenderHello = (showLog = true) => {
|
|
207
|
-
var _a, _b;
|
|
208
|
-
if (!localizationStore.localizationLoaded) {
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
const { countryDisplayRules, showForCountries } = zonosStore.helloSettings;
|
|
212
|
-
const visibilityRules = countryDisplayRules === null || countryDisplayRules === void 0 ? void 0 : countryDisplayRules.widgetVisibility;
|
|
213
|
-
const selectedCountry = localizationStore.selectedCountryCode;
|
|
214
|
-
// Resolve behavior: deprecated showForCountries overrides widgetVisibility.behavior
|
|
215
|
-
// If showForCountries is an array of country codes, treat as legacy explicit list
|
|
216
|
-
const behavior = Array.isArray(showForCountries)
|
|
217
|
-
? showForCountries
|
|
218
|
-
: (showForCountries !== null && showForCountries !== void 0 ? showForCountries : visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.behavior);
|
|
219
|
-
if (showLog && !localizationStore.isShippableCountry) {
|
|
220
|
-
log(`Hello: not shippable country - Show for countries: ${behavior}`);
|
|
221
|
-
}
|
|
222
|
-
// Legacy: explicit list of country codes from deprecated showForCountries
|
|
223
|
-
if (Array.isArray(behavior)) {
|
|
224
|
-
return !!selectedCountry && behavior.includes(selectedCountry);
|
|
225
|
-
}
|
|
226
|
-
// Determine base visibility from behavior
|
|
227
|
-
let isVisible;
|
|
228
|
-
if (behavior === 'ALL') {
|
|
229
|
-
isVisible = true;
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
// Default: ONLY_SHIPPABLE
|
|
233
|
-
isVisible = localizationStore.isShippableCountry;
|
|
234
|
-
}
|
|
235
|
-
// Apply includedCountries — force show the widget for these countries
|
|
236
|
-
if (!isVisible &&
|
|
237
|
-
selectedCountry &&
|
|
238
|
-
((_a = visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.includedCountries) === null || _a === void 0 ? void 0 : _a.includes(selectedCountry))) {
|
|
239
|
-
isVisible = true;
|
|
240
|
-
}
|
|
241
|
-
// Apply excludedCountries — force hide the widget for these countries
|
|
242
|
-
if (isVisible &&
|
|
243
|
-
selectedCountry &&
|
|
244
|
-
((_b = visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.excludedCountries) === null || _b === void 0 ? void 0 : _b.includes(selectedCountry))) {
|
|
245
|
-
isVisible = false;
|
|
246
|
-
}
|
|
247
|
-
return isVisible;
|
|
248
|
-
};
|
|
249
207
|
}
|
|
250
208
|
showDialogHandler(showDialog) {
|
|
251
209
|
var _a;
|
|
@@ -421,7 +379,7 @@ export class ZonosHello {
|
|
|
421
379
|
// The organization name can be changed after init with the updateOrganizationName method.
|
|
422
380
|
// This will cause the element to rerender with the new org name when it changes. (used for preview on dashboard)
|
|
423
381
|
this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
|
|
424
|
-
const showHello =
|
|
382
|
+
const showHello = shouldShowHelloWidget() && !!selectedCountryCode;
|
|
425
383
|
// If the condition for rendering Hello is met, set the toggle to true to trigger callback, should only trigger once
|
|
426
384
|
if (showHello && !this.isHelloWidgetRendered) {
|
|
427
385
|
this.handleHelloWidgetInitializedState({
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { loadScript, } from "@paypal/paypal-js";
|
|
2
2
|
import { createStore } from "@stencil/store";
|
|
3
3
|
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, } from "./cart";
|
|
4
|
+
import { isPolicyConsentRequired, policyConsentStore, } from "./policyConsent";
|
|
4
5
|
import { storeCreditStoreApplyCredit, storeCreditStoreCoversFullAmount, storeCreditStoreCreateOrder, storeCreditStoreGetEffectiveAmount, } from "./storeCredit";
|
|
5
|
-
import { stripeStore, stripeStoreHandleInventoryCheck, } from "./stripe";
|
|
6
|
+
import { stripeStore, stripeStoreHandleInventoryCheck, stripeStoreRecordPolicyConsent, } from "./stripe";
|
|
6
7
|
import { storageStore } from "../storageStore";
|
|
7
8
|
import { translate } from "../translationStore";
|
|
8
9
|
import { zonosStore } from "../zonosStore";
|
|
@@ -81,6 +82,7 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
81
82
|
});
|
|
82
83
|
return {
|
|
83
84
|
createOrder: async () => {
|
|
85
|
+
var _a;
|
|
84
86
|
// Clicking on the paypal button should trigger the paymentInfoCompleted event
|
|
85
87
|
void trackConversionEvent({
|
|
86
88
|
checkoutSessionId,
|
|
@@ -89,22 +91,42 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
89
91
|
paymentMethod: 'paypal',
|
|
90
92
|
},
|
|
91
93
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
event: 'zonos-checkout-payment-fail',
|
|
100
|
-
metadata: {
|
|
101
|
-
checkoutSessionId,
|
|
102
|
-
},
|
|
103
|
-
});
|
|
94
|
+
// Block PayPal submit when the merchant requires policy consent and the
|
|
95
|
+
// buyer hasn't accepted. Mirrors the Pay-button gate so both flows enforce
|
|
96
|
+
// the same legal contract.
|
|
97
|
+
if (isPolicyConsentRequired() && !policyConsentStore.accepted) {
|
|
98
|
+
policyConsentStore.showError = true;
|
|
99
|
+
(_a = document
|
|
100
|
+
.querySelector('zonos-policy-consent')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth' });
|
|
104
101
|
onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
|
|
105
102
|
return '';
|
|
106
103
|
}
|
|
104
|
+
// Lock consent for the rest of the flow so the buyer can't uncheck during
|
|
105
|
+
// the async PayPal handshake and create a race against the metadata writer.
|
|
106
|
+
// The `try/finally` below clears the lock on any non-success exit so the
|
|
107
|
+
// checkbox doesn't stay disabled when validation / inventory / store
|
|
108
|
+
// credit aborts before an order is actually created.
|
|
109
|
+
const consentRequired = isPolicyConsentRequired();
|
|
110
|
+
if (consentRequired) {
|
|
111
|
+
policyConsentStore.locked = true;
|
|
112
|
+
}
|
|
113
|
+
let handedOffToPayPal = false;
|
|
107
114
|
try {
|
|
115
|
+
const checkoutSessionStatus = await validateCheckoutSession();
|
|
116
|
+
if (!checkoutSessionStatus.valid) {
|
|
117
|
+
paypalStore.paypalErrorMessage = checkoutSessionStatus.errorMessage;
|
|
118
|
+
// reset stripe error message
|
|
119
|
+
stripeStore.hasPaymentError = false;
|
|
120
|
+
stripeStore.customErrorMessage = null;
|
|
121
|
+
submitAnalytics({
|
|
122
|
+
event: 'zonos-checkout-payment-fail',
|
|
123
|
+
metadata: {
|
|
124
|
+
checkoutSessionId,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
|
|
128
|
+
return '';
|
|
129
|
+
}
|
|
108
130
|
// reset paypal error banner
|
|
109
131
|
paypalStore.paypalErrorMessage = null;
|
|
110
132
|
// reset inventory check error message
|
|
@@ -114,7 +136,7 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
114
136
|
cartStore.inventoryCheckErrorMessage =
|
|
115
137
|
await stripeStoreHandleInventoryCheck();
|
|
116
138
|
}
|
|
117
|
-
catch (
|
|
139
|
+
catch (_b) {
|
|
118
140
|
// If user provide callback and it throw an exception, default to this message and stop the payment.
|
|
119
141
|
cartStore.inventoryCheckErrorMessage = translate('Unable to check inventory. Please try again.');
|
|
120
142
|
}
|
|
@@ -134,6 +156,13 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
134
156
|
return '';
|
|
135
157
|
}
|
|
136
158
|
}
|
|
159
|
+
// Persist consent into the checkout session metadata BEFORE either
|
|
160
|
+
// branch creates the order — both the store-credit-only path and the
|
|
161
|
+
// real PayPal path need the consent recorded. A transient failure here
|
|
162
|
+
// is logged (via `logError` inside the helper) but does NOT block the
|
|
163
|
+
// order: blocking on a flaky network would gate buyers from paying,
|
|
164
|
+
// and the buyer's consent intent is already captured client-side.
|
|
165
|
+
await stripeStoreRecordPolicyConsent();
|
|
137
166
|
// If store credit covers the full order, create order directly
|
|
138
167
|
if (storeCreditStoreCoversFullAmount()) {
|
|
139
168
|
const orderResult = await storeCreditStoreCreateOrder();
|
|
@@ -147,11 +176,18 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
147
176
|
onPaypalSessionDone === null || onPaypalSessionDone === void 0 ? void 0 : onPaypalSessionDone({ orderId: orderResult.orderId || '' });
|
|
148
177
|
cartStoreNextStep();
|
|
149
178
|
cartStoreClearCheckoutInterval();
|
|
179
|
+
// Store-credit-only success: the cart advances to the next step
|
|
180
|
+
// and the store reset on close will handle the lock cleanup.
|
|
181
|
+
handedOffToPayPal = true;
|
|
150
182
|
return '';
|
|
151
183
|
}
|
|
152
184
|
const paypalOrderId = await paypalStoreCreaterOrder({
|
|
153
185
|
checkoutSessionId,
|
|
154
186
|
});
|
|
187
|
+
// Successful hand-off to PayPal — the popup opens next and onApprove
|
|
188
|
+
// will fire on completion. Keep the lock set so closes/resets later
|
|
189
|
+
// clean up; an empty ID falls through to the unlock in `finally`.
|
|
190
|
+
handedOffToPayPal = !!paypalOrderId;
|
|
155
191
|
return paypalOrderId;
|
|
156
192
|
}
|
|
157
193
|
catch (err) {
|
|
@@ -170,6 +206,13 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
170
206
|
onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
|
|
171
207
|
return '';
|
|
172
208
|
}
|
|
209
|
+
finally {
|
|
210
|
+
// Clear the lock unless we successfully handed off the order — on
|
|
211
|
+
// failures the buyer needs to be able to uncheck and retry.
|
|
212
|
+
if (consentRequired && !handedOffToPayPal) {
|
|
213
|
+
policyConsentStore.locked = false;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
173
216
|
},
|
|
174
217
|
onApprove: async (_, _actions) => {
|
|
175
218
|
try {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createStore } from "@stencil/store";
|
|
2
|
+
import { translate } from "../translationStore";
|
|
3
|
+
import { zonosStore } from "../zonosStore";
|
|
4
|
+
const POLICY_ORDER = [
|
|
5
|
+
'termsAndConditions',
|
|
6
|
+
'privacyPolicy',
|
|
7
|
+
'refundPolicy',
|
|
8
|
+
'shippingPolicy',
|
|
9
|
+
'warrantyPolicy',
|
|
10
|
+
];
|
|
11
|
+
// Reuses the lowercase `'Privacy policy'` key already translated in 19 locales
|
|
12
|
+
// (also used by the checkout footer) — the other four are new keys that follow
|
|
13
|
+
// the same lowercase convention for visual consistency in the joined consent line.
|
|
14
|
+
const POLICY_NAME_KEY = {
|
|
15
|
+
privacyPolicy: 'Privacy policy',
|
|
16
|
+
refundPolicy: 'Refund policy',
|
|
17
|
+
shippingPolicy: 'Shipping policy',
|
|
18
|
+
termsAndConditions: 'Terms and conditions',
|
|
19
|
+
warrantyPolicy: 'Warranty policy',
|
|
20
|
+
};
|
|
21
|
+
const { reset: policyConsentStoreReset, state: policyConsentStore } = createStore({
|
|
22
|
+
accepted: false,
|
|
23
|
+
acceptedAt: null,
|
|
24
|
+
locked: false,
|
|
25
|
+
showError: false,
|
|
26
|
+
});
|
|
27
|
+
export { policyConsentStore, policyConsentStoreReset };
|
|
28
|
+
/**
|
|
29
|
+
* Returns the list of policies the merchant has configured (non-empty link).
|
|
30
|
+
* Policies are returned in a fixed display order so the rendered list is
|
|
31
|
+
* deterministic across renders and across locales. URLs that aren't absolute
|
|
32
|
+
* http(s) URLs are filtered out as defense-in-depth against `javascript:` or
|
|
33
|
+
* other unexpected schemes slipping through the backend validation.
|
|
34
|
+
*
|
|
35
|
+
* Reads from `zonosStore.checkoutSettings` (not `window.Zonos.cartSettings`)
|
|
36
|
+
* so the consent UI works when zonos-elements is consumed via the npm package,
|
|
37
|
+
* where `cartSettings` is not populated.
|
|
38
|
+
*/
|
|
39
|
+
export const getEnabledPolicies = () => {
|
|
40
|
+
const links = zonosStore.checkoutSettings.merchantPolicyLinks;
|
|
41
|
+
if (!links) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
return POLICY_ORDER.reduce((acc, key) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const rawUrl = (_b = (_a = links[key]) === null || _a === void 0 ? void 0 : _a.link) === null || _b === void 0 ? void 0 : _b.trim();
|
|
47
|
+
if (!rawUrl || !/^https?:\/\//i.test(rawUrl)) {
|
|
48
|
+
return acc;
|
|
49
|
+
}
|
|
50
|
+
acc.push({
|
|
51
|
+
key,
|
|
52
|
+
name: translate(POLICY_NAME_KEY[key]),
|
|
53
|
+
url: rawUrl,
|
|
54
|
+
});
|
|
55
|
+
return acc;
|
|
56
|
+
}, []);
|
|
57
|
+
};
|
|
58
|
+
export const isPolicyConsentRequired = () => getEnabledPolicies().length > 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
2
|
import { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStorePreviousStep, cartStoreResetCartItems, cartStoreSetCheckoutSession, cartStoreUpdateSelectedShippingOption, cartStoreUpdateToErrorState, } from "./cart";
|
|
3
|
+
import { getEnabledPolicies, policyConsentStore, } from "./policyConsent";
|
|
3
4
|
import { localizationStore } from "../hello/localization";
|
|
4
5
|
import { storageStore } from "../storageStore";
|
|
5
6
|
import { translate } from "../translationStore";
|
|
@@ -879,6 +880,38 @@ const stripeStoreConfirmPayment = async (props) => {
|
|
|
879
880
|
}
|
|
880
881
|
}
|
|
881
882
|
};
|
|
883
|
+
/**
|
|
884
|
+
* Builds the single `merchantPolicyConsent` metadata entry that records the buyer's
|
|
885
|
+
* acceptance of the merchant policies (Terms and Conditions, Privacy Policy, etc.).
|
|
886
|
+
* Returns null when consent has not been accepted or when no policies are configured.
|
|
887
|
+
*
|
|
888
|
+
* The recorded value captures which policies were shown, the URLs the buyer
|
|
889
|
+
* agreed to, the active locale, and the snapshotted acceptance timestamp.
|
|
890
|
+
*/
|
|
891
|
+
const buildPolicyConsentMetadataEntry = () => {
|
|
892
|
+
if (!policyConsentStore.accepted) {
|
|
893
|
+
return null;
|
|
894
|
+
}
|
|
895
|
+
const policies = getEnabledPolicies();
|
|
896
|
+
if (!policies.length) {
|
|
897
|
+
return null;
|
|
898
|
+
}
|
|
899
|
+
return {
|
|
900
|
+
key: 'merchantPolicyConsent',
|
|
901
|
+
value: JSON.stringify({
|
|
902
|
+
// Use the timestamp snapshotted when the buyer first accepted, so any
|
|
903
|
+
// later session-metadata update keeps the original moment of consent
|
|
904
|
+
// for audit purposes. Fall back to "now" as a safety net for the
|
|
905
|
+
// unlikely case the store value was cleared between accept and write.
|
|
906
|
+
acceptedAt: policyConsentStore.acceptedAt || new Date().toISOString(),
|
|
907
|
+
locale: localizationStore.selectedLocale,
|
|
908
|
+
policies: policies.reduce((acc, policy) => {
|
|
909
|
+
acc[policy.key] = policy.url;
|
|
910
|
+
return acc;
|
|
911
|
+
}, {}),
|
|
912
|
+
}),
|
|
913
|
+
};
|
|
914
|
+
};
|
|
882
915
|
export const getCheckoutSessionBody = () => {
|
|
883
916
|
var _a;
|
|
884
917
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
@@ -1059,6 +1092,39 @@ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, cur
|
|
|
1059
1092
|
}
|
|
1060
1093
|
return { errors: [], json };
|
|
1061
1094
|
};
|
|
1095
|
+
/**
|
|
1096
|
+
* Pushes the buyer's policy consent into the checkout session's metadata via the
|
|
1097
|
+
* dedicated metadata-only mutation. Called from the payment continue handler so
|
|
1098
|
+
* consent is persisted to the session before Stripe's confirmPayment fires.
|
|
1099
|
+
*
|
|
1100
|
+
* Uses `checkoutSessionUpdateMetadata` — not the full `checkoutSessionUpdate` —
|
|
1101
|
+
* because this fires at the end of the payment phase, when we don't want to
|
|
1102
|
+
* touch landed-cost / cart / party state. No-op when no policies are configured,
|
|
1103
|
+
* when consent hasn't been accepted, or when there is no active session ID.
|
|
1104
|
+
*/
|
|
1105
|
+
export const stripeStoreRecordPolicyConsent = async () => {
|
|
1106
|
+
const consentEntry = buildPolicyConsentMetadataEntry();
|
|
1107
|
+
if (!consentEntry) {
|
|
1108
|
+
return { errors: [] };
|
|
1109
|
+
}
|
|
1110
|
+
if (!storageStore.checkoutSessionId) {
|
|
1111
|
+
return { errors: [] };
|
|
1112
|
+
}
|
|
1113
|
+
const { errors } = await handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
|
|
1114
|
+
body: {
|
|
1115
|
+
id: storageStore.checkoutSessionId,
|
|
1116
|
+
metadata: [consentEntry],
|
|
1117
|
+
},
|
|
1118
|
+
method: 'POST',
|
|
1119
|
+
});
|
|
1120
|
+
if (errors.length) {
|
|
1121
|
+
// Surface failures loudly so we have observability on consent records that
|
|
1122
|
+
// didn't persist — callers don't block payment, but the failure is logged.
|
|
1123
|
+
logError('Failed to record merchant policy consent on checkout session', JSON.stringify(errors, null, 2));
|
|
1124
|
+
return { errors: errors.map(err => err.message || 'Unknown error') };
|
|
1125
|
+
}
|
|
1126
|
+
return { errors: [] };
|
|
1127
|
+
};
|
|
1062
1128
|
/**
|
|
1063
1129
|
* This function builds a translated address object from the current address and the translated address result.
|
|
1064
1130
|
* It checks each field in the current address and if it exists in the translated address result, it adds it to the translated address object.
|
|
@@ -9,6 +9,7 @@ import { getInclusivePriceConfigurations } from "../../utils/api/getInclusivePri
|
|
|
9
9
|
import { getLocaleMessages } from "../../utils/api/getLocaleMessages";
|
|
10
10
|
import { getLocalization } from "../../utils/api/getLocalization";
|
|
11
11
|
import { getShippingZones } from "../../utils/api/getShippingZones";
|
|
12
|
+
import { removeBigcommerceCartShipping } from "../../utils/checkout/removeBigcommerceCartShipping";
|
|
12
13
|
import { handleFetch } from "../../utils/handleFetch";
|
|
13
14
|
import { currencyDisplay } from "../../utils/hello/currencyConversion/currencyDisplay";
|
|
14
15
|
import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrencyCode";
|
|
@@ -183,6 +184,11 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
|
|
|
183
184
|
// because `currencyDisplay` is also invoked from the price-mutation
|
|
184
185
|
// observer in `zonos-hello.tsx`, which fires on every DOM render.
|
|
185
186
|
toggleBigcommerceNativeCurrencySelector();
|
|
187
|
+
// On the BigCommerce cart page, drop any native domestic shipping quote the
|
|
188
|
+
// shopper added before switching to an international country so the Grand
|
|
189
|
+
// Total reflects only subtotal + coupon. No-ops off-cart, off-BigCommerce,
|
|
190
|
+
// for non-shippable countries, or when the cart has no consignment.
|
|
191
|
+
void removeBigcommerceCartShipping();
|
|
186
192
|
if (!selectedCountryCode) {
|
|
187
193
|
return;
|
|
188
194
|
}
|
|
@@ -360,6 +366,11 @@ const initLocalizationStore = async () => {
|
|
|
360
366
|
newSelectedCountryCode: 'CA',
|
|
361
367
|
});
|
|
362
368
|
}
|
|
363
|
-
localizationStore.localizationLoaded
|
|
369
|
+
if (!localizationStore.localizationLoaded) {
|
|
370
|
+
localizationStore.localizationLoaded = true;
|
|
371
|
+
void removeBigcommerceCartShipping();
|
|
372
|
+
// shouldShowHelloWidget is false because localization is not loaded yet
|
|
373
|
+
void toggleBigcommerceNativeCurrencySelector();
|
|
374
|
+
}
|
|
364
375
|
};
|
|
365
376
|
export { initLocalizationStore, localizationDispose, localizationStore, localizationStoreOnChange, localizationStoreUpdateSelectedCountryCode, localizationStoreUpdateSelectedLocale, };
|
|
@@ -281,6 +281,12 @@ export const stringsArabic = {
|
|
|
281
281
|
'Hide non-prepaid options': {
|
|
282
282
|
value: 'إخفاء الخيارات غير المدفوعة مسبقًا',
|
|
283
283
|
},
|
|
284
|
+
"I agree to [merchantName]'s [policies]": {
|
|
285
|
+
value: 'أوافق على [policies] [merchantName]',
|
|
286
|
+
},
|
|
287
|
+
'I agree to the [policies]': {
|
|
288
|
+
value: 'أوافق على [policies]',
|
|
289
|
+
},
|
|
284
290
|
"If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request.": {
|
|
285
291
|
value: 'إذا اخترت FedEx Ground كخيار الشحن الخاص بك، ستحتاج إلى إكمال اتفاقية الوكالة العامة (GAA) بعد تقديم طلبك. يتيح لك هذا النموذج السماح لـ FedEx بتخليص الطرد الخاص بك من الجمارك الكندية نيابة عنك. ستتصل بك FedEx مباشرةً - عادةً عبر البريد الإلكتروني أو الهاتف - مع تعليمات حول كيفية إكمال GAA. لتجنب التأخير أو إعادة الطرد الخاص بك، يرجى الرد بسرعة على طلبهم.',
|
|
286
292
|
},
|
|
@@ -497,6 +503,9 @@ export const stringsArabic = {
|
|
|
497
503
|
'RFC number': {
|
|
498
504
|
value: 'رقم RFC',
|
|
499
505
|
},
|
|
506
|
+
'Refund policy': {
|
|
507
|
+
value: 'سياسة الاسترداد',
|
|
508
|
+
},
|
|
500
509
|
Region: {
|
|
501
510
|
value: 'منطقة',
|
|
502
511
|
},
|
|
@@ -551,6 +560,9 @@ export const stringsArabic = {
|
|
|
551
560
|
'Shipping method': {
|
|
552
561
|
value: 'طريقة الشحن',
|
|
553
562
|
},
|
|
563
|
+
'Shipping policy': {
|
|
564
|
+
value: 'سياسة الشحن',
|
|
565
|
+
},
|
|
554
566
|
'Shopping cart expired': {
|
|
555
567
|
value: 'انتهت صلاحية عربة التسوق',
|
|
556
568
|
},
|
|
@@ -638,6 +650,9 @@ export const stringsArabic = {
|
|
|
638
650
|
'Taxes, duties, and fees included': {
|
|
639
651
|
value: 'الضرائب والرسوم والرسوم مشمولة',
|
|
640
652
|
},
|
|
653
|
+
'Terms and conditions': {
|
|
654
|
+
value: 'الشروط والأحكام',
|
|
655
|
+
},
|
|
641
656
|
'Test cards': {
|
|
642
657
|
value: 'بطاقات اختبار',
|
|
643
658
|
},
|
|
@@ -725,6 +740,9 @@ export const stringsArabic = {
|
|
|
725
740
|
Village: {
|
|
726
741
|
value: 'قرية',
|
|
727
742
|
},
|
|
743
|
+
'Warranty policy': {
|
|
744
|
+
value: 'سياسة الضمان',
|
|
745
|
+
},
|
|
728
746
|
"We couldn't complete your payment. Please verify the payment details and try again.": {
|
|
729
747
|
value: 'تعذر علينا اكمال الدفع. يرجى التحقق من تفاصيل الدفع وإعادة المحاولة.',
|
|
730
748
|
},
|
|
@@ -755,6 +773,9 @@ export const stringsArabic = {
|
|
|
755
773
|
'You may incur additional fees from the shipping carrier by not prepaying.': {
|
|
756
774
|
value: 'قد تتكبد رسومًا إضافية من شركة الشحن إذا لم تدفع مسبقًا.',
|
|
757
775
|
},
|
|
776
|
+
'You must accept the policies to place this order': {
|
|
777
|
+
value: 'يجب عليك قبول السياسات لتقديم هذا الطلب',
|
|
778
|
+
},
|
|
758
779
|
"You will be redirected back to the merchant's site in a few seconds.": {
|
|
759
780
|
value: 'سيتم إعادة توجيهك إلى موقع التاجر في غضون ثوانٍ قليلة.',
|
|
760
781
|
},
|
|
@@ -282,6 +282,12 @@ export const stringsBase = {
|
|
|
282
282
|
'Hide non-prepaid options': {
|
|
283
283
|
value: 'Hide non-prepaid options',
|
|
284
284
|
},
|
|
285
|
+
"I agree to [merchantName]'s [policies]": {
|
|
286
|
+
value: "I agree to [merchantName]'s [policies]",
|
|
287
|
+
},
|
|
288
|
+
'I agree to the [policies]': {
|
|
289
|
+
value: 'I agree to the [policies]',
|
|
290
|
+
},
|
|
285
291
|
"If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request.": {
|
|
286
292
|
value: "If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request.",
|
|
287
293
|
},
|
|
@@ -498,6 +504,9 @@ export const stringsBase = {
|
|
|
498
504
|
'RFC number': {
|
|
499
505
|
value: 'RFC number',
|
|
500
506
|
},
|
|
507
|
+
'Refund policy': {
|
|
508
|
+
value: 'Refund policy',
|
|
509
|
+
},
|
|
501
510
|
Region: {
|
|
502
511
|
value: 'Region',
|
|
503
512
|
},
|
|
@@ -552,6 +561,9 @@ export const stringsBase = {
|
|
|
552
561
|
'Shipping method': {
|
|
553
562
|
value: 'Shipping method',
|
|
554
563
|
},
|
|
564
|
+
'Shipping policy': {
|
|
565
|
+
value: 'Shipping policy',
|
|
566
|
+
},
|
|
555
567
|
'Shopping cart expired': {
|
|
556
568
|
value: 'Shopping cart expired',
|
|
557
569
|
},
|
|
@@ -639,6 +651,9 @@ export const stringsBase = {
|
|
|
639
651
|
'Taxes, duties, and fees included': {
|
|
640
652
|
value: 'Taxes, duties, and fees included',
|
|
641
653
|
},
|
|
654
|
+
'Terms and conditions': {
|
|
655
|
+
value: 'Terms and conditions',
|
|
656
|
+
},
|
|
642
657
|
'Test cards': {
|
|
643
658
|
value: 'Test cards',
|
|
644
659
|
},
|
|
@@ -726,6 +741,9 @@ export const stringsBase = {
|
|
|
726
741
|
Village: {
|
|
727
742
|
value: 'Village',
|
|
728
743
|
},
|
|
744
|
+
'Warranty policy': {
|
|
745
|
+
value: 'Warranty policy',
|
|
746
|
+
},
|
|
729
747
|
"We couldn't complete your payment. Please verify the payment details and try again.": {
|
|
730
748
|
value: "We couldn't complete your payment. Please verify the payment details and try again.",
|
|
731
749
|
},
|
|
@@ -756,6 +774,9 @@ export const stringsBase = {
|
|
|
756
774
|
'You may incur additional fees from the shipping carrier by not prepaying.': {
|
|
757
775
|
value: 'You may incur additional fees from the shipping carrier by not prepaying.',
|
|
758
776
|
},
|
|
777
|
+
'You must accept the policies to place this order': {
|
|
778
|
+
value: 'You must accept the policies to place this order',
|
|
779
|
+
},
|
|
759
780
|
"You will be redirected back to the merchant's site in a few seconds.": {
|
|
760
781
|
value: "You will be redirected back to the merchant's site in a few seconds.",
|
|
761
782
|
},
|
|
@@ -281,6 +281,12 @@ export const stringsChinese = {
|
|
|
281
281
|
'Hide non-prepaid options': {
|
|
282
282
|
value: '隐藏非预付选项',
|
|
283
283
|
},
|
|
284
|
+
"I agree to [merchantName]'s [policies]": {
|
|
285
|
+
value: '我同意[merchantName]的[policies]',
|
|
286
|
+
},
|
|
287
|
+
'I agree to the [policies]': {
|
|
288
|
+
value: '我同意[policies]',
|
|
289
|
+
},
|
|
284
290
|
"If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request.": {
|
|
285
291
|
value: '如果您选择FedEx Ground作为您的运输选项,您需要在下订单后完成一般代理协议(GAA)。此表格允许FedEx代表您通过加拿大海关清关您的包裹。FedEx会直接与您联系,通常通过电子邮件或电话,提供有关如何完成GAA的说明。为避免延误或包裹退回,请及时回应他们的请求。',
|
|
286
292
|
},
|
|
@@ -497,6 +503,9 @@ export const stringsChinese = {
|
|
|
497
503
|
'RFC number': {
|
|
498
504
|
value: 'RFC编号',
|
|
499
505
|
},
|
|
506
|
+
'Refund policy': {
|
|
507
|
+
value: '退款政策',
|
|
508
|
+
},
|
|
500
509
|
Region: {
|
|
501
510
|
value: '地区',
|
|
502
511
|
},
|
|
@@ -551,6 +560,9 @@ export const stringsChinese = {
|
|
|
551
560
|
'Shipping method': {
|
|
552
561
|
value: '运输方式',
|
|
553
562
|
},
|
|
563
|
+
'Shipping policy': {
|
|
564
|
+
value: '运输政策',
|
|
565
|
+
},
|
|
554
566
|
'Shopping cart expired': {
|
|
555
567
|
value: '购物车已过期',
|
|
556
568
|
},
|
|
@@ -638,6 +650,9 @@ export const stringsChinese = {
|
|
|
638
650
|
'Taxes, duties, and fees included': {
|
|
639
651
|
value: '包括税费、关税和费用',
|
|
640
652
|
},
|
|
653
|
+
'Terms and conditions': {
|
|
654
|
+
value: '条款和条件',
|
|
655
|
+
},
|
|
641
656
|
'Test cards': {
|
|
642
657
|
value: '测试卡',
|
|
643
658
|
},
|
|
@@ -725,6 +740,9 @@ export const stringsChinese = {
|
|
|
725
740
|
Village: {
|
|
726
741
|
value: '村庄',
|
|
727
742
|
},
|
|
743
|
+
'Warranty policy': {
|
|
744
|
+
value: '保修政策',
|
|
745
|
+
},
|
|
728
746
|
"We couldn't complete your payment. Please verify the payment details and try again.": {
|
|
729
747
|
value: '我们无法完成您的付款。请验证付款详情并重试。',
|
|
730
748
|
},
|
|
@@ -755,6 +773,9 @@ export const stringsChinese = {
|
|
|
755
773
|
'You may incur additional fees from the shipping carrier by not prepaying.': {
|
|
756
774
|
value: '如果不预付,您可能会产生来自运输公司的额外费用。',
|
|
757
775
|
},
|
|
776
|
+
'You must accept the policies to place this order': {
|
|
777
|
+
value: '您必须接受政策才能下此订单',
|
|
778
|
+
},
|
|
758
779
|
"You will be redirected back to the merchant's site in a few seconds.": {
|
|
759
780
|
value: '您将在几秒钟内被重定向回商家网站。',
|
|
760
781
|
},
|
|
@@ -281,6 +281,12 @@ export const stringsDanish = {
|
|
|
281
281
|
'Hide non-prepaid options': {
|
|
282
282
|
value: 'Skjul ikke-forudbetalte muligheder',
|
|
283
283
|
},
|
|
284
|
+
"I agree to [merchantName]'s [policies]": {
|
|
285
|
+
value: 'Jeg accepterer [merchantName]s [policies]',
|
|
286
|
+
},
|
|
287
|
+
'I agree to the [policies]': {
|
|
288
|
+
value: 'Jeg accepterer [policies]',
|
|
289
|
+
},
|
|
284
290
|
"If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request.": {
|
|
285
291
|
value: 'Hvis du vælger FedEx Ground som din forsendelsesmulighed, skal du udfylde en General Agency Agreement (GAA) efter at have afgivet din ordre. Denne formular giver FedEx mulighed for at fortolde din pakke gennem canadisk told på dine vegne. FedEx vil kontakte dig direkte - normalt via e-mail eller telefon - med instruktioner om, hvordan du fuldfører GAA. For at undgå forsinkelser eller returnering af din pakke, bedes du svare hurtigt på deres anmodning.',
|
|
286
292
|
},
|
|
@@ -497,6 +503,9 @@ export const stringsDanish = {
|
|
|
497
503
|
'RFC number': {
|
|
498
504
|
value: 'RFC-nummer',
|
|
499
505
|
},
|
|
506
|
+
'Refund policy': {
|
|
507
|
+
value: 'Refunderingspolitik',
|
|
508
|
+
},
|
|
500
509
|
Region: {
|
|
501
510
|
value: 'Region',
|
|
502
511
|
},
|
|
@@ -551,6 +560,9 @@ export const stringsDanish = {
|
|
|
551
560
|
'Shipping method': {
|
|
552
561
|
value: 'Leveringsmetode',
|
|
553
562
|
},
|
|
563
|
+
'Shipping policy': {
|
|
564
|
+
value: 'Forsendelsespolitik',
|
|
565
|
+
},
|
|
554
566
|
'Shopping cart expired': {
|
|
555
567
|
value: 'Indkøbskurv udløbet',
|
|
556
568
|
},
|
|
@@ -638,6 +650,9 @@ export const stringsDanish = {
|
|
|
638
650
|
'Taxes, duties, and fees included': {
|
|
639
651
|
value: 'Skatter, afgifter og gebyrer inkluderet',
|
|
640
652
|
},
|
|
653
|
+
'Terms and conditions': {
|
|
654
|
+
value: 'Vilkår og betingelser',
|
|
655
|
+
},
|
|
641
656
|
'Test cards': {
|
|
642
657
|
value: 'Testkort',
|
|
643
658
|
},
|
|
@@ -725,6 +740,9 @@ export const stringsDanish = {
|
|
|
725
740
|
Village: {
|
|
726
741
|
value: 'Landsby',
|
|
727
742
|
},
|
|
743
|
+
'Warranty policy': {
|
|
744
|
+
value: 'Garantipolitik',
|
|
745
|
+
},
|
|
728
746
|
"We couldn't complete your payment. Please verify the payment details and try again.": {
|
|
729
747
|
value: 'Vi kunne ikke gennemføre din betaling. Kontroller venligst betalingsoplysningerne og prøv igen.',
|
|
730
748
|
},
|
|
@@ -755,6 +773,9 @@ export const stringsDanish = {
|
|
|
755
773
|
'You may incur additional fees from the shipping carrier by not prepaying.': {
|
|
756
774
|
value: 'Du kan pådrage dig ekstra gebyrer fra fragtfirmaet ved ikke at forudbetale.',
|
|
757
775
|
},
|
|
776
|
+
'You must accept the policies to place this order': {
|
|
777
|
+
value: 'Du skal acceptere politikkerne for at afgive denne bestilling',
|
|
778
|
+
},
|
|
758
779
|
"You will be redirected back to the merchant's site in a few seconds.": {
|
|
759
780
|
value: 'Du vil blive omdirigeret tilbage til forhandlerens side om få sekunder.',
|
|
760
781
|
},
|