@zonos/elements 1.3.142 → 1.3.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{CheckoutConfig-eaaf62a1.js → CheckoutConfig-d25d548d.js} +13 -3
- package/dist/cjs/TaxId-4632639d.js +29 -0
- package/dist/cjs/{cart-199b0751.js → cart-2398abd4.js} +547 -42
- package/dist/cjs/{createCustomEvent-3e982e57.js → createCustomEvent-7b6fad95.js} +0 -3
- package/dist/cjs/{getBorderRadius-f97c99ad.js → getBorderRadius-7d0772bf.js} +1 -1
- package/dist/cjs/{handleFetch-864d3c53.js → handleFetch-3673a0c2.js} +30 -1
- package/dist/cjs/{index-b678ce0c.js → index-2f90486e.js} +209 -157
- package/dist/cjs/index.cjs.js +15 -11
- package/dist/cjs/{isDarkColor-434d71dd.js → isDarkColor-2acf30d1.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{paypal-4f1ee604.js → paypal-7ed9dfb7.js} +4 -4
- package/dist/cjs/{zonos-address_7.cjs.entry.js → zonos-address_8.cjs.entry.js} +143 -10
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +151 -32
- package/dist/cjs/zonos-checkout.cjs.entry.js +36 -16
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +8 -8
- package/dist/cjs/zonos-country-flag.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/{zonos-notification_3.cjs.entry.js → zonos-empty-state-payment_4.cjs.entry.js} +87 -9
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +10 -10
- package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-toggle.cjs.entry.js +4 -4
- package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
- package/dist/cjs/{zonosStore-8971eb65.js → zonosStore-46809186.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +5 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +8 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +24 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +34 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +109 -18
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/assets/PaymentEmptyStateDarkIcon.svg +22 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/assets/PaymentEmptyStateLightIcon.svg +22 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.css +51 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.js +90 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +62 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +32 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +6 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +18 -2
- package/dist/collection/components/common/zonos-banner/zonos-banner.js +4 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +30 -0
- package/dist/collection/components/common/zonos-card/zonos-card.js +20 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +14 -0
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +4 -0
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +4 -0
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +22 -0
- package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +4 -0
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -0
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +4 -0
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +26 -0
- package/dist/collection/components/common/zonos-icon/zonos-icon.js +8 -0
- package/dist/collection/components/common/zonos-input/zonos-input.js +12 -0
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -0
- package/dist/collection/components/common/zonos-link/zonos-link.js +8 -0
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +4 -0
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +6 -0
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +4 -0
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +11 -1
- package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +4 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +162 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +264 -0
- package/dist/collection/components/common/zonos-text/zonos-text.js +8 -0
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +6 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +6 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +4 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +12 -4
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +7 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +7 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +9 -3
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +17 -5
- package/dist/collection/components/main/zonos-controller.js +7 -3
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +3 -0
- package/dist/collection/components/store/checkout/stripe.js +121 -40
- 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/stripe/zonos-address/zonos-address.js +7 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +84 -3
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +3 -1
- package/dist/collection/components/utils/api/getCheckoutSession.js +1 -1
- package/dist/collection/components/utils/api/placeTestOrder.js +40 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +2 -0
- package/dist/collection/components/utils/checkout/getIsStagingMode.js +1 -0
- package/dist/collection/components/utils/checkout/getIsTestMode.js +5 -1
- package/dist/collection/components/utils/handleFetch.js +22 -1
- package/dist/collection/components/utils/validateEmailValue.js +4 -0
- package/dist/collection/scripts/_getTempCartById.js +2 -2
- package/dist/collection/scripts/_getWithTestPublicCredential.js +5 -2
- package/dist/collection/scripts/cart/_getIsValidCartId.js +11 -0
- package/dist/collection/types/checkout/TaxId.js +24 -0
- package/dist/collection/types/checkout/api/PlaceTestOrder.js +1 -0
- package/dist/collection/types/generated/graphql.internal.types.js +64 -0
- package/dist/collection/types/index.js +2 -0
- package/dist/esm/{CheckoutConfig-262008fe.js → CheckoutConfig-573bd959.js} +13 -3
- package/dist/esm/TaxId-915ef042.js +26 -0
- package/dist/esm/{cart-cf87ec6f.js → cart-3427ee25.js} +547 -42
- package/dist/esm/{createCustomEvent-31a792d3.js → createCustomEvent-58159025.js} +1 -3
- package/dist/esm/{getBorderRadius-4aca63d4.js → getBorderRadius-b32d4218.js} +1 -1
- package/dist/esm/{handleFetch-badf4543.js → handleFetch-b4633675.js} +29 -2
- package/dist/esm/{index-986b5ff2.js → index-d82f06f2.js} +209 -157
- package/dist/esm/index.js +14 -12
- package/dist/esm/{isDarkColor-4915739f.js → isDarkColor-10f38df6.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{paypal-b7124cc4.js → paypal-4e2f9753.js} +4 -4
- package/dist/esm/{zonos-address_7.entry.js → zonos-address_8.entry.js} +143 -11
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +4 -4
- package/dist/esm/zonos-card.entry.js +3 -3
- package/dist/esm/zonos-cart-items_13.entry.js +149 -30
- package/dist/esm/zonos-checkout.entry.js +34 -14
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +8 -8
- package/dist/esm/zonos-country-flag.entry.js +6 -6
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/{zonos-notification_3.entry.js → zonos-empty-state-payment_4.entry.js} +87 -10
- package/dist/esm/zonos-hello-dialog.entry.js +10 -10
- package/dist/esm/zonos-hello.entry.js +6 -6
- package/dist/esm/zonos-input.entry.js +3 -3
- package/dist/esm/zonos-language-select_2.entry.js +6 -6
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-toggle.entry.js +4 -4
- package/dist/esm/zonos-tooltip.entry.js +3 -3
- package/dist/esm/zonos-v-stack.entry.js +4 -4
- package/dist/esm/{zonosStore-708637e7.js → zonosStore-44efd080.js} +1 -1
- package/dist/esm-es5/CheckoutConfig-573bd959.js +1 -0
- package/dist/esm-es5/TaxId-915ef042.js +1 -0
- package/dist/esm-es5/cart-3427ee25.js +1 -0
- package/dist/esm-es5/createCustomEvent-58159025.js +1 -0
- package/dist/esm-es5/{getBorderRadius-4aca63d4.js → getBorderRadius-b32d4218.js} +1 -1
- package/dist/esm-es5/handleFetch-b4633675.js +1 -0
- package/dist/esm-es5/index-d82f06f2.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-4915739f.js → isDarkColor-10f38df6.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-b7124cc4.js → paypal-4e2f9753.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -0
- 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.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -0
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-708637e7.js → zonosStore-44efd080.js} +1 -1
- package/dist/scripts/index.d.ts +170 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +18 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.d.ts +13 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +10 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +5 -0
- package/dist/types/components/common/zonos-stripe-input/zonos-stripe-input.d.ts +46 -0
- package/dist/types/components/store/checkout/cart.d.ts +5 -0
- package/dist/types/components/store/checkout/stripe.d.ts +16 -2
- 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/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +6 -0
- package/dist/types/components/utils/api/placeTestOrder.d.ts +7 -0
- package/dist/types/components/utils/checkout/getIsStagingMode.d.ts +1 -0
- package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -1
- package/dist/types/components/utils/validateEmailValue.d.ts +1 -0
- package/dist/types/components.d.ts +161 -0
- package/dist/types/types/checkout/TaxId.d.ts +20 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +8 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +8 -2
- package/dist/types/types/checkout/api/PlaceTestOrder.d.ts +7 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +144 -109
- package/dist/types/types/generated/graphql.internal.types.ts +180 -99
- package/dist/types/types/index.d.ts +2 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-68d79b58.entry.js → p-00136c20.entry.js} +1 -1
- package/dist/zonos-elements/{p-d381288e.entry.js → p-0028d158.entry.js} +1 -1
- package/dist/zonos-elements/{p-72256333.entry.js → p-05013308.entry.js} +1 -1
- package/dist/zonos-elements/{p-c1b098de.system.js → p-0e6a3cd2.system.js} +1 -1
- package/dist/zonos-elements/{p-c0164a3c.system.js → p-12546668.system.js} +1 -1
- package/dist/zonos-elements/p-12a6b7bd.system.js +1 -0
- package/dist/zonos-elements/p-1423ebbe.js +1 -0
- package/dist/zonos-elements/p-18e5b741.system.js +1 -0
- package/dist/zonos-elements/p-2deae669.entry.js +1 -0
- package/dist/zonos-elements/{p-36dfc7ac.system.js → p-32912caf.system.js} +1 -1
- package/dist/zonos-elements/{p-fc4658a6.entry.js → p-36f97fd9.entry.js} +1 -1
- package/dist/zonos-elements/{p-983f23a1.system.entry.js → p-3a213429.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e6554a6f.system.entry.js → p-3aa4841a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a13d5957.system.entry.js → p-3d221556.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-381874b0.system.entry.js → p-41e26cc4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2d514c1d.system.entry.js → p-463e44b6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-46f6e5e9.system.js +1 -0
- package/dist/zonos-elements/{p-6271e108.js → p-485d89a4.js} +1 -1
- package/dist/zonos-elements/p-48bca3d4.system.entry.js +1 -0
- package/dist/zonos-elements/p-4caffd96.system.js +2 -0
- package/dist/zonos-elements/{p-0920500d.entry.js → p-50896f89.entry.js} +1 -1
- package/dist/zonos-elements/{p-2e152517.system.entry.js → p-515e3606.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5834c218.system.js +1 -0
- package/dist/zonos-elements/p-595f5dd2.js +1 -0
- package/dist/zonos-elements/p-5bd927f2.js +1 -0
- package/dist/zonos-elements/{p-2761ad55.system.entry.js → p-619c07c6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2b8cddb7.entry.js → p-69f84611.entry.js} +1 -1
- package/dist/zonos-elements/{p-766dd01f.js → p-6c578d26.js} +1 -1
- package/dist/zonos-elements/{p-28295342.entry.js → p-709c7e9e.entry.js} +1 -1
- package/dist/zonos-elements/{p-0197a9bf.system.entry.js → p-7140439f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7302a081.system.entry.js +1 -0
- package/dist/zonos-elements/p-7e47f6cf.entry.js +1 -0
- package/dist/zonos-elements/{p-44dd4269.entry.js → p-7f288336.entry.js} +1 -1
- package/dist/zonos-elements/{p-0e54432c.system.entry.js → p-81084be5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-81a5dd5c.js +1 -0
- package/dist/zonos-elements/p-84e5fc0b.entry.js +1 -0
- package/dist/zonos-elements/{p-33e1d25e.system.entry.js → p-86e825f0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b5f4ca7.system.entry.js → p-91fc6c24.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9951462e.entry.js +1 -0
- package/dist/zonos-elements/{p-a2bce31d.system.entry.js → p-9cf018c8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-232963d3.system.entry.js → p-9e05e259.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b490b0a.system.entry.js → p-a8cf3542.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ab68ad11.js +2 -0
- package/dist/zonos-elements/{p-4b685549.js → p-b0616716.js} +1 -1
- package/dist/zonos-elements/{p-1e3ea4ae.entry.js → p-b12fbc07.entry.js} +1 -1
- package/dist/zonos-elements/{p-d198421b.system.entry.js → p-b2292b70.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-58a09715.entry.js → p-b262b93e.entry.js} +1 -1
- package/dist/zonos-elements/{p-545c05ce.entry.js → p-b288c2ed.entry.js} +1 -1
- package/dist/zonos-elements/p-b3882a73.system.js +1 -0
- package/dist/zonos-elements/{p-9306a835.entry.js → p-b5c360af.entry.js} +1 -1
- package/dist/zonos-elements/{p-2cfc00b8.system.entry.js → p-b6bbdb59.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f295030e.system.entry.js → p-bb92882d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-bf37ccc7.system.js +1 -0
- package/dist/zonos-elements/{p-21b538ea.system.js → p-c015be06.system.js} +1 -1
- package/dist/zonos-elements/p-c8b0bc02.system.entry.js +1 -0
- package/dist/zonos-elements/{p-39cac2c1.entry.js → p-cbd5d932.entry.js} +1 -1
- package/dist/zonos-elements/{p-7c5c0a85.entry.js → p-cdfca133.entry.js} +1 -1
- package/dist/zonos-elements/{p-675f60b4.entry.js → p-d2f2c685.entry.js} +1 -1
- package/dist/zonos-elements/{p-2c19f5e2.entry.js → p-d6061c79.entry.js} +1 -1
- package/dist/zonos-elements/p-da6a29e4.system.entry.js +1 -0
- package/dist/zonos-elements/{p-65069140.entry.js → p-db3f381d.entry.js} +1 -1
- package/dist/zonos-elements/{p-9dec2b74.entry.js → p-de221545.entry.js} +1 -1
- package/dist/zonos-elements/{p-2949faf3.entry.js → p-e01ccb27.entry.js} +1 -1
- package/dist/zonos-elements/{p-b0174a8f.js → p-e02fd9ae.js} +1 -1
- package/dist/zonos-elements/{p-3cf30d83.entry.js → p-e2f1fa53.entry.js} +1 -1
- package/dist/zonos-elements/{p-ebdd9b64.system.entry.js → p-e8c70c7d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a8bd492d.system.entry.js → p-ea35b237.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f0c8150e.js +1 -0
- package/dist/zonos-elements/p-f3b0a097.system.js +1 -0
- package/dist/zonos-elements/{p-d5a3851d.system.entry.js → p-fc4ebe6b.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +9 -8
- package/dist/esm-es5/CheckoutConfig-262008fe.js +0 -1
- package/dist/esm-es5/cart-cf87ec6f.js +0 -1
- package/dist/esm-es5/createCustomEvent-31a792d3.js +0 -1
- package/dist/esm-es5/handleFetch-badf4543.js +0 -1
- package/dist/esm-es5/index-986b5ff2.js +0 -2
- package/dist/esm-es5/zonos-address_7.entry.js +0 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +0 -1
- package/dist/zonos-elements/p-076388d3.entry.js +0 -1
- package/dist/zonos-elements/p-0cda2818.system.js +0 -1
- package/dist/zonos-elements/p-0d2cf216.entry.js +0 -1
- package/dist/zonos-elements/p-1460f917.js +0 -1
- package/dist/zonos-elements/p-272052bd.system.entry.js +0 -1
- package/dist/zonos-elements/p-3cb4468f.system.entry.js +0 -1
- package/dist/zonos-elements/p-3d82e70e.js +0 -1
- package/dist/zonos-elements/p-64372f93.system.js +0 -1
- package/dist/zonos-elements/p-673b4402.system.entry.js +0 -1
- package/dist/zonos-elements/p-680d3694.js +0 -2
- package/dist/zonos-elements/p-7b999a40.js +0 -1
- package/dist/zonos-elements/p-7c643376.system.js +0 -1
- package/dist/zonos-elements/p-866bb93e.system.js +0 -1
- package/dist/zonos-elements/p-8c487480.entry.js +0 -1
- package/dist/zonos-elements/p-9b720cf4.entry.js +0 -1
- package/dist/zonos-elements/p-a5b294d7.js +0 -1
- package/dist/zonos-elements/p-b50667b6.system.js +0 -2
- package/dist/zonos-elements/p-bfcfd29b.system.js +0 -1
- package/dist/zonos-elements/p-ded984d9.system.entry.js +0 -1
- package/dist/zonos-elements/p-e9964a5a.system.js +0 -1
package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js
CHANGED
|
@@ -1,23 +1,56 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { h, Host, } from "@stencil/core";
|
|
3
|
+
import { cartStore } from "../../store/checkout/cart";
|
|
3
4
|
import { stripeStore } from "../../store/checkout/stripe";
|
|
4
5
|
import { translate } from "../../store/translationStore";
|
|
5
6
|
import { getBorderRadius } from "../../utils/getBorderRadius";
|
|
6
7
|
import { logError } from "../../utils/logging/logError";
|
|
8
|
+
import { validateEmailValue } from "../../utils/validateEmailValue";
|
|
7
9
|
/**
|
|
8
10
|
* This component is a wrapper for the stripe authentication element that would render default style object
|
|
9
11
|
*/
|
|
10
12
|
export class ZonosLinkAuthentication {
|
|
11
13
|
constructor() {
|
|
14
|
+
this.setCustomEmailInputToLinkEvent = (emailValue) => {
|
|
15
|
+
// check if the email is valid
|
|
16
|
+
const isValid = validateEmailValue(emailValue);
|
|
17
|
+
const simulateLinkEvent = {
|
|
18
|
+
complete: !!isValid,
|
|
19
|
+
elementType: 'linkAuthentication',
|
|
20
|
+
empty: !emailValue,
|
|
21
|
+
value: {
|
|
22
|
+
email: emailValue,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
stripeStore.stripeLinkEventData = simulateLinkEvent;
|
|
26
|
+
};
|
|
27
|
+
this.handleNormalEmailInput = (event) => {
|
|
28
|
+
var _a;
|
|
29
|
+
const inputValue = event.detail;
|
|
30
|
+
this.setCustomEmailInputToLinkEvent(inputValue);
|
|
31
|
+
(_a = this.linkAuthenticationChange) === null || _a === void 0 ? void 0 : _a.emit();
|
|
32
|
+
};
|
|
12
33
|
this.titleText = undefined;
|
|
13
34
|
this.defaultEmail = null;
|
|
14
35
|
this.isEmailError = false;
|
|
15
36
|
this.stripe = stripeStore.stripe;
|
|
37
|
+
this.isStagingMode = cartStore.isStagingMode;
|
|
38
|
+
this.clientSecret = stripeStore.clientSecret;
|
|
39
|
+
}
|
|
40
|
+
watchIsStagingMode() {
|
|
41
|
+
// Wait for the DOM to be ready before re-initializing Link element
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
this.watchInitStripe();
|
|
44
|
+
}, 0);
|
|
16
45
|
}
|
|
17
46
|
watchInitStripe() {
|
|
18
47
|
if (!this.stripe || !stripeStore.stripeElements) {
|
|
19
48
|
return;
|
|
20
49
|
}
|
|
50
|
+
// No need to initialize link if this is staging mode since we will render the email input field
|
|
51
|
+
if (cartStore.isStagingMode) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
21
54
|
const defaultValues = this.defaultEmail
|
|
22
55
|
? {
|
|
23
56
|
email: this.defaultEmail,
|
|
@@ -41,15 +74,46 @@ export class ZonosLinkAuthentication {
|
|
|
41
74
|
});
|
|
42
75
|
stripeStore.stripeLinkElement = linkAuthenticationElement;
|
|
43
76
|
}
|
|
77
|
+
watchDefaultEmail() {
|
|
78
|
+
if (!this.defaultEmail) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.setCustomEmailInputToLinkEvent(this.defaultEmail);
|
|
82
|
+
}
|
|
44
83
|
componentDidLoad() {
|
|
45
84
|
// @Watch doesn't get trigger on initial load
|
|
46
85
|
this.watchInitStripe();
|
|
86
|
+
if (!this.defaultEmail) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// set default email value to stripeLinkEventData if default email is provided
|
|
90
|
+
this.setCustomEmailInputToLinkEvent(this.defaultEmail);
|
|
47
91
|
}
|
|
48
92
|
render() {
|
|
93
|
+
this.isStagingMode = cartStore.isStagingMode;
|
|
94
|
+
this.clientSecret = stripeStore.clientSecret;
|
|
95
|
+
const renderEmailAddress = () => {
|
|
96
|
+
var _a;
|
|
97
|
+
if (cartStore.isStagingMode) {
|
|
98
|
+
return (h("zonos-stripe-input", { inputLabel: translate('Email'), inputValue: this.defaultEmail ||
|
|
99
|
+
((_a = stripeStore.stripeLinkEventData) === null || _a === void 0 ? void 0 : _a.value.email) ||
|
|
100
|
+
'', isError: this.isEmailError, onBlur: () => {
|
|
101
|
+
var _a;
|
|
102
|
+
const emailValue = ((_a = stripeStore.stripeLinkEventData) === null || _a === void 0 ? void 0 : _a.value.email) || '';
|
|
103
|
+
if (!emailValue) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// check if the email is valid
|
|
107
|
+
const isValid = validateEmailValue(emailValue);
|
|
108
|
+
this.isEmailError = !isValid;
|
|
109
|
+
}, onInputChange: this.handleNormalEmailInput }));
|
|
110
|
+
}
|
|
111
|
+
return (h("div", { class: `zonos--link-authentication-component ${this.isEmailError && 'zonos--input-invalid'}` }));
|
|
112
|
+
};
|
|
49
113
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
50
|
-
return (h(Host, {
|
|
114
|
+
return (h(Host, { class: "zonos--link-authentication zonos--elements", style: {
|
|
51
115
|
'--zonos--border-radius': getBorderRadius(),
|
|
52
|
-
} }, h("zonos-text", {
|
|
116
|
+
} }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, this.titleText), renderEmailAddress(), this.isEmailError && (h("zonos-text", { textColor: "red-600" }, translate('Please enter a valid email address.')))));
|
|
53
117
|
}
|
|
54
118
|
static get is() { return "zonos-link-authentication"; }
|
|
55
119
|
static get encapsulation() { return "scoped"; }
|
|
@@ -79,6 +143,8 @@ export class ZonosLinkAuthentication {
|
|
|
79
143
|
"tags": [],
|
|
80
144
|
"text": "The title text for the authentication element"
|
|
81
145
|
},
|
|
146
|
+
"getter": false,
|
|
147
|
+
"setter": false,
|
|
82
148
|
"attribute": "title-text",
|
|
83
149
|
"reflect": false
|
|
84
150
|
},
|
|
@@ -96,6 +162,8 @@ export class ZonosLinkAuthentication {
|
|
|
96
162
|
"tags": [],
|
|
97
163
|
"text": "Default email for stripe"
|
|
98
164
|
},
|
|
165
|
+
"getter": false,
|
|
166
|
+
"setter": false,
|
|
99
167
|
"attribute": "default-email",
|
|
100
168
|
"reflect": false,
|
|
101
169
|
"defaultValue": "null"
|
|
@@ -114,6 +182,8 @@ export class ZonosLinkAuthentication {
|
|
|
114
182
|
"tags": [],
|
|
115
183
|
"text": "Email error text to dispaly"
|
|
116
184
|
},
|
|
185
|
+
"getter": false,
|
|
186
|
+
"setter": false,
|
|
117
187
|
"attribute": "is-email-error",
|
|
118
188
|
"reflect": false,
|
|
119
189
|
"defaultValue": "false"
|
|
@@ -122,7 +192,9 @@ export class ZonosLinkAuthentication {
|
|
|
122
192
|
}
|
|
123
193
|
static get states() {
|
|
124
194
|
return {
|
|
125
|
-
"stripe": {}
|
|
195
|
+
"stripe": {},
|
|
196
|
+
"isStagingMode": {},
|
|
197
|
+
"clientSecret": {}
|
|
126
198
|
};
|
|
127
199
|
}
|
|
128
200
|
static get events() {
|
|
@@ -146,8 +218,17 @@ export class ZonosLinkAuthentication {
|
|
|
146
218
|
static get elementRef() { return "el"; }
|
|
147
219
|
static get watchers() {
|
|
148
220
|
return [{
|
|
221
|
+
"propName": "isStagingMode",
|
|
222
|
+
"methodName": "watchIsStagingMode"
|
|
223
|
+
}, {
|
|
149
224
|
"propName": "stripe",
|
|
150
225
|
"methodName": "watchInitStripe"
|
|
226
|
+
}, {
|
|
227
|
+
"propName": "clientSecret",
|
|
228
|
+
"methodName": "watchInitStripe"
|
|
229
|
+
}, {
|
|
230
|
+
"propName": "defaultEmail",
|
|
231
|
+
"methodName": "watchDefaultEmail"
|
|
151
232
|
}];
|
|
152
233
|
}
|
|
153
234
|
}
|
|
@@ -36,7 +36,7 @@ export class ZonosPayment {
|
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
38
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: '2d664521944c4f02f34fe3130f8ebb853e562476', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: '11f683a0f6094d801103a9f04054d038b405718f', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '0c962441697499b3a7eb279175ce025d76d4c0fa', class: "zonos--payment-component" }), h("div", { key: 'a96af74f05521fcccc1912c0ec1dcbe64cfc1ae7', class: "zonos--payment-paypal-container" })));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "zonos-payment"; }
|
|
42
42
|
static get encapsulation() { return "scoped"; }
|
|
@@ -66,6 +66,8 @@ export class ZonosPayment {
|
|
|
66
66
|
"tags": [],
|
|
67
67
|
"text": "The title text for the authentication element"
|
|
68
68
|
},
|
|
69
|
+
"getter": false,
|
|
70
|
+
"setter": false,
|
|
69
71
|
"attribute": "title-text",
|
|
70
72
|
"reflect": false
|
|
71
73
|
}
|
|
@@ -7,7 +7,7 @@ export const getCheckoutSession = async () => {
|
|
|
7
7
|
json: null,
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
const searchParams = new URLSearchParams(
|
|
10
|
+
const searchParams = new URLSearchParams();
|
|
11
11
|
searchParams.set('checkoutSessionId', cartStore.checkoutSessionId);
|
|
12
12
|
const { errors, json } = await handleFetch(`/api/zonos-elements/get-checkout-session?${searchParams.toString()}`);
|
|
13
13
|
return { errors, json };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cartStore } from "../../store/checkout/cart";
|
|
2
|
+
import { handleFetch } from "../handleFetch";
|
|
3
|
+
import { logError } from "../logging/logError";
|
|
4
|
+
export const placeTestOrder = async () => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const shipToPartyId = (_a = cartStore.partiesData.find(party => party.type === 'DESTINATION')) === null || _a === void 0 ? void 0 : _a.id;
|
|
7
|
+
const billToPartyId = (_b = cartStore.partiesData.find(party => party.type === 'PAYOR')) === null || _b === void 0 ? void 0 : _b.id;
|
|
8
|
+
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
9
|
+
if (!checkoutSessionId || !billToPartyId || !shipToPartyId) {
|
|
10
|
+
logError('Missing required data', {
|
|
11
|
+
billToPartyId,
|
|
12
|
+
checkoutSessionId,
|
|
13
|
+
shipToPartyId,
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
errors: ['Missing required data'],
|
|
17
|
+
json: null,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const payload = {
|
|
21
|
+
billToPartyId,
|
|
22
|
+
checkoutSessionId,
|
|
23
|
+
shipToPartyId,
|
|
24
|
+
};
|
|
25
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/place-test-order', {
|
|
26
|
+
body: payload,
|
|
27
|
+
method: 'POST',
|
|
28
|
+
});
|
|
29
|
+
if (errors.length || !json) {
|
|
30
|
+
logError('Error occurs when placing test order', errors);
|
|
31
|
+
return {
|
|
32
|
+
errors: errors.map(error => error.message),
|
|
33
|
+
json: null,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
errors: [],
|
|
38
|
+
json,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -88,6 +88,7 @@ export const prepCartCalculateLandedCost = (cartId) => {
|
|
|
88
88
|
},
|
|
89
89
|
]
|
|
90
90
|
: [],
|
|
91
|
+
shipToTaxId: stripeStore.taxId,
|
|
91
92
|
shippingAddress: {
|
|
92
93
|
addressLine1: translatedShippingAddress.line1,
|
|
93
94
|
addressLine2: translatedShippingAddress.line2,
|
|
@@ -170,6 +171,7 @@ export const prepCalculateLandedCost = () => {
|
|
|
170
171
|
isTest: isE2ETest,
|
|
171
172
|
items: cartStore.items,
|
|
172
173
|
landedCostAdjustments: adjustments,
|
|
174
|
+
shipToTaxId: stripeStore.taxId,
|
|
173
175
|
shippingAddress: {
|
|
174
176
|
addressLine1: translatedShippingAddress.line1,
|
|
175
177
|
addressLine2: translatedShippingAddress.line2,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getIsStagingMode = () => window.location.search.includes('zonosStagingMode=1');
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export const getIsTestMode = () => {
|
|
1
|
+
export const getIsTestMode = () => {
|
|
2
|
+
var _a;
|
|
3
|
+
return ((_a = window.Zonos.zonosApiKey) === null || _a === void 0 ? void 0 : _a.includes('test')) ||
|
|
4
|
+
window.location.search.includes('zonosTestMode=1');
|
|
5
|
+
};
|
|
@@ -10,6 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
+
import { getIsStagingMode } from "./checkout/getIsStagingMode";
|
|
14
|
+
import { getIsTestMode } from "./checkout/getIsTestMode";
|
|
13
15
|
import { fallbackApiList, getNextFallbackApiType, MAIN_BASE_API_TYPE, } from "./getNextFallbackApi";
|
|
14
16
|
import { jsonParse } from "./jsonParse";
|
|
15
17
|
import { log } from "./logging/log";
|
|
@@ -106,6 +108,23 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
106
108
|
response,
|
|
107
109
|
shouldThrow: true,
|
|
108
110
|
});
|
|
111
|
+
// Parse and access "errors" from the response if possible
|
|
112
|
+
if (data && 'errors' in data && Array.isArray(data.errors)) {
|
|
113
|
+
const errors = data.errors;
|
|
114
|
+
const mappedErrors = errors.map(error => {
|
|
115
|
+
if (typeof error === 'string') {
|
|
116
|
+
return { message: error, type: status };
|
|
117
|
+
}
|
|
118
|
+
return error;
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
baseUrl,
|
|
122
|
+
errors: mappedErrors,
|
|
123
|
+
json: null,
|
|
124
|
+
response,
|
|
125
|
+
zonosMode,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
109
128
|
const message = JSON.stringify(data);
|
|
110
129
|
return {
|
|
111
130
|
baseUrl,
|
|
@@ -182,7 +201,9 @@ export const handleFetch = async (path, _opts) => {
|
|
|
182
201
|
const body = opts.body ? JSON.stringify(opts.body) : undefined;
|
|
183
202
|
const method = opts.method || 'GET';
|
|
184
203
|
// headers content type
|
|
185
|
-
const headers = Object.assign({ 'Content-Type': 'application/json', 'Zonos-Is-BigCommerce': window.Zonos.isBigCommerce.toString(), 'Zonos-Referer': window.location.hostname, 'Zonos-Version': window.Zonos.version, credentialtoken: window.Zonos.zonosApiKey || 'Empty credential token from zonos-elements' }, opts.headers);
|
|
204
|
+
const headers = Object.assign({ 'Content-Type': 'application/json', 'Zonos-Is-BigCommerce': window.Zonos.isBigCommerce.toString(), 'Zonos-Referer': window.location.hostname, 'Zonos-Staging-Mode': getIsStagingMode() ? '1' : undefined, 'Zonos-Test-Mode': getIsTestMode() ? '1' : undefined, 'Zonos-Version': window.Zonos.version, credentialtoken: window.Zonos.zonosApiKey || 'Empty credential token from zonos-elements' }, opts.headers);
|
|
205
|
+
// filter all underfined headers
|
|
206
|
+
Object.keys(headers).forEach(key => headers[key] === undefined && delete headers[key]);
|
|
186
207
|
const options = Object.assign(Object.assign({}, opts), { body: method === 'GET' ? undefined : body, headers,
|
|
187
208
|
method });
|
|
188
209
|
// This is for testing fallback API, set fallback API type to start with
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { getIsTestMode } from "../components/utils/checkout/getIsTestMode";
|
|
1
2
|
import { handleFetch } from "../components/utils/handleFetch";
|
|
2
3
|
import { log } from "../components/utils/logging/log";
|
|
3
4
|
export const getTempCartById = async ({ cartId, retries, }) => {
|
|
4
|
-
const
|
|
5
|
-
const isTestMode = urlParams.get('zonosTestMode') === '1';
|
|
5
|
+
const isTestMode = getIsTestMode();
|
|
6
6
|
const { errors, json } = await handleFetch('/api/zonos-elements/get-temp-cart', {
|
|
7
7
|
body: { isTestMode, tempCartUUID: cartId },
|
|
8
8
|
headers: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getIsStagingMode } from "../components/utils/checkout/getIsStagingMode";
|
|
2
|
+
import { getIsTestMode } from "../components/utils/checkout/getIsTestMode";
|
|
1
3
|
import { handleFetch } from "../components/utils/handleFetch";
|
|
2
4
|
import { log } from "../components/utils/logging/log";
|
|
3
5
|
import { logError } from "../components/utils/logging/logError";
|
|
@@ -5,9 +7,10 @@ import { logError } from "../components/utils/logging/logError";
|
|
|
5
7
|
* Attempt to get test public credential to window.Zonos.zonosApiKey if needed
|
|
6
8
|
*/
|
|
7
9
|
export const getWithTestPublicCredential = async () => {
|
|
8
|
-
const isTestMode =
|
|
10
|
+
const isTestMode = getIsTestMode();
|
|
11
|
+
const isStagingMode = getIsStagingMode();
|
|
9
12
|
// Do nothing if the test mode is not enabled or the public credential
|
|
10
|
-
if (!isTestMode || !window.Zonos.zonosApiKey) {
|
|
13
|
+
if ((!isTestMode && !isStagingMode) || !window.Zonos.zonosApiKey) {
|
|
11
14
|
return null;
|
|
12
15
|
}
|
|
13
16
|
log('[ZONOS - loadZonos] Attempt test public credential', 'info');
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
const baseRe = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
2
2
|
const uuidRe = new RegExp(`^${baseRe.source}$`);
|
|
3
3
|
const cartUuidRe = new RegExp(`^cart_${baseRe.source}$`);
|
|
4
|
+
const tsidRe = /^[a-zA-Z0-9]{2,}$/;
|
|
5
|
+
const cartTsidRe = /^cart_[a-zA-Z0-9]{2,}$/;
|
|
4
6
|
export const _getIsValidCartId = (cartId) => {
|
|
5
7
|
if (!cartId) {
|
|
6
8
|
return { isDgsCartId: false, isLegacyCartId: false };
|
|
7
9
|
}
|
|
10
|
+
if (cartId.includes('undefined')) {
|
|
11
|
+
return { isDgsCartId: false, isLegacyCartId: false };
|
|
12
|
+
}
|
|
13
|
+
if (cartTsidRe.test(cartId)) {
|
|
14
|
+
return { isDgsCartId: true, isLegacyCartId: false };
|
|
15
|
+
}
|
|
16
|
+
if (tsidRe.test(cartId)) {
|
|
17
|
+
return { isDgsCartId: false, isLegacyCartId: true };
|
|
18
|
+
}
|
|
8
19
|
if (cartUuidRe.test(cartId)) {
|
|
9
20
|
return { isDgsCartId: true, isLegacyCartId: false };
|
|
10
21
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const countryRequireTaxId = [
|
|
2
|
+
'AR',
|
|
3
|
+
'BR',
|
|
4
|
+
'KR',
|
|
5
|
+
'MX',
|
|
6
|
+
];
|
|
7
|
+
export const shipToTaxIdLabels = {
|
|
8
|
+
AR: {
|
|
9
|
+
friendlyName: 'Unique Labor Identification Code',
|
|
10
|
+
placeholder: '00-00000000-0',
|
|
11
|
+
},
|
|
12
|
+
BR: {
|
|
13
|
+
friendlyName: 'CPF/CNPJ number',
|
|
14
|
+
placeholder: '000.000.000-00',
|
|
15
|
+
},
|
|
16
|
+
KR: {
|
|
17
|
+
friendlyName: 'Personal Customers Clearance Code',
|
|
18
|
+
placeholder: '000-00-00000',
|
|
19
|
+
},
|
|
20
|
+
MX: {
|
|
21
|
+
friendlyName: 'RFC number',
|
|
22
|
+
placeholder: 'XAXX010101000',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -59,6 +59,41 @@ export const allowedCharacterSets = {
|
|
|
59
59
|
All: 'ALL',
|
|
60
60
|
Latin: 'LATIN',
|
|
61
61
|
};
|
|
62
|
+
export const allowedSettlementCurrencies = {
|
|
63
|
+
Local: 'LOCAL',
|
|
64
|
+
LocalAndUsd: 'LOCAL_AND_USD',
|
|
65
|
+
};
|
|
66
|
+
export const amountDetailRefundSourceType = {
|
|
67
|
+
Discount: 'DISCOUNT',
|
|
68
|
+
DutyTaxFee: 'DUTY_TAX_FEE',
|
|
69
|
+
Item: 'ITEM',
|
|
70
|
+
Shipping: 'SHIPPING',
|
|
71
|
+
};
|
|
72
|
+
export const amountDetailSourceType = {
|
|
73
|
+
Discount: 'DISCOUNT',
|
|
74
|
+
Duty: 'DUTY',
|
|
75
|
+
DutyTaxFee: 'DUTY_TAX_FEE',
|
|
76
|
+
Fee: 'FEE',
|
|
77
|
+
Item: 'ITEM',
|
|
78
|
+
Shipping: 'SHIPPING',
|
|
79
|
+
Tax: 'TAX',
|
|
80
|
+
};
|
|
81
|
+
export const amountDetailSubtotalType = {
|
|
82
|
+
Discount: 'DISCOUNT',
|
|
83
|
+
Duty: 'DUTY',
|
|
84
|
+
Fee: 'FEE',
|
|
85
|
+
Item: 'ITEM',
|
|
86
|
+
Shipping: 'SHIPPING',
|
|
87
|
+
Tax: 'TAX',
|
|
88
|
+
};
|
|
89
|
+
export const amountDetailTarget = {
|
|
90
|
+
BillingCompany: 'BILLING_COMPANY',
|
|
91
|
+
MerchantBase: 'MERCHANT_BASE',
|
|
92
|
+
MerchantProvided: 'MERCHANT_PROVIDED',
|
|
93
|
+
MerchantSettled: 'MERCHANT_SETTLED',
|
|
94
|
+
ShopperPresented: 'SHOPPER_PRESENTED',
|
|
95
|
+
ZonosBase: 'ZONOS_BASE',
|
|
96
|
+
};
|
|
62
97
|
export const analyticsProviderStatus = {
|
|
63
98
|
Disabled: 'DISABLED',
|
|
64
99
|
Enabled: 'ENABLED',
|
|
@@ -269,6 +304,10 @@ export const catalogStatus = {
|
|
|
269
304
|
Disabled: 'DISABLED',
|
|
270
305
|
Enabled: 'ENABLED',
|
|
271
306
|
};
|
|
307
|
+
export const checkoutSessionCreationModeType = {
|
|
308
|
+
WithPaymentIntent: 'WITH_PAYMENT_INTENT',
|
|
309
|
+
WithoutPaymentIntent: 'WITHOUT_PAYMENT_INTENT',
|
|
310
|
+
};
|
|
272
311
|
export const checkoutStatus = {
|
|
273
312
|
Disabled: 'DISABLED',
|
|
274
313
|
Enabled: 'ENABLED',
|
|
@@ -604,6 +643,7 @@ export const contentType = {
|
|
|
604
643
|
Csv: 'CSV',
|
|
605
644
|
};
|
|
606
645
|
export const controlType = {
|
|
646
|
+
Carrier: 'CARRIER',
|
|
607
647
|
Export: 'EXPORT',
|
|
608
648
|
Import: 'IMPORT',
|
|
609
649
|
};
|
|
@@ -1485,8 +1525,10 @@ export const itemKeyPreference = {
|
|
|
1485
1525
|
Sku: 'SKU',
|
|
1486
1526
|
};
|
|
1487
1527
|
export const itemMeasurementType = {
|
|
1528
|
+
AlcoholByVolume: 'ALCOHOL_BY_VOLUME',
|
|
1488
1529
|
Height: 'HEIGHT',
|
|
1489
1530
|
Length: 'LENGTH',
|
|
1531
|
+
Volume: 'VOLUME',
|
|
1490
1532
|
Weight: 'WEIGHT',
|
|
1491
1533
|
Width: 'WIDTH',
|
|
1492
1534
|
};
|
|
@@ -1515,9 +1557,12 @@ export const itemUnitOfMeasure = {
|
|
|
1515
1557
|
Gram: 'GRAM',
|
|
1516
1558
|
Inch: 'INCH',
|
|
1517
1559
|
Kilogram: 'KILOGRAM',
|
|
1560
|
+
Liter: 'LITER',
|
|
1518
1561
|
Meter: 'METER',
|
|
1562
|
+
Milliliter: 'MILLILITER',
|
|
1519
1563
|
Millimeter: 'MILLIMETER',
|
|
1520
1564
|
Ounce: 'OUNCE',
|
|
1565
|
+
Percentage: 'PERCENTAGE',
|
|
1521
1566
|
Pound: 'POUND',
|
|
1522
1567
|
Yard: 'YARD',
|
|
1523
1568
|
};
|
|
@@ -1582,6 +1627,7 @@ export const landedCostFeeType = {
|
|
|
1582
1627
|
Country: 'COUNTRY',
|
|
1583
1628
|
CurrencyConversionFee: 'CURRENCY_CONVERSION_FEE',
|
|
1584
1629
|
DdpServiceFee: 'DDP_SERVICE_FEE',
|
|
1630
|
+
Discount: 'DISCOUNT',
|
|
1585
1631
|
Duty: 'DUTY',
|
|
1586
1632
|
InclusivePriceAdjustment: 'INCLUSIVE_PRICE_ADJUSTMENT',
|
|
1587
1633
|
InclusivePricing: 'INCLUSIVE_PRICING',
|
|
@@ -1615,6 +1661,7 @@ export const landedCostMethod = {
|
|
|
1615
1661
|
DdpPreferred: 'DDP_PREFERRED',
|
|
1616
1662
|
};
|
|
1617
1663
|
export const landedCostQuoteType = {
|
|
1664
|
+
Api: 'API',
|
|
1618
1665
|
Auditing: 'AUDITING',
|
|
1619
1666
|
Checkout: 'CHECKOUT',
|
|
1620
1667
|
InclusivePrice: 'INCLUSIVE_PRICE',
|
|
@@ -2168,6 +2215,7 @@ export const storeFeeRuleType = {
|
|
|
2168
2215
|
RequiredNegotiable: 'REQUIRED_NEGOTIABLE',
|
|
2169
2216
|
RequiredNonNegotiable: 'REQUIRED_NON_NEGOTIABLE',
|
|
2170
2217
|
Transitory: 'TRANSITORY',
|
|
2218
|
+
TransitoryCustom: 'TRANSITORY_CUSTOM',
|
|
2171
2219
|
};
|
|
2172
2220
|
export const stripeActiveStatus = {
|
|
2173
2221
|
Active: 'ACTIVE',
|
|
@@ -2246,7 +2294,9 @@ export const taxCalculationType = {
|
|
|
2246
2294
|
};
|
|
2247
2295
|
export const taxIdType = {
|
|
2248
2296
|
Cnp: 'CNP',
|
|
2297
|
+
Cuil: 'CUIL',
|
|
2249
2298
|
Dan: 'DAN',
|
|
2299
|
+
Dni: 'DNI',
|
|
2250
2300
|
Dtf: 'DTF',
|
|
2251
2301
|
Dun: 'DUN',
|
|
2252
2302
|
Ein: 'EIN',
|
|
@@ -2257,7 +2307,12 @@ export const taxIdType = {
|
|
|
2257
2307
|
Hmrc: 'HMRC',
|
|
2258
2308
|
Ioss: 'IOSS',
|
|
2259
2309
|
Lvg: 'LVG',
|
|
2310
|
+
Npwp: 'NPWP',
|
|
2260
2311
|
Osr: 'OSR',
|
|
2312
|
+
Pan: 'PAN',
|
|
2313
|
+
Pccc: 'PCCC',
|
|
2314
|
+
Rfc: 'RFC',
|
|
2315
|
+
Run: 'RUN',
|
|
2261
2316
|
Ssn: 'SSN',
|
|
2262
2317
|
Sta: 'STA',
|
|
2263
2318
|
Tan: 'TAN',
|
|
@@ -2430,6 +2485,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2430
2485
|
checkoutSessionCreate(variables, requestHeaders) {
|
|
2431
2486
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'checkoutSessionCreate', 'mutation');
|
|
2432
2487
|
},
|
|
2488
|
+
checkoutSessionPaymentIntentCreate(variables, requestHeaders) {
|
|
2489
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'checkoutSessionPaymentIntentCreate', 'mutation');
|
|
2490
|
+
},
|
|
2433
2491
|
checkoutSessionUpdate(variables, requestHeaders) {
|
|
2434
2492
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'checkoutSessionUpdate', 'mutation');
|
|
2435
2493
|
},
|
|
@@ -2475,12 +2533,18 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2475
2533
|
onlineStoreSettings(variables, requestHeaders) {
|
|
2476
2534
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'onlineStoreSettings', 'query');
|
|
2477
2535
|
},
|
|
2536
|
+
orderCreate(variables, requestHeaders) {
|
|
2537
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'orderCreate', 'mutation');
|
|
2538
|
+
},
|
|
2478
2539
|
orderUpdateAccountOrderNumber(variables, requestHeaders) {
|
|
2479
2540
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'orderUpdateAccountOrderNumber', 'mutation');
|
|
2480
2541
|
},
|
|
2481
2542
|
organization(variables, requestHeaders) {
|
|
2482
2543
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'organization', 'query');
|
|
2483
2544
|
},
|
|
2545
|
+
partyInfo(variables, requestHeaders) {
|
|
2546
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'partyInfo', 'query');
|
|
2547
|
+
},
|
|
2484
2548
|
paypalOrderCapture(variables, requestHeaders) {
|
|
2485
2549
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'paypalOrderCapture', 'mutation');
|
|
2486
2550
|
},
|
|
@@ -6,9 +6,11 @@ export * from './checkout/api/CheckoutSession';
|
|
|
6
6
|
export * from './checkout/api/legacy/InventoryCheck';
|
|
7
7
|
export * from './checkout/api/NormalizedTempCart';
|
|
8
8
|
export * from './checkout/api/Paypal';
|
|
9
|
+
export * from './checkout/api/PlaceTestOrder';
|
|
9
10
|
export * from './checkout/api/StoreDiscountEnabled';
|
|
10
11
|
export * from './checkout/api/ValidateAddress';
|
|
11
12
|
export * from './checkout/CheckoutConfig';
|
|
13
|
+
export * from './checkout/TaxId';
|
|
12
14
|
export * from './ConversionEvent';
|
|
13
15
|
export * from './hello/HelloConfig';
|
|
14
16
|
export * from './JsonError';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { h as handleFetch, l as log,
|
|
1
|
+
import { g as getIsTestMode, h as handleFetch, l as log, b as logError } from './handleFetch-b4633675.js';
|
|
2
2
|
|
|
3
3
|
const getTempCartById = async ({ cartId, retries, }) => {
|
|
4
|
-
const
|
|
5
|
-
const isTestMode = urlParams.get('zonosTestMode') === '1';
|
|
4
|
+
const isTestMode = getIsTestMode();
|
|
6
5
|
const { errors, json } = await handleFetch('/api/zonos-elements/get-temp-cart', {
|
|
7
6
|
body: { isTestMode, tempCartUUID: cartId },
|
|
8
7
|
headers: {
|
|
@@ -28,10 +27,21 @@ const getTempCartById = async ({ cartId, retries, }) => {
|
|
|
28
27
|
const baseRe = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
29
28
|
const uuidRe = new RegExp(`^${baseRe.source}$`);
|
|
30
29
|
const cartUuidRe = new RegExp(`^cart_${baseRe.source}$`);
|
|
30
|
+
const tsidRe = /^[a-zA-Z0-9]{2,}$/;
|
|
31
|
+
const cartTsidRe = /^cart_[a-zA-Z0-9]{2,}$/;
|
|
31
32
|
const _getIsValidCartId = (cartId) => {
|
|
32
33
|
if (!cartId) {
|
|
33
34
|
return { isDgsCartId: false, isLegacyCartId: false };
|
|
34
35
|
}
|
|
36
|
+
if (cartId.includes('undefined')) {
|
|
37
|
+
return { isDgsCartId: false, isLegacyCartId: false };
|
|
38
|
+
}
|
|
39
|
+
if (cartTsidRe.test(cartId)) {
|
|
40
|
+
return { isDgsCartId: true, isLegacyCartId: false };
|
|
41
|
+
}
|
|
42
|
+
if (tsidRe.test(cartId)) {
|
|
43
|
+
return { isDgsCartId: false, isLegacyCartId: true };
|
|
44
|
+
}
|
|
35
45
|
if (cartUuidRe.test(cartId)) {
|
|
36
46
|
return { isDgsCartId: true, isLegacyCartId: false };
|
|
37
47
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const countryRequireTaxId = [
|
|
2
|
+
'AR',
|
|
3
|
+
'BR',
|
|
4
|
+
'KR',
|
|
5
|
+
'MX',
|
|
6
|
+
];
|
|
7
|
+
const shipToTaxIdLabels = {
|
|
8
|
+
AR: {
|
|
9
|
+
friendlyName: 'Unique Labor Identification Code',
|
|
10
|
+
placeholder: '00-00000000-0',
|
|
11
|
+
},
|
|
12
|
+
BR: {
|
|
13
|
+
friendlyName: 'CPF/CNPJ number',
|
|
14
|
+
placeholder: '000.000.000-00',
|
|
15
|
+
},
|
|
16
|
+
KR: {
|
|
17
|
+
friendlyName: 'Personal Customers Clearance Code',
|
|
18
|
+
placeholder: '000-00-00000',
|
|
19
|
+
},
|
|
20
|
+
MX: {
|
|
21
|
+
friendlyName: 'RFC number',
|
|
22
|
+
placeholder: 'XAXX010101000',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { countryRequireTaxId as c, shipToTaxIdLabels as s };
|