@zonos/elements 1.4.2 → 1.5.1
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/{TaxId-Q6aDqqWv.js → TaxId-ChhNwG04.js} +36 -0
- package/dist/cjs/{cart-B6Aty-21.js → cart-CiXlehwQ.js} +88 -52
- package/dist/cjs/{collect-DnrvaXUI.js → collect-Drr8fY-q.js} +3 -3
- package/dist/cjs/{debounce-Cd2emZPn.js → debounce-BhgA8_3W.js} +2 -2
- package/dist/cjs/{debounce-vY0QYT6o.js → debounce-DRPMxNew.js} +1 -1
- package/dist/cjs/{getBorderRadius-CyYZw4qq.js → getBorderRadius-CJ_95w3o.js} +1 -1
- package/dist/cjs/{getMissingRequiredShippingFields-D03ICqss.js → getMissingRequiredShippingFields-DI6qF1z3.js} +1 -1
- package/dist/cjs/{hasInclusivePrice-CPCoVeU3.js → hasInclusivePrice-84KS94yH.js} +1 -1
- package/dist/cjs/index.cjs.js +19 -8
- package/dist/cjs/{invoice-Cj8W7NW0.js → invoice-5hVfSXpb.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-BzNeXeDe.js → localization-B2mjW0Xa.js} +701 -41
- package/dist/cjs/{paypal-CuKshRmZ.js → paypal-pd8Nz_R_.js} +4 -4
- package/dist/cjs/{placeTestOrder-7czjwkjm.js → placeTestOrder-DrI8rD9o.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-BH8t2b2x.js → renderCheckoutCurrency-u5q8YdUb.js} +2 -2
- package/dist/cjs/shouldRenderShortAddressCodeInput-gpu_bMfp.js +21 -0
- package/dist/cjs/{shouldShowLanguageSelect-yAbtCmd8.js → shouldShowLanguageSelect-gBg4KeTQ.js} +1 -1
- package/dist/cjs/{submitGtag-D79e8u6s.js → submitGtag-Rc-S3PnH.js} +1 -1
- package/dist/cjs/{throttle-zSVRQLC0.js → taxIdFields-BrIaPTcd.js} +57 -2
- package/dist/cjs/taxIdRules-BBj8kQxJ.js +58 -0
- package/dist/cjs/{updateCheckoutSessionAttributes-jMtfOL2m.js → updateCheckoutSessionAttributes-d0IKpwW8.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +25 -30
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-address_4.cjs.entry.js +27 -30
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +7 -6
- 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 +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +8 -7
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +148 -80
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +31 -20
- package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -5
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
- package/dist/cjs/zonos-collect.cjs.entry.js +9 -8
- package/dist/cjs/zonos-controller.cjs.entry.js +7 -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 +4 -4
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -7
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
- package/dist/cjs/zonos-invoice.cjs.entry.js +9 -8
- 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-policy-consent_2.cjs.entry.js +7 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +2 -2
- 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-Bx9jK82G.js → zonosStore-CDV83QyK.js} +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +10 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +6 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +12 -4
- package/dist/collection/components/store/checkout/stripe.js +10 -12
- package/dist/collection/components/store/translationStore/strings.arabic.js +35 -2
- package/dist/collection/components/store/translationStore/strings.base.js +35 -2
- package/dist/collection/components/store/translationStore/strings.chinese.js +35 -2
- package/dist/collection/components/store/translationStore/strings.danish.js +35 -2
- package/dist/collection/components/store/translationStore/strings.dutch.js +35 -2
- package/dist/collection/components/store/translationStore/strings.french.js +35 -2
- package/dist/collection/components/store/translationStore/strings.german.js +35 -2
- package/dist/collection/components/store/translationStore/strings.hebrew.js +35 -2
- package/dist/collection/components/store/translationStore/strings.indonesian.js +35 -2
- package/dist/collection/components/store/translationStore/strings.italian.js +35 -2
- package/dist/collection/components/store/translationStore/strings.japanese.js +35 -2
- package/dist/collection/components/store/translationStore/strings.korean.js +35 -2
- package/dist/collection/components/store/translationStore/strings.norwegian.js +35 -2
- package/dist/collection/components/store/translationStore/strings.polish.js +35 -2
- package/dist/collection/components/store/translationStore/strings.portuguese.js +35 -2
- package/dist/collection/components/store/translationStore/strings.russian.js +35 -2
- package/dist/collection/components/store/translationStore/strings.spanish.js +35 -2
- package/dist/collection/components/store/translationStore/strings.swedish.js +35 -2
- package/dist/collection/components/store/translationStore/strings.turkish.js +35 -2
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +35 -2
- package/dist/collection/components/store/zonosStore.js +2 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.css +5 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +37 -22
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +5 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +34 -21
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +24 -35
- package/dist/collection/components/utils/checkout/getCheckoutTaxIdPayload.js +16 -0
- package/dist/collection/components/utils/checkout/getTaxIdFieldState.js +26 -0
- package/dist/collection/components/utils/checkout/isHostedVsNativeTestAllowed.js +13 -0
- package/dist/collection/components/utils/checkout/itemCustomization.js +53 -0
- package/dist/collection/components/utils/checkout/parseItemCustomizations.js +6 -0
- package/dist/collection/components/utils/checkout/resolveTaxIdSelection.js +23 -0
- package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +7 -11
- package/dist/collection/components/utils/checkout/taxIdFields.js +29 -0
- package/dist/collection/components/utils/taxId/taxIdRules.js +44 -0
- package/dist/collection/components/utils/taxIdValidationResult.js +57 -58
- package/dist/collection/index.js +1 -0
- package/dist/collection/types/checkout/TaxId.js +31 -0
- package/dist/collection/types/checkout/itemCustomization.js +1 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/{TaxId-Cye-evFK.js → TaxId-DMIgN_sT.js} +32 -1
- package/dist/esm/{cart-BoQp8Ema.js → cart-DmJkjiDE.js} +88 -53
- package/dist/esm/{collect-Eo4gtyql.js → collect-BV5GTPmh.js} +3 -3
- package/dist/esm/{debounce-BR3PaG8X.js → debounce-DHj2iHA1.js} +1 -1
- package/dist/esm/{debounce-CrmpwbEE.js → debounce-DWqMT4lo.js} +2 -2
- package/dist/esm/{getBorderRadius-DYfkeXdx.js → getBorderRadius-BiGd45jw.js} +1 -1
- package/dist/esm/{getMissingRequiredShippingFields-Ks6_tpjn.js → getMissingRequiredShippingFields-DljgpDZe.js} +1 -1
- package/dist/esm/{hasInclusivePrice-CbEfIhI5.js → hasInclusivePrice-DhGXpH2D.js} +1 -1
- package/dist/esm/index.js +9 -8
- package/dist/esm/{invoice-S1KahJ_Z.js → invoice-CO-iqlni.js} +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-BIh-4pc_.js → localization-DHM91diu.js} +701 -41
- package/dist/esm/{paypal-DNfvnuUU.js → paypal-BfW5aLJw.js} +4 -4
- package/dist/esm/{placeTestOrder-CQaMKFOg.js → placeTestOrder-CyWUFhxD.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-C2Tw73uR.js → renderCheckoutCurrency-B31ZNkUv.js} +2 -2
- package/dist/esm/shouldRenderShortAddressCodeInput-Bc8k2vN0.js +19 -0
- package/dist/esm/{shouldShowLanguageSelect-CCD7gpSY.js → shouldShowLanguageSelect-DwSfSHar.js} +1 -1
- package/dist/esm/{submitGtag-df9AQ2zL.js → submitGtag-BEFrutel.js} +1 -1
- package/dist/esm/taxIdFields-ByEYfsO5.js +139 -0
- package/dist/esm/taxIdRules-xYlx7ZXW.js +47 -0
- package/dist/esm/{updateCheckoutSessionAttributes-4Jq6V4pO.js → updateCheckoutSessionAttributes-B0bQH0uw.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +23 -28
- package/dist/esm/zonos-address-display_2.entry.js +3 -3
- package/dist/esm/zonos-address_4.entry.js +25 -28
- package/dist/esm/zonos-airwallex-payment.entry.js +7 -6
- 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 +2 -2
- package/dist/esm/zonos-card_5.entry.js +8 -7
- package/dist/esm/zonos-cart-items_12.entry.js +147 -79
- package/dist/esm/zonos-checkbox_2.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +31 -20
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -5
- package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
- package/dist/esm/zonos-collect.entry.js +9 -8
- package/dist/esm/zonos-controller.entry.js +7 -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 +4 -4
- package/dist/esm/zonos-hello.entry.js +4 -4
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -7
- package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
- package/dist/esm/zonos-invoice.entry.js +9 -8
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +7 -6
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-msUlqmSD.js → zonosStore-BXP9FvIt.js} +2 -1
- package/dist/esm-es5/{TaxId-Cye-evFK.js → TaxId-DMIgN_sT.js} +2 -1
- package/dist/esm-es5/{cart-BoQp8Ema.js → cart-DmJkjiDE.js} +64 -53
- package/dist/esm-es5/{collect-Eo4gtyql.js → collect-BV5GTPmh.js} +1 -1
- package/dist/esm-es5/{debounce-BR3PaG8X.js → debounce-DHj2iHA1.js} +7 -7
- package/dist/esm-es5/debounce-DWqMT4lo.js +1 -0
- package/dist/esm-es5/getBorderRadius-BiGd45jw.js +8 -0
- package/dist/esm-es5/{getMissingRequiredShippingFields-Ks6_tpjn.js → getMissingRequiredShippingFields-DljgpDZe.js} +3 -3
- package/dist/esm-es5/{hasInclusivePrice-CbEfIhI5.js → hasInclusivePrice-DhGXpH2D.js} +1 -1
- package/dist/esm-es5/index.js +11 -11
- package/dist/esm-es5/{invoice-S1KahJ_Z.js → invoice-CO-iqlni.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-DHM91diu.js +348 -0
- package/dist/esm-es5/{paypal-DNfvnuUU.js → paypal-BfW5aLJw.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-CQaMKFOg.js → placeTestOrder-CyWUFhxD.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-C2Tw73uR.js → renderCheckoutCurrency-B31ZNkUv.js} +2 -2
- package/dist/esm-es5/shouldRenderShortAddressCodeInput-Bc8k2vN0.js +8 -0
- package/dist/esm-es5/{shouldShowLanguageSelect-CCD7gpSY.js → shouldShowLanguageSelect-DwSfSHar.js} +1 -1
- package/dist/esm-es5/{submitGtag-df9AQ2zL.js → submitGtag-BEFrutel.js} +1 -1
- package/dist/esm-es5/taxIdFields-ByEYfsO5.js +46 -0
- package/dist/esm-es5/taxIdRules-xYlx7ZXW.js +6 -0
- package/dist/esm-es5/{updateCheckoutSessionAttributes-4Jq6V4pO.js → updateCheckoutSessionAttributes-B0bQH0uw.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +253 -254
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +8 -9
- package/dist/esm-es5/zonos-airwallex-payment.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 +40 -26
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +7 -7
- 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 +2 -2
- 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 +2 -2
- 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 -1
- 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-msUlqmSD.js → zonosStore-BXP9FvIt.js} +1 -1
- package/dist/scripts/index.d.ts +97 -1
- 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-customer-info/zonos-customer-info.d.ts +4 -0
- package/dist/types/components/store/checkout/stripe.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.base.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.danish.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.french.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.german.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.italian.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.korean.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.polish.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.russian.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +34 -1
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +34 -1
- package/dist/types/components/store/zonosStore.d.ts +2 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +4 -1
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +4 -1
- package/dist/types/components/utils/checkout/getCheckoutTaxIdPayload.d.ts +6 -0
- package/dist/types/components/utils/checkout/getTaxIdFieldState.d.ts +18 -0
- package/dist/types/components/utils/checkout/isHostedVsNativeTestAllowed.d.ts +11 -0
- package/dist/types/components/utils/checkout/itemCustomization.d.ts +23 -0
- package/dist/types/components/utils/checkout/parseItemCustomizations.d.ts +7 -0
- package/dist/types/components/utils/checkout/resolveTaxIdSelection.d.ts +12 -0
- package/dist/types/components/utils/checkout/shouldRenderTaxIdInput.d.ts +2 -1
- package/dist/types/components/utils/checkout/taxIdFields.d.ts +11 -0
- package/dist/types/components/utils/taxId/taxIdRules.d.ts +37 -0
- package/dist/types/components/utils/taxIdValidationResult.d.ts +8 -2
- package/dist/types/components.d.ts +22 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/checkout/TaxId.d.ts +45 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +11 -0
- package/dist/types/types/checkout/api/CreateParty.d.ts +2 -0
- package/dist/types/types/checkout/itemCustomization.d.ts +4 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +5 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-7bd99479.system.entry.js → p-064d8829.system.entry.js} +26 -26
- package/dist/zonos-elements/p-107f287b.entry.js +1 -0
- package/dist/zonos-elements/{p-51400242.system.entry.js → p-1199baef.system.entry.js} +3 -3
- package/dist/zonos-elements/p-12b24ebb.entry.js +1 -0
- package/dist/zonos-elements/{p-9c33f7ed.system.entry.js → p-189cc594.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d3d0656a.entry.js → p-1a5acbcd.entry.js} +1 -1
- package/dist/zonos-elements/{p-11defdca.system.entry.js → p-1cc42a98.system.entry.js} +18 -18
- package/dist/zonos-elements/p-1e6db427.entry.js +1 -0
- package/dist/zonos-elements/{p-5016d71b.system.entry.js → p-1fda4aec.system.entry.js} +132 -117
- package/dist/zonos-elements/{p-756d303f.system.entry.js → p-20eb00de.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5967a1c1.system.entry.js → p-216a908d.system.entry.js} +5 -5
- package/dist/zonos-elements/p-25eb99d4.entry.js +1 -0
- package/dist/zonos-elements/{p-23352709.system.entry.js → p-2b63865a.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-6db7c0b1.system.entry.js → p-2ca826b9.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-6c41b00c.entry.js → p-2d513aa3.entry.js} +1 -1
- package/dist/zonos-elements/{p-c961caaf.entry.js → p-3e705c9b.entry.js} +1 -1
- package/dist/zonos-elements/{p-acd50b0b.entry.js → p-4612facd.entry.js} +1 -1
- package/dist/zonos-elements/{p-5b80aff2.system.entry.js → p-46a839d2.system.entry.js} +24 -24
- package/dist/zonos-elements/p-46b9f0cf.entry.js +1 -0
- package/dist/zonos-elements/{p-244e0302.system.entry.js → p-4715045c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d168023b.entry.js → p-4917b74d.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b81f8b9.system.entry.js → p-53eac12f.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-17c7ea4a.system.entry.js → p-55813e9f.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-06030d3b.system.entry.js → p-5585db86.system.entry.js} +45 -45
- package/dist/zonos-elements/p-59fc32af.entry.js +1 -0
- package/dist/zonos-elements/{p-193d9722.entry.js → p-61312d5b.entry.js} +1 -1
- package/dist/zonos-elements/p-636b71d4.entry.js +1 -0
- package/dist/zonos-elements/{p-155ed3d3.system.entry.js → p-6410fa11.system.entry.js} +24 -24
- package/dist/zonos-elements/{p-0fca452b.entry.js → p-65817880.entry.js} +1 -1
- package/dist/zonos-elements/p-678b9214.entry.js +1 -0
- package/dist/zonos-elements/p-6e691736.entry.js +1 -0
- package/dist/zonos-elements/p-6vSUiBfr.system.js +348 -0
- package/dist/zonos-elements/p-74659d88.entry.js +1 -0
- package/dist/zonos-elements/p-7dc7f328.entry.js +1 -0
- package/dist/zonos-elements/{p-55916c90.entry.js → p-7f1bea9b.entry.js} +1 -1
- package/dist/zonos-elements/{p-1c150f26.entry.js → p-821e413a.entry.js} +1 -1
- package/dist/zonos-elements/{p-c403f004.system.entry.js → p-82e45d0c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-84e76348.entry.js +1 -0
- package/dist/zonos-elements/{p-1409de3b.system.entry.js → p-88e20e99.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-195f6e38.system.entry.js → p-89a3c4db.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4679f0ec.entry.js → p-8f9d8795.entry.js} +1 -1
- package/dist/zonos-elements/p-8fa6cfff.entry.js +1 -0
- package/dist/zonos-elements/{p-92fe9a1f.system.entry.js → p-902cca23.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0a4a7742.system.entry.js → p-93860183.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-69c3e367.system.entry.js → p-941a95a1.system.entry.js} +10 -10
- package/dist/zonos-elements/{p-b5882fbb.system.entry.js → p-9449b4f4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6abec43f.system.entry.js → p-960070d0.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-1bac5ac1.system.entry.js → p-990fcf81.system.entry.js} +1 -1
- package/dist/zonos-elements/p-BD-9rD53.js +1 -0
- package/dist/zonos-elements/p-BMPYH-LT.js +1 -0
- package/dist/zonos-elements/{p-DI2vXnXc.system.js → p-BrQ8n8NS.system.js} +3 -3
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +2 -2
- package/dist/zonos-elements/{p-CUaf1cEg.js → p-C70h5mKA.js} +1 -1
- package/dist/zonos-elements/{p-B4Ufchqh.system.js → p-C9XLkmmb.system.js} +3 -3
- package/dist/zonos-elements/{p-CZD8WvyY.system.js → p-CBUz18kA.system.js} +1 -1
- package/dist/zonos-elements/{p-kaOxUR9u.system.js → p-CGNVm52g.system.js} +6 -6
- package/dist/zonos-elements/p-CHKKvuiz.js +1 -0
- package/dist/zonos-elements/{p-0mGRBGcf.js → p-CMo3ZweU.js} +1 -1
- package/dist/zonos-elements/p-CTiqplrr.js +1 -0
- package/dist/zonos-elements/p-CYxMfUL7.system.js +1 -0
- package/dist/zonos-elements/{p-D4MevhAL.system.js → p-CbhN65lj.system.js} +3 -3
- package/dist/zonos-elements/p-Ch1w0Lr7.js +1 -0
- package/dist/zonos-elements/{p-W82paT5F.js → p-CqB9AfBf.js} +1 -1
- package/dist/zonos-elements/p-CzKlS3E-.system.js +6 -0
- package/dist/zonos-elements/p-D1SmY_fZ.js +1 -0
- package/dist/zonos-elements/{p-sz4L-ZnB.js → p-D1e9zNDA.js} +1 -1
- package/dist/zonos-elements/{p-c9QtIdJX.js → p-D6xXnsM_.js} +1 -1
- package/dist/zonos-elements/{p-8PPEbm_0.system.js → p-DIab60nK.system.js} +12 -12
- package/dist/zonos-elements/{p-Cye-evFK.js → p-DMIgN_sT.js} +1 -1
- package/dist/zonos-elements/{p-DCS8qcL6.system.js → p-DQrMfUzi.system.js} +41 -41
- package/dist/zonos-elements/{p-BuU_p5DP.system.js → p-DTgUqgwV.system.js} +2 -2
- package/dist/zonos-elements/p-DW7I0zOF.js +1 -0
- package/dist/zonos-elements/p-DZdkJHK9.system.js +7 -0
- package/dist/zonos-elements/{p-XqkqjeNV.system.js → p-DgUrB-1a.system.js} +1 -1
- package/dist/zonos-elements/p-DiMEP3mh.js +1 -0
- package/dist/zonos-elements/p-DprOoI2W.system.js +528 -0
- package/dist/zonos-elements/{p-7abqRc9V.js → p-DpwmHU8R.js} +2 -2
- package/dist/zonos-elements/p-DqVePqqx.system.js +8 -0
- package/dist/zonos-elements/{p-Cby4EkFu.system.js → p-DsBuZ6ob.system.js} +2 -1
- package/dist/zonos-elements/{p-XDxdMlQl.system.js → p-Dtu_Japy.system.js} +39 -39
- package/dist/zonos-elements/p-Dwg61Ft_.js +1 -0
- package/dist/zonos-elements/p-U33isUJG.js +1 -0
- package/dist/zonos-elements/{p-Be3Hpms1.system.js → p-XoQH3S7Z.system.js} +1 -1
- package/dist/zonos-elements/{p-474e8a92.system.entry.js → p-a1022808.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-83aa1c8c.entry.js → p-ad04bba2.entry.js} +1 -1
- package/dist/zonos-elements/{p-a938c174.entry.js → p-b51010b9.entry.js} +1 -1
- package/dist/zonos-elements/{p-dfc87b10.system.entry.js → p-c33b8f6a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a40fd99b.system.entry.js → p-cccaad60.system.entry.js} +39 -40
- package/dist/zonos-elements/p-d3345b2c.entry.js +1 -0
- package/dist/zonos-elements/{p-249c1ee1.system.entry.js → p-d8f375da.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-2603dce0.entry.js → p-e216cc8c.entry.js} +1 -1
- package/dist/zonos-elements/{p-b79036fc.entry.js → p-e7fdb2c9.entry.js} +1 -1
- package/dist/zonos-elements/p-ebe157b5.entry.js +1 -0
- package/dist/zonos-elements/p-ef5344ea.entry.js +1 -0
- package/dist/zonos-elements/{p-be1237fc.system.entry.js → p-f3d9a380.system.entry.js} +97 -97
- package/dist/zonos-elements/{p-31043c2e.system.entry.js → p-f5f95990.system.entry.js} +296 -297
- package/dist/zonos-elements/p-fda89981.system.entry.js +13 -0
- package/dist/zonos-elements/{p-d4d2b39e.entry.js → p-fddf3556.entry.js} +1 -1
- package/dist/zonos-elements/p-iAIzUA4k.js +1 -0
- package/dist/zonos-elements/{p-BpDCLBwW.js → p-n5PZKz1k.js} +1 -1
- package/dist/zonos-elements/{p-DoEHepOc.system.js → p-ojtNq-r5.system.js} +1 -1
- package/dist/zonos-elements/{p-C_z9WL8a.js → p-r-YGHhLa.js} +1 -1
- package/dist/zonos-elements/{p-CBx5nYet.system.js → p-vTIygnHq.system.js} +1 -1
- package/dist/zonos-elements/{p-DQZncB2d.system.js → p-zsTASoh2.system.js} +3 -3
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/item-customization.d.ts +25 -0
- package/item-customization.js +52 -0
- package/package.json +7 -4
- package/dist/cjs/shouldRenderTaxIdInput-TxekHCp7.js +0 -43
- package/dist/esm/shouldRenderTaxIdInput-CKyZ6Zni.js +0 -40
- package/dist/esm/throttle-Cvlvb-dm.js +0 -85
- package/dist/esm-es5/debounce-CrmpwbEE.js +0 -1
- package/dist/esm-es5/getBorderRadius-DYfkeXdx.js +0 -8
- package/dist/esm-es5/localization-BIh-4pc_.js +0 -348
- package/dist/esm-es5/shouldRenderTaxIdInput-CKyZ6Zni.js +0 -17
- package/dist/esm-es5/throttle-Cvlvb-dm.js +0 -46
- package/dist/zonos-elements/p-0457f579.entry.js +0 -1
- package/dist/zonos-elements/p-06fe2939.entry.js +0 -1
- package/dist/zonos-elements/p-24f3c547.entry.js +0 -1
- package/dist/zonos-elements/p-34656e6c.entry.js +0 -1
- package/dist/zonos-elements/p-39ee1558.entry.js +0 -1
- package/dist/zonos-elements/p-3a2da031.entry.js +0 -1
- package/dist/zonos-elements/p-4806b264.system.entry.js +0 -13
- package/dist/zonos-elements/p-725e29bb.entry.js +0 -1
- package/dist/zonos-elements/p-BGktDPwA.system.js +0 -1
- package/dist/zonos-elements/p-Bi-s0fp_.system.js +0 -17
- package/dist/zonos-elements/p-CEK_Wk6v.system.js +0 -7
- package/dist/zonos-elements/p-CFbfEmjN.js +0 -1
- package/dist/zonos-elements/p-CcJF6xhQ.js +0 -1
- package/dist/zonos-elements/p-Cxuiqv1I.js +0 -1
- package/dist/zonos-elements/p-D-bZg-Pc.js +0 -1
- package/dist/zonos-elements/p-DOD2I44l.system.js +0 -348
- package/dist/zonos-elements/p-DS-qw_qc.system.js +0 -517
- package/dist/zonos-elements/p-DZ2mevDK.js +0 -1
- package/dist/zonos-elements/p-DnjGkbEy.js +0 -1
- package/dist/zonos-elements/p-FRWZayxL.js +0 -1
- package/dist/zonos-elements/p-Mrz_lnC1.js +0 -1
- package/dist/zonos-elements/p-ad9ff14c.entry.js +0 -1
- package/dist/zonos-elements/p-bb3546c0.entry.js +0 -1
- package/dist/zonos-elements/p-c1cbfdba.entry.js +0 -1
- package/dist/zonos-elements/p-c47ce656.entry.js +0 -1
- package/dist/zonos-elements/p-c9d5d8f1.entry.js +0 -1
- package/dist/zonos-elements/p-clDfq9AL.js +0 -1
- package/dist/zonos-elements/p-d74bc3e8.entry.js +0 -1
- package/dist/zonos-elements/p-d8b312e5.entry.js +0 -1
- package/dist/zonos-elements/p-db87b0dd.entry.js +0 -1
- package/dist/zonos-elements/p-defc2d18.entry.js +0 -1
- package/dist/zonos-elements/p-rVp8hgWw.js +0 -1
|
@@ -2,9 +2,19 @@ import { cartStore } from "../../store/checkout/cart";
|
|
|
2
2
|
import { stripeStore } from "../../store/checkout/stripe";
|
|
3
3
|
import { localizationStore } from "../../store/hello/localization";
|
|
4
4
|
import { storageStore } from "../../store/storageStore";
|
|
5
|
+
import { getCheckoutTaxIdPayload } from "../checkout/getCheckoutTaxIdPayload";
|
|
5
6
|
import { extractName } from "../extractName";
|
|
6
7
|
import { getOverridenZCountry } from "../getOverridenZCountry";
|
|
7
8
|
import { log } from "../logging/log";
|
|
9
|
+
const shipToTaxIdFields = (countryCode) => {
|
|
10
|
+
const taxIdPayload = getCheckoutTaxIdPayload(countryCode);
|
|
11
|
+
if (!taxIdPayload) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
return Object.assign({ shipToTaxId: taxIdPayload.taxId }, (taxIdPayload.taxIdType
|
|
15
|
+
? { shipToTaxIdType: taxIdPayload.taxIdType }
|
|
16
|
+
: {}));
|
|
17
|
+
};
|
|
8
18
|
/**
|
|
9
19
|
* Extract value from translated object
|
|
10
20
|
*/
|
|
@@ -55,16 +65,15 @@ export const prepCartCalculateLandedCost = (cartId) => {
|
|
|
55
65
|
name: translatedBillingAddress.name,
|
|
56
66
|
});
|
|
57
67
|
const checkoutSessionCountry = getOverridenZCountry() || 'US';
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
const shipToTaxId = shipToTaxIdFields(translatedShippingAddress.country);
|
|
69
|
+
return Object.assign(Object.assign({ billingAddress: {
|
|
60
70
|
addressLine1: translatedBillingAddress.line1,
|
|
61
71
|
addressLine2: translatedBillingAddress.line2 || '',
|
|
62
72
|
city: translatedBillingAddress.city,
|
|
63
73
|
country: translatedBillingAddress.country,
|
|
64
74
|
postalCode: translatedBillingAddress.postal_code,
|
|
65
75
|
state: translatedBillingAddress.state,
|
|
66
|
-
},
|
|
67
|
-
billingContact: {
|
|
76
|
+
}, billingContact: {
|
|
68
77
|
// firstName and lastName should be valid now since stripe only mark
|
|
69
78
|
// the address as complete when both fields are filled.
|
|
70
79
|
firstName: billingFirstName,
|
|
@@ -72,13 +81,9 @@ export const prepCartCalculateLandedCost = (cartId) => {
|
|
|
72
81
|
phone: translatedBillingAddress.phone,
|
|
73
82
|
},
|
|
74
83
|
// Use the first item's currency code
|
|
75
|
-
cartCurrencyCode: (_a = cartStore.items[0]) === null || _a === void 0 ? void 0 : _a.currencyCode,
|
|
76
|
-
cartId,
|
|
77
|
-
checkoutSessionCountry: checkoutSessionCountry ||
|
|
84
|
+
cartCurrencyCode: (_a = cartStore.items[0]) === null || _a === void 0 ? void 0 : _a.currencyCode, cartId, checkoutSessionCountry: checkoutSessionCountry ||
|
|
78
85
|
localizationStore.selectedCountryCode ||
|
|
79
|
-
undefined,
|
|
80
|
-
checkoutSessionId: storageStore.checkoutSessionId || '',
|
|
81
|
-
contact: {
|
|
86
|
+
undefined, checkoutSessionId: storageStore.checkoutSessionId || '', contact: {
|
|
82
87
|
companyName: stripeStore.companyName,
|
|
83
88
|
email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
|
|
84
89
|
// firstName and lastName should be valid now since stripe only mark
|
|
@@ -86,9 +91,7 @@ export const prepCartCalculateLandedCost = (cartId) => {
|
|
|
86
91
|
firstName: shippingFirstName,
|
|
87
92
|
lastName: shippingLastName,
|
|
88
93
|
phone: translatedShippingAddress.phone,
|
|
89
|
-
},
|
|
90
|
-
isTest: !!isE2ETest,
|
|
91
|
-
landedCostAdjustments: cartStore.promoCode
|
|
94
|
+
}, isTest: !!isE2ETest, landedCostAdjustments: cartStore.promoCode
|
|
92
95
|
? [
|
|
93
96
|
{
|
|
94
97
|
amount: 0,
|
|
@@ -98,18 +101,14 @@ export const prepCartCalculateLandedCost = (cartId) => {
|
|
|
98
101
|
type: 'PROMO_CODE',
|
|
99
102
|
},
|
|
100
103
|
]
|
|
101
|
-
: [],
|
|
102
|
-
shipToShortAddressCode: stripeStore.shortAddressCode,
|
|
103
|
-
shipToTaxId: stripeStore.taxId,
|
|
104
|
-
shippingAddress: {
|
|
104
|
+
: [], shipToShortAddressCode: stripeStore.shortAddressCode }, shipToTaxId), { shippingAddress: {
|
|
105
105
|
addressLine1: translatedShippingAddress.line1,
|
|
106
106
|
addressLine2: translatedShippingAddress.line2,
|
|
107
107
|
city: translatedShippingAddress.city,
|
|
108
108
|
country: translatedShippingAddress.country,
|
|
109
109
|
postalCode: translatedShippingAddress.postal_code,
|
|
110
110
|
state: translatedShippingAddress.state,
|
|
111
|
-
}
|
|
112
|
-
};
|
|
111
|
+
} });
|
|
113
112
|
};
|
|
114
113
|
export const prepCalculateLandedCost = () => {
|
|
115
114
|
const isE2ETest = new URLSearchParams(window.location.search).get('zonosE2ETest') === '1';
|
|
@@ -157,24 +156,21 @@ export const prepCalculateLandedCost = () => {
|
|
|
157
156
|
...convertedCartAdjuments,
|
|
158
157
|
]
|
|
159
158
|
: convertedCartAdjuments;
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
const shipToTaxId = shipToTaxIdFields(translatedShippingAddress.country);
|
|
160
|
+
return Object.assign(Object.assign({ billingAddress: {
|
|
162
161
|
addressLine1: translatedBillingAddress.line1,
|
|
163
162
|
addressLine2: translatedBillingAddress.line2 || '',
|
|
164
163
|
city: translatedBillingAddress.city,
|
|
165
164
|
country: translatedBillingAddress.country,
|
|
166
165
|
postalCode: translatedBillingAddress.postal_code,
|
|
167
166
|
state: translatedBillingAddress.state,
|
|
168
|
-
},
|
|
169
|
-
billingContact: {
|
|
167
|
+
}, billingContact: {
|
|
170
168
|
// firstName and lastName should be valid now since stripe only mark
|
|
171
169
|
// the address as complete when both fields are filled.
|
|
172
170
|
firstName: billingFirstName,
|
|
173
171
|
lastName: billingLastName,
|
|
174
172
|
phone: translatedBillingAddress.phone,
|
|
175
|
-
},
|
|
176
|
-
checkoutSessionId: storageStore.checkoutSessionId || '',
|
|
177
|
-
contact: {
|
|
173
|
+
}, checkoutSessionId: storageStore.checkoutSessionId || '', contact: {
|
|
178
174
|
companyName: stripeStore.companyName,
|
|
179
175
|
email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
|
|
180
176
|
// firstName and lastName should be valid now since stripe only mark
|
|
@@ -182,19 +178,12 @@ export const prepCalculateLandedCost = () => {
|
|
|
182
178
|
firstName: shippingFirstName,
|
|
183
179
|
lastName: shippingLastName,
|
|
184
180
|
phone: translatedShippingAddress.phone,
|
|
185
|
-
},
|
|
186
|
-
isTest: isE2ETest,
|
|
187
|
-
items: cartStore.items,
|
|
188
|
-
landedCostAdjustments: adjustments,
|
|
189
|
-
shipToShortAddressCode: stripeStore.shortAddressCode,
|
|
190
|
-
shipToTaxId: stripeStore.taxId,
|
|
191
|
-
shippingAddress: {
|
|
181
|
+
}, isTest: isE2ETest, items: cartStore.items, landedCostAdjustments: adjustments, shipToShortAddressCode: stripeStore.shortAddressCode }, shipToTaxId), { shippingAddress: {
|
|
192
182
|
addressLine1: translatedShippingAddress.line1,
|
|
193
183
|
addressLine2: translatedShippingAddress.line2,
|
|
194
184
|
city: translatedShippingAddress.city,
|
|
195
185
|
country: translatedShippingAddress.country,
|
|
196
186
|
postalCode: translatedShippingAddress.postal_code,
|
|
197
187
|
state: translatedShippingAddress.state,
|
|
198
|
-
}
|
|
199
|
-
};
|
|
188
|
+
} });
|
|
200
189
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { stripeStore } from "../../store/checkout/stripe";
|
|
2
|
+
import { getShouldRequirePeruTaxId } from "../../store/zonosStore";
|
|
3
|
+
import { resolveTaxIdSelection } from "./resolveTaxIdSelection";
|
|
4
|
+
/** Tax id to send for the destination, or null while the field is hidden. */
|
|
5
|
+
export const getCheckoutTaxIdPayload = (countryCode) => {
|
|
6
|
+
const { selectedType, send } = resolveTaxIdSelection({
|
|
7
|
+
companyName: stripeStore.companyName,
|
|
8
|
+
countryCode,
|
|
9
|
+
shouldRequirePeruTaxId: getShouldRequirePeruTaxId(),
|
|
10
|
+
taxIdType: stripeStore.taxIdType,
|
|
11
|
+
});
|
|
12
|
+
if (!send) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return Object.assign({ taxId: stripeStore.taxId }, (selectedType ? { taxIdType: selectedType.value } : {}));
|
|
16
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { resolveTaxIdSelection } from "./resolveTaxIdSelection";
|
|
2
|
+
import { taxIdLabelForCheckout } from "../taxId/taxIdRules";
|
|
3
|
+
export const getTaxIdFieldState = ({ companyName, countryCode, errorField, errorMessage, shouldRequirePeruTaxId, taxIdType, }) => {
|
|
4
|
+
var _a, _b;
|
|
5
|
+
const { rendered, selectedType, send, typeOptions } = resolveTaxIdSelection({
|
|
6
|
+
companyName,
|
|
7
|
+
countryCode,
|
|
8
|
+
shouldRequirePeruTaxId,
|
|
9
|
+
taxIdType,
|
|
10
|
+
});
|
|
11
|
+
if (!rendered) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const singleTypeLabel = typeOptions
|
|
15
|
+
? null
|
|
16
|
+
: taxIdLabelForCheckout(countryCode);
|
|
17
|
+
return {
|
|
18
|
+
inputLabel: (_a = selectedType === null || selectedType === void 0 ? void 0 : selectedType.label) !== null && _a !== void 0 ? _a : singleTypeLabel === null || singleTypeLabel === void 0 ? void 0 : singleTypeLabel.friendlyName,
|
|
19
|
+
inputPlaceholder: (_b = selectedType === null || selectedType === void 0 ? void 0 : selectedType.placeholder) !== null && _b !== void 0 ? _b : singleTypeLabel === null || singleTypeLabel === void 0 ? void 0 : singleTypeLabel.placeholder,
|
|
20
|
+
selectedValue: (selectedType === null || selectedType === void 0 ? void 0 : selectedType.value) || '',
|
|
21
|
+
showValueInput: send,
|
|
22
|
+
typeError: errorField === 'type' ? errorMessage : '',
|
|
23
|
+
typeOptions,
|
|
24
|
+
valueError: errorField === 'value' ? errorMessage : '',
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BigCommerce checkout depends on storefront callbacks (clear cart, inventory).
|
|
3
|
+
* The hosted variant leaves the storefront, so the test does not apply there.
|
|
4
|
+
*/
|
|
5
|
+
export const isHostedVsNativeTestAllowed = ({ createCartId, enabledTestKeys, isBigCommerce, }) => {
|
|
6
|
+
if (isBigCommerce) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (typeof createCartId !== 'function') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return enabledTestKeys.includes('hosted_vs_native');
|
|
13
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import-free so `scripts/buildItemCustomization.mjs` can emit one module.
|
|
3
|
+
* demo-app imports the generated `item-customization.js`, not this file.
|
|
4
|
+
*/
|
|
5
|
+
export const ITEM_CUSTOMIZATION_ATTRIBUTE_KEY = 'itemCustomization';
|
|
6
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
/** Drops an empty name, a non-string value, and the unselected value "0". */
|
|
8
|
+
export const readDisplayableItemCustomization = (value) => {
|
|
9
|
+
if (!isRecord(value)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const { name } = value;
|
|
13
|
+
if (typeof name !== 'string' || name === '') {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const choiceValue = value.value;
|
|
17
|
+
if (typeof choiceValue !== 'string' || choiceValue === '0') {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
name,
|
|
22
|
+
value: choiceValue,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const parseJson = (value) => {
|
|
26
|
+
try {
|
|
27
|
+
// The generated package entry cannot import the shared jsonParse helper.
|
|
28
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
29
|
+
return JSON.parse(value);
|
|
30
|
+
}
|
|
31
|
+
catch (_a) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/** Selected customization entries, with the original object for extra ids. */
|
|
36
|
+
export const readItemCustomizationEntries = (attributes) => {
|
|
37
|
+
var _a;
|
|
38
|
+
const rawValue = (_a = attributes === null || attributes === void 0 ? void 0 : attributes.find(attribute => (attribute === null || attribute === void 0 ? void 0 : attribute.key) === ITEM_CUSTOMIZATION_ATTRIBUTE_KEY)) === null || _a === void 0 ? void 0 : _a.value;
|
|
39
|
+
if (!rawValue) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
const parsed = parseJson(rawValue);
|
|
43
|
+
if (!Array.isArray(parsed)) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
return parsed.flatMap(entry => {
|
|
47
|
+
const choice = readDisplayableItemCustomization(entry);
|
|
48
|
+
if (!choice || !isRecord(entry)) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
return [{ choice, raw: entry }];
|
|
52
|
+
});
|
|
53
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { readItemCustomizationEntries, } from "./itemCustomization";
|
|
2
|
+
/**
|
|
3
|
+
* Reads a cart row's `itemCustomization` attribute into display pairs.
|
|
4
|
+
* Unreadable data is an empty list.
|
|
5
|
+
*/
|
|
6
|
+
export const parseItemCustomizations = (attributes) => readItemCustomizationEntries(attributes).map(entry => entry.choice);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shouldRenderTaxIdInput } from "./shouldRenderTaxIdInput";
|
|
2
|
+
import { taxIdTypeOptionsForCheckout } from "../taxId/taxIdRules";
|
|
3
|
+
/** Whether the field is showing, and which of this country's types is selected. */
|
|
4
|
+
export const resolveTaxIdSelection = ({ companyName, countryCode, shouldRequirePeruTaxId, taxIdType, }) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const typeOptions = taxIdTypeOptionsForCheckout({
|
|
7
|
+
countryCode,
|
|
8
|
+
shouldRequirePeruTaxId,
|
|
9
|
+
});
|
|
10
|
+
const selectedType = (_a = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.find(option => option.value === taxIdType)) !== null && _a !== void 0 ? _a : null;
|
|
11
|
+
const rendered = shouldRenderTaxIdInput({
|
|
12
|
+
companyName,
|
|
13
|
+
countryCode,
|
|
14
|
+
shouldRequirePeruTaxId,
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
rendered,
|
|
18
|
+
selectedType,
|
|
19
|
+
// A multi-type country sends a number only after the shopper picks a type.
|
|
20
|
+
send: rendered && (!typeOptions || !!selectedType),
|
|
21
|
+
typeOptions,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
return countryRequireTaxId.includes(countryCode);
|
|
4
|
-
};
|
|
1
|
+
import { isPeruTaxIdActive } from "../taxId/taxIdRules";
|
|
2
|
+
import { euCountryCodes, isCountryRequireTaxId, } from "../../../types/checkout/TaxId";
|
|
5
3
|
/**
|
|
6
4
|
* Checks if the tax ID input should be rendered based on the company name and country code.
|
|
7
5
|
*/
|
|
8
|
-
export const shouldRenderTaxIdInput = ({ companyName, countryCode, }) => {
|
|
6
|
+
export const shouldRenderTaxIdInput = ({ companyName, countryCode, shouldRequirePeruTaxId, }) => {
|
|
7
|
+
if (isPeruTaxIdActive({ countryCode, shouldRequirePeruTaxId })) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
9
10
|
// Only show the tax ID input if the country is in the EU and the company name is provided
|
|
10
11
|
if (euCountryCodes.includes(countryCode)) {
|
|
11
12
|
return companyName.trim().length > 0;
|
|
12
13
|
}
|
|
13
14
|
// If country require tax id, show the input
|
|
14
|
-
|
|
15
|
-
if (isCountryRequireTaxId) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
// If country doesn't require tax ID, no need to show the input
|
|
19
|
-
return false;
|
|
15
|
+
return isCountryRequireTaxId(countryCode);
|
|
20
16
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { stripeStore } from "../../store/checkout/stripe";
|
|
3
|
+
import { translate } from "../../store/translationStore";
|
|
4
|
+
import { getTaxIdFieldState } from "./getTaxIdFieldState";
|
|
5
|
+
import { isCheckoutTaxIdTypeValue } from "../taxId/taxIdRules";
|
|
6
|
+
export const renderTaxIdFields = ({ companyName, countryCode, errorField, errorMessage, onTaxIdChange, shouldRequirePeruTaxId, taxId, taxIdType, }) => {
|
|
7
|
+
const state = getTaxIdFieldState({
|
|
8
|
+
companyName,
|
|
9
|
+
countryCode,
|
|
10
|
+
errorField,
|
|
11
|
+
errorMessage,
|
|
12
|
+
shouldRequirePeruTaxId,
|
|
13
|
+
taxIdType,
|
|
14
|
+
});
|
|
15
|
+
if (!state) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (h("div", { class: "zonos--tax-id-input" }, state.typeOptions && (h("zonos-stripe-select", { error: state.typeError, isError: !!state.typeError, onSelectChange: (event) => {
|
|
19
|
+
if (isCheckoutTaxIdTypeValue(event.detail)) {
|
|
20
|
+
stripeStore.taxIdType = event.detail;
|
|
21
|
+
}
|
|
22
|
+
}, options: state.typeOptions.map(option => ({
|
|
23
|
+
label: translate(option.label),
|
|
24
|
+
value: option.value,
|
|
25
|
+
})), selectLabel: translate('Tax id type'), selectedValue: state.selectedValue, value: state.selectedValue })), state.showValueInput && (h("zonos-stripe-input", { error: state.valueError, inputLabel: state.inputLabel ? translate(state.inputLabel) : '', inputPlaceholder: state.inputPlaceholder || '', inputValue: taxId, isError: !!state.valueError, onInputChange: (event) => {
|
|
26
|
+
stripeStore.taxId = event.detail;
|
|
27
|
+
onTaxIdChange === null || onTaxIdChange === void 0 ? void 0 : onTaxIdChange(event.detail);
|
|
28
|
+
} }))));
|
|
29
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { checkoutTaxIdTypeValues, isCountryRequireTaxId, peruTaxIdDigitLength, shipToTaxIdLabels, taxIdTypeOptions, } from "../../../types/checkout/TaxId";
|
|
2
|
+
export const stripTaxIdSeparators = (taxId) => taxId.replace(/[\s-]/g, '');
|
|
3
|
+
export const rfcRegex = /^[A-ZÑ]{3,4}[0-9]{6}[A-Z0-9]{3}$/;
|
|
4
|
+
export const curpRegex = /^[A-Z]{4}[0-9]{6}[HMX][A-Z]{5}[A-Z0-9][0-9]$/;
|
|
5
|
+
export const isMexicoTaxIdType = (taxIdType) => taxIdTypeOptions.MX.some(option => option.value === taxIdType);
|
|
6
|
+
export const isPeruTaxIdType = (taxIdType) => taxIdTypeOptions.PE.some(option => option.value === taxIdType);
|
|
7
|
+
export const isCheckoutTaxIdTypeValue = (taxIdType) => checkoutTaxIdTypeValues.some(value => value === taxIdType);
|
|
8
|
+
/** 8 digits are a DNI, 9 a carné, 11 an RUC. Anything else is not a Peru tax id. */
|
|
9
|
+
export const peruTaxIdTypeFromValue = (taxId) => {
|
|
10
|
+
const digits = stripTaxIdSeparators(taxId);
|
|
11
|
+
if (!/^\d+$/.test(digits)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (digits.length === peruTaxIdDigitLength.DNI) {
|
|
15
|
+
return 'DNI';
|
|
16
|
+
}
|
|
17
|
+
if (digits.length === peruTaxIdDigitLength.CE) {
|
|
18
|
+
return 'CE';
|
|
19
|
+
}
|
|
20
|
+
if (digits.length === peruTaxIdDigitLength.RUC) {
|
|
21
|
+
return 'RUC';
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
export const isPeruTaxIdActive = ({ countryCode, shouldRequirePeruTaxId, }) => shouldRequirePeruTaxId && countryCode === 'PE';
|
|
26
|
+
/**
|
|
27
|
+
* Peru stays off `countryRequireTaxId`. The API flag decides which stores see it.
|
|
28
|
+
* Mexico and Peru pick the kind from a dropdown instead of a regex.
|
|
29
|
+
*/
|
|
30
|
+
export const taxIdTypeOptionsForCheckout = ({ countryCode, shouldRequirePeruTaxId, }) => {
|
|
31
|
+
if (isPeruTaxIdActive({ countryCode, shouldRequirePeruTaxId })) {
|
|
32
|
+
return taxIdTypeOptions.PE;
|
|
33
|
+
}
|
|
34
|
+
if (countryCode === 'MX') {
|
|
35
|
+
return taxIdTypeOptions.MX;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
export const taxIdLabelForCheckout = (countryCode) => {
|
|
40
|
+
if (isCountryRequireTaxId(countryCode)) {
|
|
41
|
+
return shipToTaxIdLabels[countryCode];
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveTaxIdSelection } from "./checkout/resolveTaxIdSelection";
|
|
2
|
+
import { curpRegex, isPeruTaxIdActive, isPeruTaxIdType, peruTaxIdTypeFromValue, rfcRegex, stripTaxIdSeparators, } from "./taxId/taxIdRules";
|
|
2
3
|
import { euCountryCodes } from "../../types/index";
|
|
4
|
+
import { peruTaxIdFormatError, } from "../../types/checkout/TaxId";
|
|
3
5
|
const isTaxIdRequired = (shippingCountry) => {
|
|
4
6
|
const requireTaxIdCountry = [
|
|
5
7
|
'MX',
|
|
@@ -8,86 +10,83 @@ const isTaxIdRequired = (shippingCountry) => {
|
|
|
8
10
|
];
|
|
9
11
|
return requireTaxIdCountry.includes(shippingCountry);
|
|
10
12
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
const invalid = (error, field) => ({
|
|
14
|
+
error,
|
|
15
|
+
field,
|
|
16
|
+
valid: false,
|
|
17
|
+
});
|
|
18
|
+
const valid = () => ({
|
|
19
|
+
error: null,
|
|
20
|
+
field: null,
|
|
21
|
+
valid: true,
|
|
22
|
+
});
|
|
23
|
+
export const taxIdValidationResult = ({ companyName, shippingCountry, shouldRequirePeruTaxId, taxId, taxIdType, }) => {
|
|
24
|
+
const { rendered, selectedType, typeOptions } = resolveTaxIdSelection({
|
|
14
25
|
companyName,
|
|
15
26
|
countryCode: shippingCountry,
|
|
27
|
+
shouldRequirePeruTaxId,
|
|
28
|
+
taxIdType,
|
|
16
29
|
});
|
|
17
30
|
// If the tax id input is not even rendered, no need to validate anything and allow to proceed. Validate when tax id input is not even rendered would prevent the user from checking out
|
|
18
|
-
if (!
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
if (!rendered) {
|
|
32
|
+
return valid();
|
|
33
|
+
}
|
|
34
|
+
// The number field is hidden until a type is chosen.
|
|
35
|
+
if (typeOptions && !selectedType) {
|
|
36
|
+
return invalid('Tax id type is required', 'type');
|
|
37
|
+
}
|
|
38
|
+
// Spaces and hyphens count as blank only. The original text is left unchanged.
|
|
39
|
+
if (isPeruTaxIdActive({
|
|
40
|
+
countryCode: shippingCountry,
|
|
41
|
+
shouldRequirePeruTaxId,
|
|
42
|
+
}) &&
|
|
43
|
+
selectedType &&
|
|
44
|
+
isPeruTaxIdType(selectedType.value)) {
|
|
45
|
+
if (!stripTaxIdSeparators(taxId)) {
|
|
46
|
+
return invalid('Tax id is required', 'value');
|
|
47
|
+
}
|
|
48
|
+
if (peruTaxIdTypeFromValue(taxId) !== selectedType.value) {
|
|
49
|
+
return invalid(peruTaxIdFormatError[selectedType.value], 'value');
|
|
50
|
+
}
|
|
51
|
+
return valid();
|
|
23
52
|
}
|
|
24
53
|
// Cache the result of isTaxIdRequired for reuse
|
|
25
54
|
const taxIdRequired = isTaxIdRequired(shippingCountry);
|
|
26
55
|
if (!taxIdRequired) {
|
|
27
56
|
// If the shipping country does not require a tax id, the validation immediately returns valid
|
|
28
|
-
return
|
|
29
|
-
error: null,
|
|
30
|
-
valid: true,
|
|
31
|
-
};
|
|
57
|
+
return valid();
|
|
32
58
|
}
|
|
33
59
|
// For all EU countries, tax id is not required if company name is not filled (not business address)
|
|
34
60
|
if (euCountryCodes.includes(shippingCountry)) {
|
|
35
61
|
if (!companyName.trim()) {
|
|
36
|
-
return
|
|
37
|
-
error: null,
|
|
38
|
-
valid: true,
|
|
39
|
-
};
|
|
62
|
+
return valid();
|
|
40
63
|
}
|
|
41
64
|
if (!taxId) {
|
|
42
|
-
return
|
|
43
|
-
error: 'Tax id is required',
|
|
44
|
-
valid: false,
|
|
45
|
-
};
|
|
65
|
+
return invalid('Tax id is required', 'value');
|
|
46
66
|
}
|
|
47
|
-
return
|
|
48
|
-
error: null,
|
|
49
|
-
valid: true,
|
|
50
|
-
};
|
|
67
|
+
return valid();
|
|
51
68
|
}
|
|
52
69
|
if (!taxId) {
|
|
53
|
-
return
|
|
54
|
-
error: 'Tax id is required',
|
|
55
|
-
valid: false,
|
|
56
|
-
};
|
|
70
|
+
return invalid('Tax id is required', 'value');
|
|
57
71
|
}
|
|
58
72
|
if (shippingCountry === 'AR') {
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
return
|
|
62
|
-
error: 'Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).',
|
|
63
|
-
valid: false,
|
|
64
|
-
};
|
|
73
|
+
const isValidAr = /^[0-9]{2}-?[0-9]{8}-?[0-9]$/.test(taxId);
|
|
74
|
+
if (!isValidAr) {
|
|
75
|
+
return invalid('Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).', 'value');
|
|
65
76
|
}
|
|
66
|
-
return
|
|
67
|
-
error: null,
|
|
68
|
-
valid: true,
|
|
69
|
-
};
|
|
77
|
+
return valid();
|
|
70
78
|
}
|
|
71
|
-
// validate tax id for mexico
|
|
72
|
-
if (shippingCountry === 'MX') {
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
error: 'Invalid RFC or CURP format. Must be a 12–13 character RFC or an 18 character CURP, uppercase letters and numbers only.',
|
|
80
|
-
valid: false,
|
|
81
|
-
};
|
|
79
|
+
// validate tax id for mexico against the type the shopper selected
|
|
80
|
+
if (shippingCountry === 'MX' && selectedType) {
|
|
81
|
+
const isRfc = selectedType.value === 'RFC';
|
|
82
|
+
const isValidMx = isRfc ? rfcRegex.test(taxId) : curpRegex.test(taxId);
|
|
83
|
+
if (!isValidMx) {
|
|
84
|
+
return invalid(isRfc
|
|
85
|
+
? 'Invalid RFC format. Must be 12–13 uppercase letters and numbers.'
|
|
86
|
+
: 'Invalid CURP format. Must be 18 uppercase letters and numbers.', 'value');
|
|
82
87
|
}
|
|
83
|
-
return
|
|
84
|
-
error: null,
|
|
85
|
-
valid: true,
|
|
86
|
-
};
|
|
88
|
+
return valid();
|
|
87
89
|
}
|
|
88
90
|
// Other countries doesn't need to validate tax id in the right format
|
|
89
|
-
return
|
|
90
|
-
error: null,
|
|
91
|
-
valid: true,
|
|
92
|
-
};
|
|
91
|
+
return valid();
|
|
93
92
|
};
|
package/dist/collection/index.js
CHANGED
|
@@ -86,3 +86,34 @@ export const shipToTaxIdLabels = {
|
|
|
86
86
|
SI: { friendlyName: 'EORI number', placeholder: 'DE123456789' },
|
|
87
87
|
SK: { friendlyName: 'EORI number', placeholder: 'DE123456789' },
|
|
88
88
|
};
|
|
89
|
+
export const isCountryRequireTaxId = (countryCode) => {
|
|
90
|
+
return countryRequireTaxId.some(code => code === countryCode);
|
|
91
|
+
};
|
|
92
|
+
export const taxIdTypeOptions = {
|
|
93
|
+
MX: [
|
|
94
|
+
{ label: 'RFC', placeholder: 'XAXX010101000', value: 'RFC' },
|
|
95
|
+
{ label: 'CURP', placeholder: 'AAAA800101HDFRRR09', value: 'CURP' },
|
|
96
|
+
],
|
|
97
|
+
PE: [
|
|
98
|
+
{ label: 'DNI', placeholder: '12345678', value: 'DNI' },
|
|
99
|
+
{ label: 'RUC', placeholder: '20123456789', value: 'RUC' },
|
|
100
|
+
{
|
|
101
|
+
label: 'Carné de extranjería',
|
|
102
|
+
placeholder: '001234567',
|
|
103
|
+
value: 'CE',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
const checkoutTaxIdTypeValueList = ['CE', 'CURP', 'DNI', 'RFC', 'RUC'];
|
|
108
|
+
/** Every document kind checkout can send. Older clients omit the field. */
|
|
109
|
+
export const checkoutTaxIdTypeValues = checkoutTaxIdTypeValueList;
|
|
110
|
+
export const peruTaxIdDigitLength = {
|
|
111
|
+
CE: 9,
|
|
112
|
+
DNI: 8,
|
|
113
|
+
RUC: 11,
|
|
114
|
+
};
|
|
115
|
+
export const peruTaxIdFormatError = {
|
|
116
|
+
CE: 'Carné de extranjería must be 9 digits.',
|
|
117
|
+
DNI: 'DNI must be 8 digits.',
|
|
118
|
+
RUC: 'RUC must be 11 digits.',
|
|
119
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,6 +14,7 @@ export * from './checkout/api/StoreDiscountEnabled';
|
|
|
14
14
|
export * from './checkout/api/ValidateAddress';
|
|
15
15
|
export * from './checkout/api/VarianceTest';
|
|
16
16
|
export * from './checkout/CheckoutConfig';
|
|
17
|
+
export * from './checkout/itemCustomization';
|
|
17
18
|
export * from './checkout/ShortAddressCode';
|
|
18
19
|
export * from './checkout/TaxId';
|
|
19
20
|
export * from './ConversionEvent';
|
|
@@ -86,5 +86,36 @@ const shipToTaxIdLabels = {
|
|
|
86
86
|
SI: { friendlyName: 'EORI number', placeholder: 'DE123456789' },
|
|
87
87
|
SK: { friendlyName: 'EORI number', placeholder: 'DE123456789' },
|
|
88
88
|
};
|
|
89
|
+
const isCountryRequireTaxId = (countryCode) => {
|
|
90
|
+
return countryRequireTaxId.some(code => code === countryCode);
|
|
91
|
+
};
|
|
92
|
+
const taxIdTypeOptions = {
|
|
93
|
+
MX: [
|
|
94
|
+
{ label: 'RFC', placeholder: 'XAXX010101000', value: 'RFC' },
|
|
95
|
+
{ label: 'CURP', placeholder: 'AAAA800101HDFRRR09', value: 'CURP' },
|
|
96
|
+
],
|
|
97
|
+
PE: [
|
|
98
|
+
{ label: 'DNI', placeholder: '12345678', value: 'DNI' },
|
|
99
|
+
{ label: 'RUC', placeholder: '20123456789', value: 'RUC' },
|
|
100
|
+
{
|
|
101
|
+
label: 'Carné de extranjería',
|
|
102
|
+
placeholder: '001234567',
|
|
103
|
+
value: 'CE',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
const checkoutTaxIdTypeValueList = ['CE', 'CURP', 'DNI', 'RFC', 'RUC'];
|
|
108
|
+
/** Every document kind checkout can send. Older clients omit the field. */
|
|
109
|
+
const checkoutTaxIdTypeValues = checkoutTaxIdTypeValueList;
|
|
110
|
+
const peruTaxIdDigitLength = {
|
|
111
|
+
CE: 9,
|
|
112
|
+
DNI: 8,
|
|
113
|
+
RUC: 11,
|
|
114
|
+
};
|
|
115
|
+
const peruTaxIdFormatError = {
|
|
116
|
+
CE: 'Carné de extranjería must be 9 digits.',
|
|
117
|
+
DNI: 'DNI must be 8 digits.',
|
|
118
|
+
RUC: 'RUC must be 11 digits.',
|
|
119
|
+
};
|
|
89
120
|
|
|
90
|
-
export { countryRequireTaxId as c, euCountryCodes as e, shipToTaxIdLabels as s };
|
|
121
|
+
export { checkoutTaxIdTypeValues as a, peruTaxIdFormatError as b, countryRequireTaxId as c, euCountryCodes as e, isCountryRequireTaxId as i, peruTaxIdDigitLength as p, shipToTaxIdLabels as s, taxIdTypeOptions as t };
|