@zonos/elements 1.3.279 → 1.3.280
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-e8bc11a3.js → cart-0fa312a5.js} +1 -1
- package/dist/cjs/{collect-e6485168.js → collect-f9c4ca7c.js} +2 -2
- package/dist/cjs/formatStringWithLinks-c25b4018.js +24 -0
- package/dist/cjs/{hasInclusivePrice-798ce42d.js → hasInclusivePrice-95431bca.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-dff7ec81.js → invoice-ce757565.js} +2 -2
- package/dist/cjs/isSameHostCheckoutLink-6148cabb.js +28 -0
- package/dist/cjs/{localization-90650d7d.js → localization-7fded969.js} +40 -40
- package/dist/cjs/{paypal-77bd640c.js → paypal-57ab3ab6.js} +2 -2
- package/dist/cjs/{placeTestOrder-7767d119.js → placeTestOrder-35e0d3bd.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-66377cf5.js → renderCheckoutCurrency-41d48407.js} +2 -2
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +19 -7
- package/dist/cjs/zonos-checkout.cjs.entry.js +189 -13
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +13 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +36 -2
- package/dist/collection/components/store/translationStore/strings.arabic.js +2 -2
- package/dist/collection/components/store/translationStore/strings.base.js +2 -2
- package/dist/collection/components/store/translationStore/strings.chinese.js +2 -2
- package/dist/collection/components/store/translationStore/strings.danish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.dutch.js +2 -2
- package/dist/collection/components/store/translationStore/strings.french.js +2 -2
- package/dist/collection/components/store/translationStore/strings.german.js +2 -2
- package/dist/collection/components/store/translationStore/strings.hebrew.js +2 -2
- package/dist/collection/components/store/translationStore/strings.indonesian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.italian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.japanese.js +2 -2
- package/dist/collection/components/store/translationStore/strings.korean.js +2 -2
- package/dist/collection/components/store/translationStore/strings.norwegian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.polish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.portuguese.js +2 -2
- package/dist/collection/components/store/translationStore/strings.russian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.spanish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.swedish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.turkish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +2 -2
- package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +6 -1
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +144 -7
- package/dist/collection/components/utils/formatStringWithLinks.js +12 -6
- package/dist/collection/components/utils/isSameHostCheckoutLink.js +24 -0
- package/dist/collection/types/generated/graphql.internal.types.js +84 -0
- package/dist/esm/{cart-8b8dc79f.js → cart-4699e6ab.js} +2 -2
- package/dist/esm/{collect-f4965586.js → collect-24cc2e12.js} +2 -2
- package/dist/esm/formatStringWithLinks-0d48f183.js +22 -0
- package/dist/esm/{hasInclusivePrice-1589fef9.js → hasInclusivePrice-f81ddcd6.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-b7a1fb14.js → invoice-575dc93d.js} +2 -2
- package/dist/esm/isSameHostCheckoutLink-c1b88ab7.js +26 -0
- package/dist/esm/{localization-d49867ed.js → localization-da2f407f.js} +40 -40
- package/dist/esm/{paypal-da551105.js → paypal-d4436abd.js} +2 -2
- package/dist/esm/{placeTestOrder-4309b170.js → placeTestOrder-d87b2c6a.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-0ed221ac.js → renderCheckoutCurrency-08526996.js} +2 -2
- package/dist/esm/zonos-address-display_8.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +2 -2
- package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +19 -7
- package/dist/esm/zonos-checkout.entry.js +189 -13
- package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +3 -2
- package/dist/esm/zonos-hello-dialog.entry.js +4 -3
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
- package/dist/esm-es5/{cart-8b8dc79f.js → cart-4699e6ab.js} +1 -1
- package/dist/esm-es5/{collect-f4965586.js → collect-24cc2e12.js} +1 -1
- package/dist/esm-es5/formatStringWithLinks-0d48f183.js +1 -0
- package/dist/esm-es5/{hasInclusivePrice-1589fef9.js → hasInclusivePrice-f81ddcd6.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-b7a1fb14.js → invoice-575dc93d.js} +1 -1
- package/dist/esm-es5/isSameHostCheckoutLink-c1b88ab7.js +1 -0
- package/dist/esm-es5/localization-da2f407f.js +1 -0
- package/dist/esm-es5/{paypal-da551105.js → paypal-d4436abd.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-4309b170.js → placeTestOrder-d87b2c6a.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-0ed221ac.js → renderCheckoutCurrency-08526996.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +1 -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/store/translationStore/strings.arabic.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.base.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.danish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.french.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.german.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.italian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.korean.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.polish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.russian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +1 -1
- package/dist/types/components/utils/isSameHostCheckoutLink.d.ts +14 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +84 -0
- package/dist/types/types/generated/graphql.internal.types.ts +85 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-02065a08.system.js → p-016b5bde.system.js} +1 -1
- package/dist/zonos-elements/{p-6fae9835.system.entry.js → p-0adab1d5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0d2f81ce.system.js +1 -0
- package/dist/zonos-elements/p-11206fe2.js +1 -0
- package/dist/zonos-elements/{p-0402af0d.entry.js → p-12452213.entry.js} +1 -1
- package/dist/zonos-elements/{p-5827c868.entry.js → p-19f4e77a.entry.js} +1 -1
- package/dist/zonos-elements/{p-2aecc055.entry.js → p-1bb85ff1.entry.js} +1 -1
- package/dist/zonos-elements/{p-5c76ef2a.js → p-275fa2da.js} +1 -1
- package/dist/zonos-elements/{p-8b42245d.entry.js → p-28b1c189.entry.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/p-2b97f7ed.js +1 -0
- package/dist/zonos-elements/{p-647438d6.system.js → p-2dbdf883.system.js} +1 -1
- package/dist/zonos-elements/{p-5afea02c.system.entry.js → p-3068247c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7614ea6f.system.entry.js → p-362215b6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-39e2642f.js +1 -0
- package/dist/zonos-elements/p-3f8f4c78.js +1 -0
- package/dist/zonos-elements/{p-d5945ddc.entry.js → p-3f90cb36.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b963905.system.js → p-40a0c1d3.system.js} +1 -1
- package/dist/zonos-elements/{p-abf61f6f.system.entry.js → p-43a14674.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d7cb9ef6.system.entry.js → p-46f88c11.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-998f9df5.system.entry.js → p-564c7bb5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5b54f10c.entry.js +1 -0
- package/dist/zonos-elements/p-6197aa73.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b36205f4.entry.js → p-6451537c.entry.js} +1 -1
- package/dist/zonos-elements/p-65fe75e1.entry.js +1 -0
- package/dist/zonos-elements/{p-5bc43687.system.entry.js → p-66223935.system.entry.js} +1 -1
- package/dist/zonos-elements/p-67426156.system.js +1 -0
- package/dist/zonos-elements/{p-2654556b.js → p-67b2e46c.js} +1 -1
- package/dist/zonos-elements/p-6bea1787.entry.js +1 -0
- package/dist/zonos-elements/{p-cd41b16b.system.entry.js → p-7237ec6f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0745e440.entry.js → p-72c1bd64.entry.js} +1 -1
- package/dist/zonos-elements/p-75da4ba0.entry.js +1 -0
- package/dist/zonos-elements/{p-3f380c8f.system.js → p-788a16bb.system.js} +1 -1
- package/dist/zonos-elements/p-79b6070a.js +1 -0
- package/dist/zonos-elements/{p-77fa437c.entry.js → p-807e7ebc.entry.js} +1 -1
- package/dist/zonos-elements/{p-43815edd.system.entry.js → p-81c4f04a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8bd37d3b.entry.js → p-85796e67.entry.js} +1 -1
- package/dist/zonos-elements/p-94329e56.js +1 -0
- package/dist/zonos-elements/{p-ed676ad1.system.entry.js → p-944148db.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a8c79850.js → p-96e7b465.js} +1 -1
- package/dist/zonos-elements/{p-32278945.system.js → p-a30f03d6.system.js} +1 -1
- package/dist/zonos-elements/{p-ac59f5c1.system.entry.js → p-a5afcea1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-293183c1.system.entry.js → p-a7f0e824.system.entry.js} +1 -1
- package/dist/zonos-elements/p-aff7112b.entry.js +1 -0
- package/dist/zonos-elements/p-b05da593.system.entry.js +1 -0
- package/dist/zonos-elements/p-b330e451.system.js +1 -0
- package/dist/zonos-elements/{p-12a08423.system.entry.js → p-b6049eef.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b6cd6e62.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7365e22c.system.js → p-b8c019b9.system.js} +1 -1
- package/dist/zonos-elements/p-c2014d57.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ee434a71.entry.js → p-c4a479ad.entry.js} +1 -1
- package/dist/zonos-elements/{p-4e6e9a3c.system.entry.js → p-cf0c8c77.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f44a3338.entry.js → p-db9cb522.entry.js} +1 -1
- package/dist/zonos-elements/{p-9beb2624.entry.js → p-dbd5be5d.entry.js} +1 -1
- package/dist/zonos-elements/p-dff1d3be.entry.js +1 -0
- package/dist/zonos-elements/{p-7e8aba66.system.entry.js → p-ec53c436.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-74ebd766.js → p-f3759c70.js} +1 -1
- package/dist/zonos-elements/{p-5e09c22d.system.js → p-f55a2352.system.js} +1 -1
- package/dist/zonos-elements/{p-8d87e748.entry.js → p-fc2d5dd9.entry.js} +1 -1
- package/dist/zonos-elements/p-fd2d4d04.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/formatStringWithLinks-52341fc7.js +0 -17
- package/dist/esm/formatStringWithLinks-9e819405.js +0 -15
- package/dist/esm-es5/formatStringWithLinks-9e819405.js +0 -1
- package/dist/esm-es5/localization-d49867ed.js +0 -1
- package/dist/zonos-elements/p-21d925d7.entry.js +0 -1
- package/dist/zonos-elements/p-2d6557ee.system.js +0 -1
- package/dist/zonos-elements/p-32704baa.js +0 -1
- package/dist/zonos-elements/p-3cf22558.entry.js +0 -1
- package/dist/zonos-elements/p-45e1c33b.entry.js +0 -1
- package/dist/zonos-elements/p-5d3ea491.system.entry.js +0 -1
- package/dist/zonos-elements/p-6b4ef7e0.entry.js +0 -1
- package/dist/zonos-elements/p-73d3fa61.entry.js +0 -1
- package/dist/zonos-elements/p-7522ec43.js +0 -1
- package/dist/zonos-elements/p-9fab45aa.system.js +0 -1
- package/dist/zonos-elements/p-a87561b8.js +0 -1
- package/dist/zonos-elements/p-c209e36d.js +0 -1
- package/dist/zonos-elements/p-d7bda14d.js +0 -1
- package/dist/zonos-elements/p-d93991c3.system.entry.js +0 -1
- package/dist/zonos-elements/p-e6165cc2.system.js +0 -1
- package/dist/zonos-elements/p-eb9369b9.system.entry.js +0 -1
- package/dist/zonos-elements/p-f3a73132.entry.js +0 -1
- package/dist/zonos-elements/p-ffbf87c8.system.entry.js +0 -1
|
@@ -819,8 +819,8 @@ export const stringsBase = {
|
|
|
819
819
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
820
820
|
value: 'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.',
|
|
821
821
|
},
|
|
822
|
-
'Your
|
|
823
|
-
value: 'Your
|
|
822
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
823
|
+
value: 'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?',
|
|
824
824
|
},
|
|
825
825
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
826
826
|
value: 'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.',
|
|
@@ -818,8 +818,8 @@ export const stringsChinese = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: '您的付款已成功完成!感谢您与我们购物!我们希望您拥有愉快的购物体验,您的支持对我们来说意义非凡。',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: '
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: '您选择的地址为国际配送地址。您想继续进行国际结账,还是留在此页面选择国内地址?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: '您选择的付款方式需要额外验证。请按照您的付款提供商提供的说明完成交易。',
|
|
@@ -818,8 +818,8 @@ export const stringsDanish = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Din betaling gik igennem! Tak fordi du handler hos os! Vi håber, du havde en god oplevelse, og din støtte betyder meget for os.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Din
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Din valgte adresse sendes internationalt. Vil du fortsætte til international checkout, eller blive her og vælge en indenlandsk adresse?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Din valgte betalingsmetode kræver yderligere verifikation. Følg venligst instruktionerne fra din betalingsudbyder for at fuldføre transaktionen.',
|
|
@@ -818,8 +818,8 @@ export const stringsDutch = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Je betaling is succesvol verwerkt! Bedankt voor het winkelen bij ons! We hopen dat je een prettige ervaring hebt gehad en je steun betekent veel voor ons.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Uw
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Uw geselecteerde adres wordt internationaal verzonden. Wilt u doorgaan naar de internationale kassa, of hier blijven en een binnenlands adres selecteren?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Uw geselecteerde betaalmethode vereist aanvullende verificatie. Volg de instructies van uw betalingsprovider om de transactie te voltooien.',
|
|
@@ -818,8 +818,8 @@ export const stringsFrench = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Votre paiement a bien été effectué ! Merci de votre achat chez nous ! Nous espérons que vous avez passé un bon moment et votre soutien compte beaucoup pour nous.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Votre adresse
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Votre adresse sélectionnée est une adresse de livraison internationale. Souhaitez-vous continuer vers le paiement international, ou rester ici et sélectionner une adresse nationale ?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Votre méthode de paiement sélectionnée nécessite une vérification supplémentaire. Veuillez suivre les instructions fournies par votre fournisseur de paiement pour compléter la transaction.',
|
|
@@ -818,8 +818,8 @@ export const stringsGerman = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Ihre Zahlung war erfolgreich! Vielen Dank, dass Sie bei uns eingekauft haben! Wir hoffen, Sie hatten eine angenehme Erfahrung und Ihre Unterstützung bedeutet uns sehr viel.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Ihre
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Ihre ausgewählte Adresse wird international versendet. Möchten Sie zum internationalen Checkout fortfahren oder hier bleiben und eine inländische Adresse auswählen?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Ihre ausgewählte Zahlungsmethode erfordert eine zusätzliche Verifizierung. Bitte folgen Sie den Anweisungen Ihres Zahlungsanbieters, um die Transaktion abzuschließen.',
|
|
@@ -818,8 +818,8 @@ export const stringsHebrew = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'התשלום שלך התבצע בהצלחה! תודה שקנית אצלנו! אנו מקווים שנהנית והתמיכה שלך חשובה לנו מאוד.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: '
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'הכתובת שבחרת היא כתובת משלוח בינלאומית. האם תרצה להמשיך לקופה הבינלאומית, או להישאר כאן ולבחור כתובת מקומית?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'שיטת התשלום שבחרת דורשת אימות נוסף. אנא עקוב אחר ההוראות שסופקו על ידי ספק התשלומים שלך כדי להשלים את העסקה.',
|
|
@@ -818,8 +818,8 @@ export const stringsIndonesian = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Pembayaran Anda berhasil! Terima kasih telah berbelanja bersama kami! Kami berharap Anda memiliki pengalaman yang menyenangkan dan dukungan Anda sangat berarti bagi kami.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Alamat
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Alamat yang Anda pilih merupakan pengiriman internasional. Apakah Anda ingin melanjutkan ke checkout internasional, atau tetap di sini dan memilih alamat domestik?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Metode pembayaran yang Anda pilih memerlukan verifikasi tambahan. Silakan ikuti instruksi yang diberikan oleh penyedia pembayaran Anda untuk menyelesaikan transaksi.',
|
|
@@ -818,8 +818,8 @@ export const stringsItalian = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: "Il tuo pagamento è andato a buon fine! Grazie per aver acquistato da noi! Speriamo tu abbia avuto un'esperienza piacevole e il tuo supporto significa molto per noi.",
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Il tuo indirizzo
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Il tuo indirizzo selezionato prevede la spedizione internazionale. Desideri continuare al checkout internazionale o restare qui e selezionare un indirizzo nazionale?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Il metodo di pagamento selezionato richiede una verifica aggiuntiva. Si prega di seguire le istruzioni fornite dal proprio fornitore di pagamenti per completare la transazione.',
|
|
@@ -818,8 +818,8 @@ export const stringsJapanese = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'お支払いが正常に完了しました! ご利用いただきありがとうございます!楽しんでいただけましたら幸いです。あなたのご支援は私たちにとって大変重要な意味を持ちます。',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: '
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: '選択された住所は国際配送先です。国際チェックアウトに進みますか、それともここに留まって国内住所を選択しますか?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: '選択した支払い方法には追加の確認が必要です。取引を完了するには、支払いプロバイダーから提供された指示に従ってください。',
|
|
@@ -818,8 +818,8 @@ export const stringsKorean = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: '결제가 성공적으로 완료되었습니다! 저희와 함께 쇼핑해 주셔서 감사합니다! 즐거운 경험을 하셨기를 바라며, 귀하의 지원은 저희에게 매우 소중합니다.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: '
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: '선택하신 주소가 해외 배송 주소입니다. 국제 결제로 계속 진행하시겠습니까, 아니면 여기에 머물며 국내 주소를 선택하시겠습니까?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: '선택한 결제 방법은 추가 확인이 필요합니다. 거래를 완료하려면 결제 제공업체에서 제공한 지침을 따르십시오.',
|
|
@@ -818,8 +818,8 @@ export const stringsNorwegian = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Betalingen din gikk igjennom! Takk for at du handler hos oss! Vi håper du hadde en hyggelig opplevelse og din støtte betyr utrolig mye for oss.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Din
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Din valgte adresse sendes internasjonalt. Vil du fortsette til internasjonal utsjekking, eller bli her og velge en innenlandsk adresse?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Din valgte betalingsmetode krever ytterligere verifisering. Vennligst følg instruksjonene fra din betalingsleverandør for å fullføre transaksjonen.',
|
|
@@ -818,8 +818,8 @@ export const stringsPolish = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Twoja płatność została pomyślnie zrealizowana! Dziękujemy za zakupy u nas! Mamy nadzieję, że miałeś przyjemne doświadczenie, a Twoje wsparcie wiele dla nas znaczy.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Twój
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Twój wybrany adres jest adresem wysyłki międzynarodowej. Czy chcesz przejść do międzynarodowej kasy, czy pozostać tutaj i wybrać adres krajowy?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Wybrana metoda płatności wymaga dodatkowej weryfikacji. Proszę postępować zgodnie z instrukcjami dostarczonymi przez dostawcę płatności, aby zakończyć transakcję.',
|
|
@@ -818,8 +818,8 @@ export const stringsPortuguese = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Seu pagamento foi processado com sucesso! Obrigado por comprar conosco! Esperamos que tenha tido uma experiência agradável e seu apoio significa muito para nós.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Seu endereço
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Seu endereço selecionado é de envio internacional. Deseja continuar para o checkout internacional ou permanecer aqui e selecionar um endereço nacional?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Seu método de pagamento selecionado requer verificação adicional. Por favor, siga as instruções fornecidas pelo seu provedor de pagamento para completar a transação.',
|
|
@@ -818,8 +818,8 @@ export const stringsRussian = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Оплата прошла успешно! Благодарим вас за покупку! Надеемся, вам понравилось, и ваша поддержка очень важна для нас.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: '
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Выбранный вами адрес предназначен для международной доставки. Хотите продолжить к международному оформлению заказа или остаться здесь и выбрать внутренний адрес?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Ваш выбранный способ оплаты требует дополнительной проверки. Пожалуйста, следуйте инструкциям, предоставленным вашим поставщиком платежей, чтобы завершить транзакцию.',
|
|
@@ -818,8 +818,8 @@ export const stringsSpanish = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: '¡Su pago se realizó exitosamente! Gracias por comprar con nosotros. Esperamos que haya tenido una experiencia agradable y su apoyo significa mucho para nosotros.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Su dirección
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Su dirección seleccionada es de envío internacional. ¿Desea continuar al pago internacional o permanecer aquí y seleccionar una dirección nacional?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Su método de pago seleccionado requiere verificación adicional. Por favor, siga las instrucciones proporcionadas por su proveedor de pagos para completar la transacción.',
|
|
@@ -818,8 +818,8 @@ export const stringsSwedish = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Din betalning gick igenom framgångsrikt! Tack för att du handlar med oss! Vi hoppas att du har haft en trevlig upplevelse och ditt stöd betyder mycket för oss.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Din
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Din valda adress skickas internationellt. Vill du fortsätta till internationell kassa, eller stanna här och välja en inrikes adress?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Din valda betalningsmetod kräver ytterligare verifiering. Vänligen följ instruktionerna från din betalningsleverantör för att slutföra transaktionen.',
|
|
@@ -818,8 +818,8 @@ export const stringsTurkish = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Ödemeniz başarıyla tamamlandı! Bizimle alışveriş yaptığınız için teşekkür ederiz! Keyifli bir deneyim yaşadığınızı umuyoruz ve desteğiniz bizim için çok değerli.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: '
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Seçtiğiniz adres uluslararası gönderime sahiptir. Uluslararası ödemeye devam etmek mi yoksa burada kalıp yurt içi bir adres seçmek mi istersiniz?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Seçtiğiniz ödeme yöntemi ek doğrulama gerektirir. İşlemi tamamlamak için lütfen ödeme sağlayıcınız tarafından sağlanan talimatları izleyin.',
|
|
@@ -818,8 +818,8 @@ export const stringsVietnamese = {
|
|
|
818
818
|
'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
|
|
819
819
|
value: 'Thanh toán của bạn thành công! Cảm ơn bạn đã mua sắm với chúng tôi! Chúng tôi hy vọng bạn có trải nghiệm thú vị và sự ủng hộ của bạn thật sự ý nghĩa với chúng tôi.',
|
|
820
820
|
},
|
|
821
|
-
'Your
|
|
822
|
-
value: 'Địa chỉ
|
|
821
|
+
'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
|
|
822
|
+
value: 'Địa chỉ đã chọn của bạn là địa chỉ giao hàng quốc tế. Bạn muốn tiếp tục đến thanh toán quốc tế hay ở lại đây và chọn một địa chỉ trong nước?',
|
|
823
823
|
},
|
|
824
824
|
'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
|
|
825
825
|
value: 'Phương thức thanh toán bạn chọn yêu cầu xác minh bổ sung. Vui lòng làm theo hướng dẫn của nhà cung cấp thanh toán của bạn để hoàn tất giao dịch.',
|
|
@@ -11,10 +11,15 @@ import { getIsTestMode } from "./getIsTestMode";
|
|
|
11
11
|
*/
|
|
12
12
|
export const buildBigcommerceRedirectUrl = (pathname) => {
|
|
13
13
|
const url = new URL(pathname, window.location.origin);
|
|
14
|
-
const
|
|
14
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
15
|
+
const zonosQaUrl = searchParams.get('zonosQaUrl');
|
|
15
16
|
if (zonosQaUrl) {
|
|
16
17
|
url.searchParams.set('zonosQaUrl', zonosQaUrl);
|
|
17
18
|
}
|
|
19
|
+
// zonosDebug=1
|
|
20
|
+
if (searchParams.get('zonosDebug') === '1') {
|
|
21
|
+
url.searchParams.set('zonosDebug', '1');
|
|
22
|
+
}
|
|
18
23
|
if (getIsTestMode()) {
|
|
19
24
|
url.searchParams.set('zonosTestMode', '1');
|
|
20
25
|
}
|
|
@@ -9,6 +9,11 @@ import { isShippableCountry } from "./isShippableCountry";
|
|
|
9
9
|
import { log } from "../logging/log";
|
|
10
10
|
import { logError } from "../logging/logError";
|
|
11
11
|
const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
|
|
12
|
+
/**
|
|
13
|
+
* Native BigCommerce shipping-step "Continue" button. Clicking it commits the
|
|
14
|
+
* selected shipping address and advances to the payment step.
|
|
15
|
+
*/
|
|
16
|
+
const BIGCOMMERCE_SHIPPING_CONTINUE_SELECTOR = '#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue';
|
|
12
17
|
/**
|
|
13
18
|
* Check if the logged-in user already has a shipping address on the checkout
|
|
14
19
|
* that is internationally shippable. If so, optionally prompt the user to
|
|
@@ -116,11 +121,11 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
116
121
|
overrideShippingCountry);
|
|
117
122
|
if (!shippingCountry) {
|
|
118
123
|
// do nothing if shipping country is not found
|
|
119
|
-
return
|
|
124
|
+
return 'noAction';
|
|
120
125
|
}
|
|
121
126
|
if (!isShippableCountry(false, shippingCountry)) {
|
|
122
127
|
// do nothing if shipping country is not shippable
|
|
123
|
-
return
|
|
128
|
+
return 'noAction';
|
|
124
129
|
}
|
|
125
130
|
// Only check bypass after confirming the country is shippable (i.e. user is
|
|
126
131
|
// about to be redirected to Zonos international checkout). Force-refresh so
|
|
@@ -141,7 +146,7 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
141
146
|
// Logged-in customer is in a bypass group — keep them on BC native
|
|
142
147
|
// checkout and stop polling / fetching further.
|
|
143
148
|
log('Bypass customer group detected on BC checkout, stopping interval', 'info');
|
|
144
|
-
return
|
|
149
|
+
return 'bypass';
|
|
145
150
|
}
|
|
146
151
|
// Same force-login gate as the logged-in-default-address path — we run
|
|
147
152
|
// it *after* the bypass check so reseller groups never see the login
|
|
@@ -149,7 +154,7 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
149
154
|
const forceLogin = await checkBigCommerceForceLogin({ preFetched });
|
|
150
155
|
if (forceLogin.shouldForceLogin && forceLogin.redirectUrl) {
|
|
151
156
|
window.location.href = forceLogin.redirectUrl;
|
|
152
|
-
return
|
|
157
|
+
return 'redirected';
|
|
153
158
|
}
|
|
154
159
|
if (onInternationalCheckoutSelected) {
|
|
155
160
|
await onInternationalCheckoutSelected();
|
|
@@ -186,7 +191,135 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
186
191
|
// having domestic shipping session. Carry over zonosQaUrl / zonosTestMode
|
|
187
192
|
// so the destination page keeps using the same build/env.
|
|
188
193
|
window.location.href = buildBigcommerceRedirectUrl('/');
|
|
189
|
-
return
|
|
194
|
+
return 'redirected';
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* When `true`, the logged-in "Continue" hook re-dispatched the shopper's
|
|
198
|
+
* click so BigCommerce's own handler can run (domestic / bypass case). The
|
|
199
|
+
* hook's listener sees this flag and lets the event through untouched.
|
|
200
|
+
*/
|
|
201
|
+
let isBypassingContinueHook = false;
|
|
202
|
+
/**
|
|
203
|
+
* Set to `true` once the document-level "Continue" click delegation has been
|
|
204
|
+
* attached, so opting out repeatedly doesn't bind it more than once.
|
|
205
|
+
*/
|
|
206
|
+
let loggedInContinueDelegationAttached = false;
|
|
207
|
+
/**
|
|
208
|
+
* Resolve the shopper's currently-selected shipping country on the BC native
|
|
209
|
+
* checkout. Logged-in shoppers picking a saved address don't expose a
|
|
210
|
+
* country `<select>`, so read it from the active checkout consignment via the
|
|
211
|
+
* Storefront API; fall back to the `<select>` value when one is present.
|
|
212
|
+
*/
|
|
213
|
+
const resolveSelectedShippingCountry = async () => {
|
|
214
|
+
var _a, _b, _c, _d;
|
|
215
|
+
const checkoutId = await fetchCheckoutId();
|
|
216
|
+
if (checkoutId) {
|
|
217
|
+
const checkout = await fetchBigCommerceCheckout(checkoutId);
|
|
218
|
+
const consignmentCountry = (_c = (_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.consignments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.shippingAddress) === null || _c === void 0 ? void 0 : _c.countryCode;
|
|
219
|
+
if (consignmentCountry) {
|
|
220
|
+
return consignmentCountry;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
const shipToCountryElement = document.querySelector(((_d = zonosStore.genericSettings) === null || _d === void 0 ? void 0 : _d.bigcommerceDomesticCheckoutCountrySelector) ||
|
|
224
|
+
FALLBACK_SHIP_TO_COUNTRY_SELECTOR);
|
|
225
|
+
return (shipToCountryElement === null || shipToCountryElement === void 0 ? void 0 : shipToCountryElement.value) || null;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Req 2 (05CHECK-887): once a logged-in shopper with an international default
|
|
229
|
+
* address has chosen to "Stay on this page", we must still force them onto
|
|
230
|
+
* the Zonos international checkout if they end up committing an international
|
|
231
|
+
* shipping address. BC's saved-address flow exposes no country `<select>` to
|
|
232
|
+
* poll, so we hook the native shipping "Continue" button and re-check the
|
|
233
|
+
* selected consignment country when the shopper tries to advance.
|
|
234
|
+
*/
|
|
235
|
+
/**
|
|
236
|
+
* Resolve the selected shipping country when the shopper clicks the native
|
|
237
|
+
* BC "Continue" button and, if it's international, redirect to the Zonos
|
|
238
|
+
* checkout. On any outcome other than a redirect — domestic, bypass group,
|
|
239
|
+
* or an unexpected error — replay the click so BigCommerce's own handler runs
|
|
240
|
+
* and the shopper is never left stuck on the shipping step.
|
|
241
|
+
*/
|
|
242
|
+
const handleLoggedInInternationalContinue = async (continueButton, observer) => {
|
|
243
|
+
// Default to replaying the native click; only a confirmed international
|
|
244
|
+
// redirect (page navigating away) suppresses it.
|
|
245
|
+
let shouldReplayClick = true;
|
|
246
|
+
try {
|
|
247
|
+
let country = null;
|
|
248
|
+
try {
|
|
249
|
+
country = await resolveSelectedShippingCountry();
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
logError('Error resolving selected shipping country on BC continue', error);
|
|
253
|
+
}
|
|
254
|
+
// When the shopper is committing an international address we're about to
|
|
255
|
+
// save the domestic shipping session and redirect to `/`. Disconnect this
|
|
256
|
+
// /checkout-page observer first: otherwise its own session-detection
|
|
257
|
+
// branch races the save — it would append the hidden redirect button and
|
|
258
|
+
// open checkout locally, consuming and clearing the session before the
|
|
259
|
+
// navigation to `/` lands, leaving the redirect a no-op. (The `/` page
|
|
260
|
+
// runs its own fresh watcher to open checkout.)
|
|
261
|
+
if (country && isShippableCountry(false, country)) {
|
|
262
|
+
observer.disconnect();
|
|
263
|
+
}
|
|
264
|
+
const decision = country
|
|
265
|
+
? await handleInternationalCheckoutSelected(country)
|
|
266
|
+
: 'noAction';
|
|
267
|
+
// `redirected` → the page is navigating to the Zonos international
|
|
268
|
+
// checkout, so don't replay. `bypass` / `noAction` → the shopper stays on
|
|
269
|
+
// BC native checkout, so fall through and replay the click.
|
|
270
|
+
if (decision === 'redirected') {
|
|
271
|
+
shouldReplayClick = false;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
// We already blocked BC's native click; if resolving the country or the
|
|
276
|
+
// redirect helper throws, replay so BC can advance rather than leaving
|
|
277
|
+
// the shopper stuck on the shipping step.
|
|
278
|
+
logError('Error handling BC continue international redirect', error);
|
|
279
|
+
}
|
|
280
|
+
if (shouldReplayClick) {
|
|
281
|
+
isBypassingContinueHook = true;
|
|
282
|
+
continueButton.click();
|
|
283
|
+
isBypassingContinueHook = false;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Req 2 (05CHECK-887): attach the logged-in international-redirect hook via a
|
|
288
|
+
* single capture-phase listener on `document` (delegation) rather than
|
|
289
|
+
* binding the button node directly. Delegation is resilient to BC
|
|
290
|
+
* re-rendering the shipping step and — crucially — to the MutationObserver
|
|
291
|
+
* disconnecting once the country `<select>` path sets up its polling
|
|
292
|
+
* interval: the "Continue" button may only render after that point, so a
|
|
293
|
+
* node-bound listener attached from the observer could miss it entirely.
|
|
294
|
+
* Attached once, on opt-out.
|
|
295
|
+
*/
|
|
296
|
+
const attachLoggedInInternationalContinueDelegation = (observer) => {
|
|
297
|
+
if (loggedInContinueDelegationAttached) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
loggedInContinueDelegationAttached = true;
|
|
301
|
+
document.addEventListener('click', event => {
|
|
302
|
+
// Programmatic replay for the domestic / bypass case — let BC's own
|
|
303
|
+
// handler run without interference.
|
|
304
|
+
if (isBypassingContinueHook) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const { target } = event;
|
|
308
|
+
if (!(target instanceof Element)) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const continueButton = target.closest(BIGCOMMERCE_SHIPPING_CONTINUE_SELECTOR);
|
|
312
|
+
if (!continueButton) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
// Block BC's native advance until we know whether the selected shipping
|
|
316
|
+
// country forces an international redirect. Capture phase +
|
|
317
|
+
// stopImmediatePropagation (done synchronously here, before the async
|
|
318
|
+
// handler) prevents BC's React click handler from firing.
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
event.stopImmediatePropagation();
|
|
321
|
+
void handleLoggedInInternationalContinue(continueButton, observer);
|
|
322
|
+
}, true);
|
|
190
323
|
};
|
|
191
324
|
let isProcessing = false;
|
|
192
325
|
let intervalCreated = false;
|
|
@@ -262,6 +395,10 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
262
395
|
// observer logic so the country-change watcher still fires when
|
|
263
396
|
// the user manually picks an international country in BC's UI.
|
|
264
397
|
loggedInAddressCheckSkipped = true;
|
|
398
|
+
// Attach the "Continue" redirect hook now (once). Delegation on
|
|
399
|
+
// `document` keeps it working even after this observer disconnects
|
|
400
|
+
// when the country <select> path sets up its interval below.
|
|
401
|
+
attachLoggedInInternationalContinueDelegation(observer);
|
|
265
402
|
}
|
|
266
403
|
}
|
|
267
404
|
catch (error) {
|
|
@@ -297,11 +434,11 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
297
434
|
}
|
|
298
435
|
isProcessing = true;
|
|
299
436
|
try {
|
|
300
|
-
const
|
|
437
|
+
const decision = await handleInternationalCheckoutSelected();
|
|
301
438
|
// Stop the interval once either:
|
|
302
439
|
// - the user is being redirected to Zonos international checkout
|
|
303
440
|
// - the logged-in customer is in a bypass group (stay on BC checkout)
|
|
304
|
-
if (
|
|
441
|
+
if (decision === 'redirected' || decision === 'bypass') {
|
|
305
442
|
clearInterval(interval);
|
|
306
443
|
return;
|
|
307
444
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import { isSameHostCheckoutLink } from "./isSameHostCheckoutLink";
|
|
1
2
|
export const formatStringWithLinks = (str) => {
|
|
2
3
|
// Match Markdown-style links or standalone URLs not in Markdown format
|
|
3
4
|
const linkRegex = /\[([^\]]+)\]\((https?:\/\/[^\s\)]+)\)|(https?:\/\/[^\s]+)/g;
|
|
4
5
|
const messageWithLinks = str.replace(linkRegex, (_match, text, markdownUrl, url) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
const href = markdownUrl || url;
|
|
8
|
+
// For BigCommerce, a same-host `/checkout` link navigates the current tab
|
|
9
|
+
// (`_self`) instead of opening a new one — the Zonos checkout unloads and
|
|
10
|
+
// the native checkout opens in its place rather than leaving two
|
|
11
|
+
// checkouts open at once (05CHECK-887).
|
|
12
|
+
const target = !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.isBigCommerce) && isSameHostCheckoutLink(href)
|
|
13
|
+
? '_self'
|
|
14
|
+
: '_blank';
|
|
15
|
+
const label = markdownUrl ? text : url;
|
|
16
|
+
return `<zonos-link href="${href}" target="${target}" rel="noopener noreferrer">${label}</zonos-link>`;
|
|
11
17
|
});
|
|
12
18
|
return messageWithLinks;
|
|
13
19
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a link points at the same-origin native `/checkout` page.
|
|
3
|
+
*
|
|
4
|
+
* Merchant custom messages in the international checkout can contain a link
|
|
5
|
+
* like "click here to complete checkout" that targets the store's native
|
|
6
|
+
* BigCommerce checkout. When that link is same-host `/checkout`, we want it to
|
|
7
|
+
* navigate the current tab instead of opening a new one — so the Zonos checkout
|
|
8
|
+
* unloads and the native checkout opens in its place rather than leaving two
|
|
9
|
+
* checkouts open at once (05CHECK-887).
|
|
10
|
+
*
|
|
11
|
+
* Returns `false` for cross-origin links, non-`/checkout` paths, or unparsable
|
|
12
|
+
* hrefs (which should keep their default new-tab behavior).
|
|
13
|
+
*/
|
|
14
|
+
export const isSameHostCheckoutLink = (href) => {
|
|
15
|
+
try {
|
|
16
|
+
const url = new URL(href, window.location.href);
|
|
17
|
+
// Normalize a trailing slash so `/checkout` and `/checkout/` both match.
|
|
18
|
+
const pathname = url.pathname.replace(/\/+$/, '');
|
|
19
|
+
return (url.hostname === window.location.hostname && pathname === '/checkout');
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
};
|