@zonos/elements 1.2.4-alpha.6 → 1.2.4-alpha.8
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-7ad04cdb.js → cart-90f7c8c0.js} +36 -8
- package/dist/cjs/{getBorderRadius-a97a5f75.js → getBorderRadius-bf4a4276.js} +1 -1
- package/dist/cjs/{index-20cb112f.js → index-0dcccc22.js} +27 -16
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/{isDarkColor-261fcf3d.js → isDarkColor-ff6ff183.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{localization-5069ab0b.js → localization-9caf3397.js} +7 -7
- package/dist/cjs/{submitGtag-44e938ff.js → submitGtag-b141b45d.js} +2 -2
- package/dist/cjs/zonos-address_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +50 -8
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +8 -8
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
- package/dist/cjs/zonos-icon.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification.cjs.entry.js +2 -2
- package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/{zonosStore-a0fa5b77.js → zonosStore-b43ef5db.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +48 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +5 -2
- package/dist/collection/components/common/zonos-notification/zonos-notification.js +3 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +9 -6
- package/dist/collection/components/main/zonos-controller.js +16 -14
- package/dist/collection/components/store/checkout/cart.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +3 -2
- package/dist/collection/components/utils/api/calculateLandedCost.js +9 -1
- package/dist/collection/components/utils/api/checkItemRestrictions.js +1 -1
- package/dist/collection/components/utils/api/getCountries.js +1 -1
- package/dist/collection/components/utils/api/getCountryLandedCost.js +1 -1
- package/dist/collection/components/utils/api/getExchangeRate.js +1 -1
- package/dist/collection/components/utils/api/getLocaleMessages.js +1 -1
- package/dist/collection/components/utils/api/getLocalization.js +1 -1
- package/dist/collection/components/utils/api/getShippingZones.js +1 -1
- package/dist/collection/components/utils/api/getZonosSetting.js +1 -1
- package/dist/collection/components/utils/api/triggerBuildLandedCost.js +22 -0
- package/dist/collection/types/generated/graphql.customer.types.js +89 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +80 -6
- package/dist/components/cart.js +33 -5
- package/dist/components/localization.js +6 -6
- package/dist/components/zonos-checkout-finish2.js +47 -4
- package/dist/components/zonos-checkout.js +2 -0
- package/dist/components/zonos-controller.js +2 -2
- package/dist/components/zonos-hello.js +1 -1
- package/dist/esm/{cart-face98c8.js → cart-b439be00.js} +36 -8
- package/dist/esm/{getBorderRadius-35e8acce.js → getBorderRadius-178a0a05.js} +1 -1
- package/dist/esm/{index-3617e24c.js → index-36ff6342.js} +27 -16
- package/dist/esm/index.js +6 -6
- package/dist/esm/{isDarkColor-44e9e451.js → isDarkColor-416d6047.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{localization-ed07b7f0.js → localization-a51ccbc2.js} +7 -7
- package/dist/esm/{submitGtag-5b553683.js → submitGtag-521826a2.js} +2 -2
- package/dist/esm/zonos-address_2.entry.js +6 -6
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_2.entry.js +4 -4
- package/dist/esm/zonos-card_2.entry.js +2 -2
- package/dist/esm/zonos-cart-items_10.entry.js +50 -8
- package/dist/esm/zonos-checkout.entry.js +9 -7
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +8 -8
- package/dist/esm/zonos-country-flag_4.entry.js +4 -4
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +4 -4
- package/dist/esm/zonos-icon.entry.js +2 -2
- package/dist/esm/zonos-notification.entry.js +2 -2
- package/dist/esm/zonos-payment.entry.js +6 -6
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/{zonosStore-e0b7a5cf.js → zonosStore-61e74f58.js} +1 -1
- package/dist/esm-es5/cart-b439be00.js +1 -0
- package/dist/esm-es5/{getBorderRadius-35e8acce.js → getBorderRadius-178a0a05.js} +1 -1
- package/dist/esm-es5/index-36ff6342.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-44e9e451.js → isDarkColor-416d6047.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{localization-ed07b7f0.js → localization-a51ccbc2.js} +1 -1
- package/dist/esm-es5/{submitGtag-5b553683.js → submitGtag-521826a2.js} +1 -1
- package/dist/esm-es5/zonos-address_2.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_2.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-icon.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e0b7a5cf.js → zonosStore-61e74f58.js} +1 -1
- package/dist/scripts/loadZonos.js +3 -3
- package/dist/scripts/zonos.js +3 -3
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +5 -1
- package/dist/types/components/store/checkout/stripe.d.ts +1 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +5 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +254 -7
- package/dist/types/types/generated/graphql.customer.types.ts +310 -7
- package/dist/types/types/generated/graphql.frontend.types.d.ts +210 -11
- package/dist/types/types/generated/graphql.frontend.types.ts +358 -11
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-d8daeec4.system.entry.js → p-06fb9d1f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-77a7929b.js → p-089ba905.js} +1 -1
- package/dist/zonos-elements/{p-f0f9c43a.js → p-1685c8df.js} +1 -1
- package/dist/zonos-elements/p-18904b7c.system.js +2 -0
- package/dist/zonos-elements/p-19942abb.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b8d11094.entry.js → p-1d4a970b.entry.js} +1 -1
- package/dist/zonos-elements/{p-80ba24a8.system.js → p-24eed2a8.system.js} +1 -1
- package/dist/zonos-elements/{p-bec21999.system.js → p-24fbe845.system.js} +1 -1
- package/dist/zonos-elements/{p-55f1da18.entry.js → p-2801d868.entry.js} +1 -1
- package/dist/zonos-elements/{p-1dbaf24b.system.entry.js → p-2f43da39.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-99c9bd01.js → p-3c6988d7.js} +1 -1
- package/dist/zonos-elements/p-3cea383b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-86580e70.system.entry.js → p-47390db7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4846796a.js +1 -0
- package/dist/zonos-elements/p-494c77a7.entry.js +1 -0
- package/dist/zonos-elements/{p-00c99619.entry.js → p-49f09b91.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e396855.system.entry.js → p-4a15c5c7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-507e1954.system.entry.js → p-4bee0bff.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3eb33ba6.entry.js → p-4d93275c.entry.js} +1 -1
- package/dist/zonos-elements/{p-f09eb5c5.entry.js → p-4ed71bd7.entry.js} +1 -1
- package/dist/zonos-elements/{p-8bbad467.js → p-55f49f1e.js} +1 -1
- package/dist/zonos-elements/{p-114d8a14.system.entry.js → p-560aa686.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-03df1466.entry.js → p-639396bb.entry.js} +1 -1
- package/dist/zonos-elements/{p-3c64448f.system.entry.js → p-67154df2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9dbbacd9.entry.js → p-684ed483.entry.js} +1 -1
- package/dist/zonos-elements/{p-c743e43f.entry.js → p-89c210d6.entry.js} +1 -1
- package/dist/zonos-elements/{p-5aefdcdc.system.js → p-8c48b75e.system.js} +1 -1
- package/dist/zonos-elements/{p-4138e220.system.entry.js → p-8c5595d9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-263c1639.entry.js → p-938803f4.entry.js} +1 -1
- package/dist/zonos-elements/p-956efa27.js +2 -0
- package/dist/zonos-elements/{p-bca3d02f.entry.js → p-a0e36ed3.entry.js} +1 -1
- package/dist/zonos-elements/{p-b5bc4851.entry.js → p-a376a37f.entry.js} +1 -1
- package/dist/zonos-elements/p-a3a8b5e7.entry.js +1 -0
- package/dist/zonos-elements/{p-94f03799.system.js → p-a504f64f.system.js} +1 -1
- package/dist/zonos-elements/p-afe26069.entry.js +1 -0
- package/dist/zonos-elements/{p-f2ed98bb.system.entry.js → p-b4601210.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4db8bd2e.system.js → p-b51de536.system.js} +1 -1
- package/dist/zonos-elements/{p-9fa111f1.entry.js → p-b6148206.entry.js} +1 -1
- package/dist/zonos-elements/{p-643eeb24.system.js → p-b85be1ab.system.js} +1 -1
- package/dist/zonos-elements/{p-06ec9556.system.entry.js → p-c9348bb0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d2217f09.system.js +1 -0
- package/dist/zonos-elements/{p-7bd0ab43.system.entry.js → p-d856a200.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-754bdfdb.system.js → p-da060b1c.system.js} +1 -1
- package/dist/zonos-elements/{p-6f6d24da.entry.js → p-e1f6ab97.entry.js} +1 -1
- package/dist/zonos-elements/{p-3a7546f0.system.entry.js → p-e5ae22a9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c0f4461.system.entry.js → p-e98be2d0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e9b832c5.entry.js +1 -0
- package/dist/zonos-elements/{p-b2984730.system.entry.js → p-f141519c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-39ae023c.system.entry.js → p-f367f2fe.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ff95f098.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +7 -6
- package/dist/esm-es5/cart-face98c8.js +0 -1
- package/dist/esm-es5/index-3617e24c.js +0 -2
- package/dist/zonos-elements/p-39dfc72b.entry.js +0 -1
- package/dist/zonos-elements/p-3c40bb08.entry.js +0 -1
- package/dist/zonos-elements/p-47c110a4.system.js +0 -1
- package/dist/zonos-elements/p-5e6be2a3.entry.js +0 -1
- package/dist/zonos-elements/p-aeeaaa7a.system.entry.js +0 -1
- package/dist/zonos-elements/p-b944303a.system.entry.js +0 -1
- package/dist/zonos-elements/p-bec05c21.system.js +0 -2
- package/dist/zonos-elements/p-c6ed3777.js +0 -1
- package/dist/zonos-elements/p-cf8aaa17.js +0 -2
- package/dist/zonos-elements/p-d9ed23ec.entry.js +0 -1
- package/dist/zonos-elements/p-e1de2a1f.js +0 -1
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const localization = require('./localization-
|
|
7
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const localization = require('./localization-9caf3397.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
const isDarkColor = require('./isDarkColor-
|
|
9
|
+
const isDarkColor = require('./isDarkColor-ff6ff183.js');
|
|
10
10
|
|
|
11
11
|
const zonosCountryFlagCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";
|
|
12
12
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.9.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchBrowser = () => {
|
|
11
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('zonos-elements.cjs.js', document.baseURI).href));
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello.cjs",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog.cjs",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10.cjs",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello.cjs",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog.cjs",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10.cjs",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"order":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const localization = require('./localization-
|
|
7
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const localization = require('./localization-9caf3397.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
10
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
7
|
-
const localization = require('./localization-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
|
+
const localization = require('./localization-9caf3397.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
10
|
|
|
@@ -346,7 +346,7 @@ var debounce_1 = debounce;
|
|
|
346
346
|
|
|
347
347
|
const checkItemRestrictions = async ({ items, shipFrom, shipTo, }) => {
|
|
348
348
|
var _a;
|
|
349
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/check-item-restrictions`;
|
|
349
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/check-item-restrictions`;
|
|
350
350
|
const body = {
|
|
351
351
|
items,
|
|
352
352
|
shipFrom,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
|
|
8
8
|
const zonosIconCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--width);height:var(--height);fill:var(--color);color:var(--color)}";
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosNotificationCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999;bottom:var(--amino-space-24);gap:var(--amino-space-8);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:var(--amino-space-8);border-radius:var(--border-radius, var(--amino-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--amino-green-700)}:host .zonos--notification-item.error{background-color:var(--amino-red-700)}:host .zonos--notification-item.warning{background-color:var(--amino-orange-700)}";
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
require('./zonosStore-
|
|
8
|
-
require('./localization-
|
|
9
|
-
require('./isDarkColor-
|
|
10
|
-
require('./getBorderRadius-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const cart = require('./cart-90f7c8c0.js');
|
|
7
|
+
require('./zonosStore-b43ef5db.js');
|
|
8
|
+
require('./localization-9caf3397.js');
|
|
9
|
+
require('./isDarkColor-ff6ff183.js');
|
|
10
|
+
require('./getBorderRadius-bf4a4276.js');
|
|
11
11
|
|
|
12
12
|
const zonosPaymentCss = ".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";
|
|
13
13
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
|
|
9
9
|
const isColorVariable = require('./isColorVariable-41cacd82.js');
|
|
10
10
|
|
|
11
11
|
const zonosShippingRichRadioCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--border-radius, var(--amino-radius-10));border-bottom-left-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--selected-border-color, var(--amino-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const textOptions = {
|
|
@@ -2,7 +2,10 @@ import { Fragment, h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { stripeStore, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
|
|
3
3
|
import { translate } from "../../../store/translationStore";
|
|
4
4
|
import { getBorderRadius } from "../../../utils/getBorderRadius";
|
|
5
|
+
import { handleFetch } from "../../../utils/handleFetch";
|
|
6
|
+
import { logError } from "../../../utils/logging/logError";
|
|
5
7
|
import { submitGtag } from "../../../utils/submitGtag";
|
|
8
|
+
import { cartStore } from "../../../../types/index";
|
|
6
9
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
7
10
|
import RemoveIcon from "./assets/RemoveIcon.svg";
|
|
8
11
|
/* Need to use relative import because inline-svg-stencil couldn't resolve absolute path */
|
|
@@ -10,6 +13,36 @@ import RemoveIcon from "./assets/RemoveIcon.svg";
|
|
|
10
13
|
import SuccessIcon from "./assets/SuccessIcon.svg";
|
|
11
14
|
export class ZonosCheckoutFinish {
|
|
12
15
|
constructor() {
|
|
16
|
+
this.pullOrder = async () => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const baseUrl = process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL;
|
|
19
|
+
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
20
|
+
const { errors, json } = await handleFetch(`${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`);
|
|
21
|
+
if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
// TODO: This method of triggering /success for BigCommerce is for MVP. Remove when eventRegistry is fixed to handle by webhooks
|
|
25
|
+
if (window.Zonos.isBigCommerce) {
|
|
26
|
+
const orderId = json === null || json === void 0 ? void 0 : json.id;
|
|
27
|
+
const storeHash = (_b = (_a = json === null || json === void 0 ? void 0 : json.metadata) === null || _a === void 0 ? void 0 : _a.find(x => (x === null || x === void 0 ? void 0 : x.key) === 'storeHash')) === null || _b === void 0 ? void 0 : _b.value;
|
|
28
|
+
if (!orderId || !storeHash) {
|
|
29
|
+
return logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
|
|
30
|
+
}
|
|
31
|
+
void handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
|
|
32
|
+
}
|
|
33
|
+
return json;
|
|
34
|
+
};
|
|
35
|
+
this.getPullOrder = async (attempts = 0) => {
|
|
36
|
+
const order = await this.pullOrder();
|
|
37
|
+
if (order) {
|
|
38
|
+
this.order = order;
|
|
39
|
+
}
|
|
40
|
+
else if (!order && attempts < 5) {
|
|
41
|
+
// Wait for 1 second before the next attempt
|
|
42
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
43
|
+
await this.getPullOrder(attempts + 1);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
13
46
|
this.checkPaymentStatus = async () => {
|
|
14
47
|
this.isLoading = true;
|
|
15
48
|
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
|
|
@@ -35,6 +68,10 @@ export class ZonosCheckoutFinish {
|
|
|
35
68
|
});
|
|
36
69
|
document.dispatchEvent(successEvent);
|
|
37
70
|
}
|
|
71
|
+
// Attempt to pull the order details from the graph every second on 5 attempts
|
|
72
|
+
if (this.notificationType === 'success') {
|
|
73
|
+
void this.getPullOrder();
|
|
74
|
+
}
|
|
38
75
|
}
|
|
39
76
|
stripeStoreReset();
|
|
40
77
|
this.isLoading = false;
|
|
@@ -49,6 +86,7 @@ export class ZonosCheckoutFinish {
|
|
|
49
86
|
this.notificationType = 'success';
|
|
50
87
|
this.notificationTitle = '';
|
|
51
88
|
this.notificationMessages = [];
|
|
89
|
+
this.order = null;
|
|
52
90
|
}
|
|
53
91
|
componentDidLoad() {
|
|
54
92
|
if (this.overrideNotification) {
|
|
@@ -62,9 +100,16 @@ export class ZonosCheckoutFinish {
|
|
|
62
100
|
void this.checkPaymentStatus();
|
|
63
101
|
}
|
|
64
102
|
render() {
|
|
103
|
+
// TODO: Keeping this code for when we have a UI for order details
|
|
104
|
+
// const orderTotal = this.order?.amountSubtotals
|
|
105
|
+
// ? Object.values(this.order.amountSubtotals).reduce((a, b) => a + b, 0)
|
|
106
|
+
// : 0;
|
|
107
|
+
// const totalItems = this.order?.items?.reduce((acc, item) => {
|
|
108
|
+
// return acc + item.quantity;
|
|
109
|
+
// }, 0);
|
|
65
110
|
return (h(Host, { class: "zonos--checkout-finish zonos--elements", style: {
|
|
66
111
|
'--border-radius': getBorderRadius(this.borderRadius),
|
|
67
|
-
} }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { color: 'blue-800', content: SuccessIcon, size: 50 })) : (h("zonos-icon", { color: 'red-800', content: RemoveIcon, size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping'))))));
|
|
112
|
+
} }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h(Fragment, null, h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { color: 'blue-800', content: SuccessIcon, size: 50 })) : (h("zonos-icon", { color: 'red-800', content: RemoveIcon, size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping')))))));
|
|
68
113
|
}
|
|
69
114
|
static get is() { return "zonos-checkout-finish"; }
|
|
70
115
|
static get encapsulation() { return "shadow"; }
|
|
@@ -155,7 +200,8 @@ export class ZonosCheckoutFinish {
|
|
|
155
200
|
"isLoading": {},
|
|
156
201
|
"notificationType": {},
|
|
157
202
|
"notificationTitle": {},
|
|
158
|
-
"notificationMessages": {}
|
|
203
|
+
"notificationMessages": {},
|
|
204
|
+
"order": {}
|
|
159
205
|
};
|
|
160
206
|
}
|
|
161
207
|
static get events() {
|
|
@@ -290,6 +290,8 @@ export class ZonosCheckout {
|
|
|
290
290
|
// Update the URL without query parameters
|
|
291
291
|
window.history.replaceState({}, document.title, cleanUrl);
|
|
292
292
|
this.open = false;
|
|
293
|
+
// Reload the page
|
|
294
|
+
window.location.reload();
|
|
293
295
|
}
|
|
294
296
|
async handleBackClick() {
|
|
295
297
|
// close the modal if back button is clicked on customer info step
|
|
@@ -551,8 +553,9 @@ export class ZonosCheckout {
|
|
|
551
553
|
"complexType": {
|
|
552
554
|
"signature": "(forcePaymentStatus?: PaymentIntent['status']) => Promise<void>",
|
|
553
555
|
"parameters": [{
|
|
554
|
-
"
|
|
555
|
-
"
|
|
556
|
+
"name": "forcePaymentStatus",
|
|
557
|
+
"type": "Status | undefined",
|
|
558
|
+
"docs": ""
|
|
556
559
|
}],
|
|
557
560
|
"references": {
|
|
558
561
|
"Promise": {
|
|
@@ -103,8 +103,9 @@ export class ZonosNotification {
|
|
|
103
103
|
"complexType": {
|
|
104
104
|
"signature": "(notification: NotificationInit) => Promise<void>",
|
|
105
105
|
"parameters": [{
|
|
106
|
-
"
|
|
107
|
-
"
|
|
106
|
+
"name": "notification",
|
|
107
|
+
"type": "{ message: string; timeout?: number | undefined; type?: \"error\" | \"success\" | \"warning\" | undefined; }",
|
|
108
|
+
"docs": ""
|
|
108
109
|
}],
|
|
109
110
|
"references": {
|
|
110
111
|
"Promise": {
|
|
@@ -396,8 +396,9 @@ export class ZonosHello {
|
|
|
396
396
|
"complexType": {
|
|
397
397
|
"signature": "(value: number) => Promise<void>",
|
|
398
398
|
"parameters": [{
|
|
399
|
-
"
|
|
400
|
-
"
|
|
399
|
+
"name": "value",
|
|
400
|
+
"type": "number",
|
|
401
|
+
"docs": ""
|
|
401
402
|
}],
|
|
402
403
|
"references": {
|
|
403
404
|
"Promise": {
|
|
@@ -419,8 +420,9 @@ export class ZonosHello {
|
|
|
419
420
|
"complexType": {
|
|
420
421
|
"signature": "(value: number) => Promise<void>",
|
|
421
422
|
"parameters": [{
|
|
422
|
-
"
|
|
423
|
-
"
|
|
423
|
+
"name": "value",
|
|
424
|
+
"type": "number",
|
|
425
|
+
"docs": ""
|
|
424
426
|
}],
|
|
425
427
|
"references": {
|
|
426
428
|
"Promise": {
|
|
@@ -442,8 +444,9 @@ export class ZonosHello {
|
|
|
442
444
|
"complexType": {
|
|
443
445
|
"signature": "(value: number) => Promise<void>",
|
|
444
446
|
"parameters": [{
|
|
445
|
-
"
|
|
446
|
-
"
|
|
447
|
+
"name": "value",
|
|
448
|
+
"type": "number",
|
|
449
|
+
"docs": ""
|
|
447
450
|
}],
|
|
448
451
|
"references": {
|
|
449
452
|
"Promise": {
|
|
@@ -94,7 +94,7 @@ export class ZonosController {
|
|
|
94
94
|
zonosStore.appearance = Object.assign(Object.assign({}, zonosStore.appearance), { fontFamily: overrideFont });
|
|
95
95
|
}
|
|
96
96
|
const routeUrl = process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL;
|
|
97
|
-
const { errors, json } = await handleFetch(`${routeUrl}/api/get-font-detail?family=${fontSelected}`);
|
|
97
|
+
const { errors, json } = await handleFetch(`${routeUrl}/api/zonos-elements/get-font-detail?family=${fontSelected}`);
|
|
98
98
|
if (errors.length > 0 || !json) {
|
|
99
99
|
log(`Failed to load font ${fontSelected}`, 'warn');
|
|
100
100
|
return;
|
|
@@ -273,8 +273,9 @@ export class ZonosController {
|
|
|
273
273
|
"complexType": {
|
|
274
274
|
"signature": "(stripe: Stripe) => Promise<void>",
|
|
275
275
|
"parameters": [{
|
|
276
|
-
"
|
|
277
|
-
"
|
|
276
|
+
"name": "stripe",
|
|
277
|
+
"type": "Stripe",
|
|
278
|
+
"docs": ""
|
|
278
279
|
}],
|
|
279
280
|
"references": {
|
|
280
281
|
"Promise": {
|
|
@@ -298,8 +299,9 @@ export class ZonosController {
|
|
|
298
299
|
"complexType": {
|
|
299
300
|
"signature": "(overrideFont?: string) => Promise<void>",
|
|
300
301
|
"parameters": [{
|
|
301
|
-
"
|
|
302
|
-
"
|
|
302
|
+
"name": "overrideFont",
|
|
303
|
+
"type": "string | undefined",
|
|
304
|
+
"docs": ""
|
|
303
305
|
}],
|
|
304
306
|
"references": {
|
|
305
307
|
"Promise": {
|
|
@@ -318,8 +320,9 @@ export class ZonosController {
|
|
|
318
320
|
"complexType": {
|
|
319
321
|
"signature": "(notification: NotificationInit) => Promise<void>",
|
|
320
322
|
"parameters": [{
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
+
"name": "notification",
|
|
324
|
+
"type": "{ message: string; timeout?: number | undefined; type?: \"error\" | \"success\" | \"warning\" | undefined; }",
|
|
325
|
+
"docs": ""
|
|
323
326
|
}],
|
|
324
327
|
"references": {
|
|
325
328
|
"Promise": {
|
|
@@ -343,11 +346,9 @@ export class ZonosController {
|
|
|
343
346
|
"complexType": {
|
|
344
347
|
"signature": "(config: LoadZonosParamsConfig) => Promise<void>",
|
|
345
348
|
"parameters": [{
|
|
346
|
-
"
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}],
|
|
350
|
-
"text": "config that need to override the default setting"
|
|
349
|
+
"name": "config",
|
|
350
|
+
"type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; onlineStoreSettings?: Partial<OnlineStoreConfig> | undefined; }",
|
|
351
|
+
"docs": "config that need to override the default setting"
|
|
351
352
|
}],
|
|
352
353
|
"references": {
|
|
353
354
|
"Promise": {
|
|
@@ -374,8 +375,9 @@ export class ZonosController {
|
|
|
374
375
|
"complexType": {
|
|
375
376
|
"signature": "(countryCode: CountryCode) => Promise<void>",
|
|
376
377
|
"parameters": [{
|
|
377
|
-
"
|
|
378
|
-
"
|
|
378
|
+
"name": "countryCode",
|
|
379
|
+
"type": "\"CI\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AQ\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BR\" | \"BS\" | \"BT\" | \"BV\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CF\" | \"CG\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CV\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB\" | \"GD\" | \"GE\" | \"GF\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GP\" | \"GQ\" | \"GR\" | \"GS\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HM\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"IC\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MF\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NC\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PM\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RE\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SD\" | \"SE\" | \"SG\" | \"SH\" | \"SI\" | \"SJ\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TF\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"UM\" | \"US\" | \"UY\" | \"UZ\" | \"VA\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WF\" | \"WS\" | \"YE\" | \"YT\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
|
380
|
+
"docs": ""
|
|
379
381
|
}],
|
|
380
382
|
"references": {
|
|
381
383
|
"Promise": {
|
|
@@ -80,7 +80,7 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
|
|
|
80
80
|
}
|
|
81
81
|
// update checkout session
|
|
82
82
|
if (!cartStore.checkoutSessionId) {
|
|
83
|
-
logError('Could update cart total without checkout session id');
|
|
83
|
+
logError('Could not update cart total without checkout session id');
|
|
84
84
|
return false;
|
|
85
85
|
}
|
|
86
86
|
const { json } = await stripeStoreUpdateCheckoutSession({
|
|
@@ -19,6 +19,7 @@ const { onChange, reset, state: stripeStore, } = createStore(() => ({
|
|
|
19
19
|
stripeAddressElement: null,
|
|
20
20
|
stripeAddressEventData: null,
|
|
21
21
|
stripeAddressUsedWhenFetchingLC: null,
|
|
22
|
+
stripeBillingAddressElement: null,
|
|
22
23
|
stripeElements: null,
|
|
23
24
|
stripeElementsOptions: null,
|
|
24
25
|
stripeLinkElement: null,
|
|
@@ -264,7 +265,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
264
265
|
return false;
|
|
265
266
|
}
|
|
266
267
|
stripeStore.isFetchingSession = true;
|
|
267
|
-
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/create-checkout-session`, {
|
|
268
|
+
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/create-checkout-session`, {
|
|
268
269
|
body: {
|
|
269
270
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
270
271
|
itemsAmount: total,
|
|
@@ -292,7 +293,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
292
293
|
const stripeStoreUpdateCheckoutSession = async ({ currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
|
|
293
294
|
// No need to set loading state here because this function will be called under the hood to update
|
|
294
295
|
// landed cost id for the section.
|
|
295
|
-
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/update-checkout-session`, {
|
|
296
|
+
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/update-checkout-session`, {
|
|
296
297
|
body: {
|
|
297
298
|
currency,
|
|
298
299
|
id,
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { zonosStore } from "../../store/zonosStore";
|
|
1
2
|
import { prepCalculateLandedCost } from "./prepCalculateLandedCost";
|
|
3
|
+
import { triggerBuildLandedCost } from "./triggerBuildLandedCost";
|
|
2
4
|
import { handleFetch } from "../handleFetch";
|
|
3
5
|
export const calculateLandedCost = async (abortController) => {
|
|
6
|
+
// If buildLandedCost callback is supplied, use that instead of our regular request to '/calculate-landed-cost'
|
|
7
|
+
const buildLandedCost = zonosStore.checkoutSettings.buildLandedCost;
|
|
8
|
+
if (buildLandedCost) {
|
|
9
|
+
const json = await triggerBuildLandedCost(buildLandedCost);
|
|
10
|
+
return json;
|
|
11
|
+
}
|
|
4
12
|
// request to get landed cost info
|
|
5
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/calculate-landed-cost`;
|
|
13
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/calculate-landed-cost`;
|
|
6
14
|
const { errors, json } = await handleFetch(url, {
|
|
7
15
|
body: prepCalculateLandedCost(),
|
|
8
16
|
method: 'POST',
|
|
@@ -2,7 +2,7 @@ import { handleFetch } from "../handleFetch";
|
|
|
2
2
|
import { logError } from "../logging/logError";
|
|
3
3
|
export const checkItemRestrictions = async ({ items, shipFrom, shipTo, }) => {
|
|
4
4
|
var _a;
|
|
5
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/check-item-restrictions`;
|
|
5
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/check-item-restrictions`;
|
|
6
6
|
const body = {
|
|
7
7
|
items,
|
|
8
8
|
shipFrom,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handleFetch } from "../handleFetch";
|
|
2
2
|
export const getCountries = async () => {
|
|
3
3
|
try {
|
|
4
|
-
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/get-countries`, {
|
|
4
|
+
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/get-countries`, {
|
|
5
5
|
method: 'GET',
|
|
6
6
|
});
|
|
7
7
|
if (errors.length || !json) {
|
|
@@ -5,7 +5,7 @@ export const getCountryLandedCost = async (countryCode) => {
|
|
|
5
5
|
if (!countryCode) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/country-landed-cost/${countryCode}`;
|
|
8
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/country-landed-cost/${countryCode}`;
|
|
9
9
|
const { errors, json } = await handleFetch(url);
|
|
10
10
|
if (errors.length || !json) {
|
|
11
11
|
logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
@@ -6,7 +6,7 @@ export const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, t
|
|
|
6
6
|
if (sourceCurrency === targetCurrency && !isGuaranteed) {
|
|
7
7
|
return { exchangeRate: null, maxAge: null };
|
|
8
8
|
}
|
|
9
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}
|
|
9
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}`;
|
|
10
10
|
const { errors, json } = await handleFetch(url);
|
|
11
11
|
if (errors.length || !json) {
|
|
12
12
|
logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handleFetch } from "../handleFetch";
|
|
2
2
|
export const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
|
|
3
3
|
var _a;
|
|
4
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
|
|
4
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
|
|
5
5
|
const { errors, json } = await handleFetch(url);
|
|
6
6
|
if (errors.length || !json) {
|
|
7
7
|
// eslint-disable-next-line no-console
|
|
@@ -6,7 +6,7 @@ export const getLocalization = async () => {
|
|
|
6
6
|
// load and use country from session storage when zCountry query param is not present
|
|
7
7
|
const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
|
|
8
8
|
const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
|
|
9
|
-
const localizationUrl = new URL(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/localization`);
|
|
9
|
+
const localizationUrl = new URL(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/localization`);
|
|
10
10
|
if (zCountry) {
|
|
11
11
|
localizationUrl.searchParams.set('zCountry', zCountry);
|
|
12
12
|
}
|
|
@@ -2,7 +2,7 @@ import { handleFetch } from "../handleFetch";
|
|
|
2
2
|
import { logError } from "../logging/logError";
|
|
3
3
|
export const getShippingZones = async () => {
|
|
4
4
|
var _a, _b;
|
|
5
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/shipping-zones`;
|
|
5
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/shipping-zones`;
|
|
6
6
|
const { errors, json } = await handleFetch(url);
|
|
7
7
|
if (errors.length || !json) {
|
|
8
8
|
logError(`Error fetching shipping zones: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handleFetch } from "../handleFetch";
|
|
2
2
|
import { logError } from "../logging/logError";
|
|
3
3
|
export const getZonosSetting = async () => {
|
|
4
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-
|
|
4
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/zonos-settings`;
|
|
5
5
|
const { errors, json } = await handleFetch(url);
|
|
6
6
|
if (errors.length) {
|
|
7
7
|
logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
|