@open-mercato/checkout 0.6.7-develop.6862.1.c11a64ce0a → 0.6.7
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/checkout/api/pay/[slug]/submit/route.js +28 -43
- package/dist/modules/checkout/api/pay/[slug]/submit/route.js.map +2 -2
- package/dist/modules/checkout/api/transactions/route.js +6 -23
- package/dist/modules/checkout/api/transactions/route.js.map +2 -2
- package/dist/modules/checkout/backend/checkout/pay-links/page.js +1 -2
- package/dist/modules/checkout/backend/checkout/pay-links/page.js.map +2 -2
- package/dist/modules/checkout/backend/checkout/templates/page.js +1 -2
- package/dist/modules/checkout/backend/checkout/templates/page.js.map +2 -2
- package/dist/modules/checkout/backend/checkout/transactions/page.js +1 -2
- package/dist/modules/checkout/backend/checkout/transactions/page.js.map +2 -2
- package/dist/modules/checkout/commands/links.js +1 -1
- package/dist/modules/checkout/commands/links.js.map +2 -2
- package/dist/modules/checkout/commands/transactions.js +13 -45
- package/dist/modules/checkout/commands/transactions.js.map +2 -2
- package/dist/modules/checkout/components/PayPage.js +38 -39
- package/dist/modules/checkout/components/PayPage.js.map +2 -2
- package/dist/modules/checkout/search.js +6 -44
- package/dist/modules/checkout/search.js.map +2 -2
- package/dist/modules/checkout/setup.js +0 -28
- package/dist/modules/checkout/setup.js.map +2 -2
- package/dist/modules/checkout/workers/transaction-expiry.worker.js +2 -9
- package/dist/modules/checkout/workers/transaction-expiry.worker.js.map +2 -2
- package/package.json +9 -10
- package/src/modules/checkout/api/pay/[slug]/submit/__tests__/route.test.ts +0 -77
- package/src/modules/checkout/api/pay/[slug]/submit/route.ts +28 -58
- package/src/modules/checkout/api/transactions/route.ts +6 -30
- package/src/modules/checkout/backend/checkout/pay-links/page.tsx +1 -2
- package/src/modules/checkout/backend/checkout/templates/page.tsx +1 -2
- package/src/modules/checkout/backend/checkout/transactions/page.tsx +1 -2
- package/src/modules/checkout/commands/links.ts +1 -5
- package/src/modules/checkout/commands/transactions.ts +13 -68
- package/src/modules/checkout/components/PayPage.tsx +37 -38
- package/src/modules/checkout/i18n/de.json +0 -1
- package/src/modules/checkout/i18n/en.json +0 -1
- package/src/modules/checkout/i18n/es.json +0 -1
- package/src/modules/checkout/i18n/pl.json +0 -1
- package/src/modules/checkout/search.ts +6 -44
- package/src/modules/checkout/setup.ts +0 -51
- package/src/modules/checkout/workers/transaction-expiry.worker.ts +0 -11
- package/dist/modules/checkout/__integration__/TC-CHKT-042.spec.js +0 -39
- package/dist/modules/checkout/__integration__/TC-CHKT-042.spec.js.map +0 -7
- package/dist/modules/checkout/__integration__/TC-CHKT-043-concurrent-status-update.spec.js +0 -62
- package/dist/modules/checkout/__integration__/TC-CHKT-043-concurrent-status-update.spec.js.map +0 -7
- package/dist/modules/checkout/extension-points.js +0 -68
- package/dist/modules/checkout/extension-points.js.map +0 -7
- package/dist/modules/checkout/lib/transaction-status-machine.js +0 -31
- package/dist/modules/checkout/lib/transaction-status-machine.js.map +0 -7
- package/dist/modules/checkout/subscribers/search-reindex-transaction-created.js +0 -32
- package/dist/modules/checkout/subscribers/search-reindex-transaction-created.js.map +0 -7
- package/src/modules/checkout/__integration__/TC-CHKT-042.spec.ts +0 -41
- package/src/modules/checkout/__integration__/TC-CHKT-043-concurrent-status-update.spec.ts +0 -112
- package/src/modules/checkout/__tests__/search.test.ts +0 -21
- package/src/modules/checkout/__tests__/setup-schedules.test.ts +0 -99
- package/src/modules/checkout/api/transactions/__tests__/route.test.ts +0 -113
- package/src/modules/checkout/commands/__tests__/update-transaction-status.test.ts +0 -363
- package/src/modules/checkout/extension-points.ts +0 -67
- package/src/modules/checkout/i18n/ko.json +0 -463
- package/src/modules/checkout/lib/__tests__/transaction-status-machine.test.ts +0 -152
- package/src/modules/checkout/lib/transaction-status-machine.ts +0 -71
- package/src/modules/checkout/subscribers/__tests__/search-reindex-transaction-created.test.ts +0 -29
- package/src/modules/checkout/subscribers/search-reindex-transaction-created.ts +0 -39
- package/src/modules/checkout/workers/__tests__/transaction-expiry.worker.test.ts +0 -124
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { extensionPoints } from "@open-mercato/checkout/modules/checkout/extension-points";
|
|
5
4
|
import Link from "next/link";
|
|
6
5
|
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
|
6
|
+
import { ComponentReplacementHandles } from "@open-mercato/shared/modules/widgets/component-registry";
|
|
7
7
|
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
8
8
|
import { locales } from "@open-mercato/shared/lib/i18n/config";
|
|
9
9
|
import { resolveLocaleFromCandidates } from "@open-mercato/shared/lib/i18n/locale";
|
|
@@ -36,17 +36,17 @@ import {
|
|
|
36
36
|
} from "../lib/customerDataValidation.js";
|
|
37
37
|
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
38
38
|
const logger = createLogger("checkout").child({ component: "PayPage" });
|
|
39
|
-
const PAGE_HANDLE =
|
|
40
|
-
const HEADER_HANDLE =
|
|
41
|
-
const DESCRIPTION_HANDLE =
|
|
42
|
-
const SUMMARY_HANDLE =
|
|
43
|
-
const PRICING_HANDLE =
|
|
44
|
-
const PAYMENT_HANDLE =
|
|
45
|
-
const CUSTOMER_FORM_HANDLE =
|
|
46
|
-
const LEGAL_CONSENT_HANDLE =
|
|
47
|
-
const GATEWAY_FORM_HANDLE =
|
|
48
|
-
const HELP_HANDLE =
|
|
49
|
-
const FOOTER_HANDLE =
|
|
39
|
+
const PAGE_HANDLE = ComponentReplacementHandles.page("checkout.pay-page");
|
|
40
|
+
const HEADER_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "header");
|
|
41
|
+
const DESCRIPTION_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "description");
|
|
42
|
+
const SUMMARY_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "summary");
|
|
43
|
+
const PRICING_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "pricing");
|
|
44
|
+
const PAYMENT_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "payment");
|
|
45
|
+
const CUSTOMER_FORM_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "customer-form");
|
|
46
|
+
const LEGAL_CONSENT_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "legal-consent");
|
|
47
|
+
const GATEWAY_FORM_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "gateway-form");
|
|
48
|
+
const HELP_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "help");
|
|
49
|
+
const FOOTER_HANDLE = ComponentReplacementHandles.section("checkout.pay-page", "footer");
|
|
50
50
|
const CHECKOUT_THEME_FALLBACKS = {
|
|
51
51
|
accent: "#1E3A8A",
|
|
52
52
|
accentSecondary: "#F59E0B",
|
|
@@ -855,9 +855,9 @@ function PayPagePaymentForm({
|
|
|
855
855
|
const embeddedPaymentSession = paymentSession?.type === "embedded" ? paymentSession : null;
|
|
856
856
|
return /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
|
|
857
857
|
submissionError ? /* @__PURE__ */ jsx(Alert, { status: "error", style: "lighter", size: "default", children: /* @__PURE__ */ jsx(AlertDescription, { children: submissionError }) }) : null,
|
|
858
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
858
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:before", context: injectionContext }),
|
|
859
859
|
embeddedPaymentSession && embeddedRenderer ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
860
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
860
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:renderer:before", context: injectionContext }),
|
|
861
861
|
React.createElement(embeddedRenderer, {
|
|
862
862
|
providerKey: embeddedPaymentSession.providerKey ?? "",
|
|
863
863
|
transactionId: activeTransactionId ?? "",
|
|
@@ -867,9 +867,9 @@ function PayPagePaymentForm({
|
|
|
867
867
|
onComplete,
|
|
868
868
|
onError
|
|
869
869
|
}),
|
|
870
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
870
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:renderer:after", context: injectionContext })
|
|
871
871
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
872
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
872
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:actions:before", context: injectionContext }),
|
|
873
873
|
/* @__PURE__ */ jsx(
|
|
874
874
|
Button,
|
|
875
875
|
{
|
|
@@ -886,9 +886,9 @@ function PayPagePaymentForm({
|
|
|
886
886
|
] })
|
|
887
887
|
}
|
|
888
888
|
),
|
|
889
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
889
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:actions:after", context: injectionContext })
|
|
890
890
|
] }),
|
|
891
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
891
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:after", context: injectionContext }),
|
|
892
892
|
paymentSession ? /* @__PURE__ */ jsx(
|
|
893
893
|
Button,
|
|
894
894
|
{
|
|
@@ -971,8 +971,7 @@ function PayPageFooter({ payload, themeTokens }) {
|
|
|
971
971
|
en: t("common.languages.english", "English"),
|
|
972
972
|
pl: t("common.languages.polish", "Polski"),
|
|
973
973
|
es: t("common.languages.spanish", "Espa\xF1ol"),
|
|
974
|
-
de: t("common.languages.german", "Deutsch")
|
|
975
|
-
ko: t("common.languages.korean", "\uD55C\uAD6D\uC5B4")
|
|
974
|
+
de: t("common.languages.german", "Deutsch")
|
|
976
975
|
}), [t]);
|
|
977
976
|
const setLocale = React.useCallback(async (nextLocale) => {
|
|
978
977
|
if (nextLocale === locale) return;
|
|
@@ -1644,9 +1643,9 @@ function PayPage({
|
|
|
1644
1643
|
}
|
|
1645
1644
|
if (!injectionContext) return null;
|
|
1646
1645
|
const leftColumn = /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
1647
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1646
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:header:before", context: injectionContext }),
|
|
1648
1647
|
/* @__PURE__ */ jsx("div", { "data-component-handle": HEADER_HANDLE, children: /* @__PURE__ */ jsx(HeaderComponent, { payload, preview: isPreview, themeTokens }) }),
|
|
1649
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1648
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:header:after", context: injectionContext }),
|
|
1650
1649
|
payload.description || publicCustomFields.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1651
1650
|
/* @__PURE__ */ jsx("div", { "data-component-handle": DESCRIPTION_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1652
1651
|
DescriptionComponent,
|
|
@@ -1656,9 +1655,9 @@ function PayPage({
|
|
|
1656
1655
|
themeTokens
|
|
1657
1656
|
}
|
|
1658
1657
|
) }),
|
|
1659
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1658
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:description:after", context: injectionContext })
|
|
1660
1659
|
] }) : null,
|
|
1661
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1660
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:customer-fields:before", context: injectionContext }),
|
|
1662
1661
|
shouldCollectCustomerDetails ? /* @__PURE__ */ jsx("div", { "data-component-handle": CUSTOMER_FORM_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1663
1662
|
CustomerFormComponent,
|
|
1664
1663
|
{
|
|
@@ -1671,10 +1670,10 @@ function PayPage({
|
|
|
1671
1670
|
themeTokens
|
|
1672
1671
|
}
|
|
1673
1672
|
) }) : null,
|
|
1674
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1673
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:customer-fields:after", context: injectionContext })
|
|
1675
1674
|
] });
|
|
1676
1675
|
const paymentFlow = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1677
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1676
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:pricing:before", context: injectionContext }),
|
|
1678
1677
|
/* @__PURE__ */ jsx("div", { "data-component-handle": PRICING_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1679
1678
|
PricingComponent,
|
|
1680
1679
|
{
|
|
@@ -1707,8 +1706,8 @@ function PayPage({
|
|
|
1707
1706
|
themeTokens
|
|
1708
1707
|
}
|
|
1709
1708
|
) }),
|
|
1710
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1711
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1709
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:pricing:after", context: injectionContext }),
|
|
1710
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:summary:before", context: injectionContext }),
|
|
1712
1711
|
/* @__PURE__ */ jsx("div", { "data-component-handle": SUMMARY_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1713
1712
|
SummaryComponent,
|
|
1714
1713
|
{
|
|
@@ -1720,8 +1719,8 @@ function PayPage({
|
|
|
1720
1719
|
themeTokens
|
|
1721
1720
|
}
|
|
1722
1721
|
) }),
|
|
1723
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1724
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1722
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:summary:after", context: injectionContext }),
|
|
1723
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:legal-consent:before", context: injectionContext }),
|
|
1725
1724
|
/* @__PURE__ */ jsx("div", { "data-component-handle": LEGAL_CONSENT_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1726
1725
|
LegalConsentComponent,
|
|
1727
1726
|
{
|
|
@@ -1734,8 +1733,8 @@ function PayPage({
|
|
|
1734
1733
|
themeTokens
|
|
1735
1734
|
}
|
|
1736
1735
|
) }),
|
|
1737
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1738
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1736
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:legal-consent:after", context: injectionContext }),
|
|
1737
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:submit:before", context: injectionContext }),
|
|
1739
1738
|
/* @__PURE__ */ jsx("div", { "data-component-handle": GATEWAY_FORM_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1740
1739
|
PaymentFormComponent,
|
|
1741
1740
|
{
|
|
@@ -1764,20 +1763,20 @@ function PayPage({
|
|
|
1764
1763
|
themeTokens
|
|
1765
1764
|
}
|
|
1766
1765
|
) }),
|
|
1767
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1768
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1766
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:submit:after", context: injectionContext }),
|
|
1767
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:help:before", context: injectionContext }),
|
|
1769
1768
|
/* @__PURE__ */ jsx("div", { "data-component-handle": HELP_HANDLE, children: /* @__PURE__ */ jsx(HelpComponent, { payload, preview: isPreview, themeTokens }) }),
|
|
1770
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1769
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:help:after", context: injectionContext })
|
|
1771
1770
|
] });
|
|
1772
1771
|
const rightColumn = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1773
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1772
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:payment:before", context: injectionContext }),
|
|
1774
1773
|
/* @__PURE__ */ jsx("div", { "data-component-handle": PAYMENT_HANDLE, children: /* @__PURE__ */ jsx(PaymentSectionComponent, { payload, preview: isPreview, themeTokens, children: paymentFlow }) }),
|
|
1775
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1774
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:payment:after", context: injectionContext })
|
|
1776
1775
|
] });
|
|
1777
1776
|
const footer = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1778
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1777
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:footer:before", context: injectionContext }),
|
|
1779
1778
|
/* @__PURE__ */ jsx("div", { "data-component-handle": FOOTER_HANDLE, children: /* @__PURE__ */ jsx(FooterComponent, { payload, themeTokens }) }),
|
|
1780
|
-
/* @__PURE__ */ jsx(InjectionSpot, { spotId:
|
|
1779
|
+
/* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:footer:after", context: injectionContext })
|
|
1781
1780
|
] });
|
|
1782
1781
|
return /* @__PURE__ */ jsx("div", { "data-component-handle": PAGE_HANDLE, children: /* @__PURE__ */ jsx(
|
|
1783
1782
|
SurfaceComponent,
|