@gomusdev/web-components 4.14.1 → 4.14.2
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/README.md
CHANGED
|
@@ -18667,8 +18667,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18667
18667
|
if (beforeSubmit) await beforeSubmit(form.details.formData);
|
|
18668
18668
|
const meta = checkout.data.meta;
|
|
18669
18669
|
const navigateTo = configStore.config.navigateTo;
|
|
18670
|
-
if (meta.status === "success")
|
|
18671
|
-
|
|
18670
|
+
if (meta.status === "success") {
|
|
18671
|
+
const checkoutSuccess = configStore.config.urls.checkoutSuccess ?? shop.urls.checkoutSuccess;
|
|
18672
|
+
navigateTo?.(checkoutSuccess(checkout.data.order.token));
|
|
18673
|
+
} else if (meta.status === "fail") navigateTo?.(shop.urls.checkoutFailure(""));
|
|
18672
18674
|
else if (meta.payment_url) navigateTo?.(meta.payment_url);
|
|
18673
18675
|
else if (meta.payment_data) postToPaymentProvider(meta.payment_data);
|
|
18674
18676
|
else navigateTo?.(shop.urls.checkoutFailure(""));
|
|
@@ -18666,8 +18666,10 @@ async function finalizeCheckout(form, formId) {
|
|
|
18666
18666
|
if (beforeSubmit) await beforeSubmit(form.details.formData);
|
|
18667
18667
|
const meta = checkout.data.meta;
|
|
18668
18668
|
const navigateTo = configStore.config.navigateTo;
|
|
18669
|
-
if (meta.status === "success")
|
|
18670
|
-
|
|
18669
|
+
if (meta.status === "success") {
|
|
18670
|
+
const checkoutSuccess = configStore.config.urls.checkoutSuccess ?? shop.urls.checkoutSuccess;
|
|
18671
|
+
navigateTo?.(checkoutSuccess(checkout.data.order.token));
|
|
18672
|
+
} else if (meta.status === "fail") navigateTo?.(shop.urls.checkoutFailure(""));
|
|
18671
18673
|
else if (meta.payment_url) navigateTo?.(meta.payment_url);
|
|
18672
18674
|
else if (meta.payment_data) postToPaymentProvider(meta.payment_data);
|
|
18673
18675
|
else navigateTo?.(shop.urls.checkoutFailure(""));
|