@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.
Files changed (63) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/checkout/api/pay/[slug]/submit/route.js +28 -43
  3. package/dist/modules/checkout/api/pay/[slug]/submit/route.js.map +2 -2
  4. package/dist/modules/checkout/api/transactions/route.js +6 -23
  5. package/dist/modules/checkout/api/transactions/route.js.map +2 -2
  6. package/dist/modules/checkout/backend/checkout/pay-links/page.js +1 -2
  7. package/dist/modules/checkout/backend/checkout/pay-links/page.js.map +2 -2
  8. package/dist/modules/checkout/backend/checkout/templates/page.js +1 -2
  9. package/dist/modules/checkout/backend/checkout/templates/page.js.map +2 -2
  10. package/dist/modules/checkout/backend/checkout/transactions/page.js +1 -2
  11. package/dist/modules/checkout/backend/checkout/transactions/page.js.map +2 -2
  12. package/dist/modules/checkout/commands/links.js +1 -1
  13. package/dist/modules/checkout/commands/links.js.map +2 -2
  14. package/dist/modules/checkout/commands/transactions.js +13 -45
  15. package/dist/modules/checkout/commands/transactions.js.map +2 -2
  16. package/dist/modules/checkout/components/PayPage.js +38 -39
  17. package/dist/modules/checkout/components/PayPage.js.map +2 -2
  18. package/dist/modules/checkout/search.js +6 -44
  19. package/dist/modules/checkout/search.js.map +2 -2
  20. package/dist/modules/checkout/setup.js +0 -28
  21. package/dist/modules/checkout/setup.js.map +2 -2
  22. package/dist/modules/checkout/workers/transaction-expiry.worker.js +2 -9
  23. package/dist/modules/checkout/workers/transaction-expiry.worker.js.map +2 -2
  24. package/package.json +9 -10
  25. package/src/modules/checkout/api/pay/[slug]/submit/__tests__/route.test.ts +0 -77
  26. package/src/modules/checkout/api/pay/[slug]/submit/route.ts +28 -58
  27. package/src/modules/checkout/api/transactions/route.ts +6 -30
  28. package/src/modules/checkout/backend/checkout/pay-links/page.tsx +1 -2
  29. package/src/modules/checkout/backend/checkout/templates/page.tsx +1 -2
  30. package/src/modules/checkout/backend/checkout/transactions/page.tsx +1 -2
  31. package/src/modules/checkout/commands/links.ts +1 -5
  32. package/src/modules/checkout/commands/transactions.ts +13 -68
  33. package/src/modules/checkout/components/PayPage.tsx +37 -38
  34. package/src/modules/checkout/i18n/de.json +0 -1
  35. package/src/modules/checkout/i18n/en.json +0 -1
  36. package/src/modules/checkout/i18n/es.json +0 -1
  37. package/src/modules/checkout/i18n/pl.json +0 -1
  38. package/src/modules/checkout/search.ts +6 -44
  39. package/src/modules/checkout/setup.ts +0 -51
  40. package/src/modules/checkout/workers/transaction-expiry.worker.ts +0 -11
  41. package/dist/modules/checkout/__integration__/TC-CHKT-042.spec.js +0 -39
  42. package/dist/modules/checkout/__integration__/TC-CHKT-042.spec.js.map +0 -7
  43. package/dist/modules/checkout/__integration__/TC-CHKT-043-concurrent-status-update.spec.js +0 -62
  44. package/dist/modules/checkout/__integration__/TC-CHKT-043-concurrent-status-update.spec.js.map +0 -7
  45. package/dist/modules/checkout/extension-points.js +0 -68
  46. package/dist/modules/checkout/extension-points.js.map +0 -7
  47. package/dist/modules/checkout/lib/transaction-status-machine.js +0 -31
  48. package/dist/modules/checkout/lib/transaction-status-machine.js.map +0 -7
  49. package/dist/modules/checkout/subscribers/search-reindex-transaction-created.js +0 -32
  50. package/dist/modules/checkout/subscribers/search-reindex-transaction-created.js.map +0 -7
  51. package/src/modules/checkout/__integration__/TC-CHKT-042.spec.ts +0 -41
  52. package/src/modules/checkout/__integration__/TC-CHKT-043-concurrent-status-update.spec.ts +0 -112
  53. package/src/modules/checkout/__tests__/search.test.ts +0 -21
  54. package/src/modules/checkout/__tests__/setup-schedules.test.ts +0 -99
  55. package/src/modules/checkout/api/transactions/__tests__/route.test.ts +0 -113
  56. package/src/modules/checkout/commands/__tests__/update-transaction-status.test.ts +0 -363
  57. package/src/modules/checkout/extension-points.ts +0 -67
  58. package/src/modules/checkout/i18n/ko.json +0 -463
  59. package/src/modules/checkout/lib/__tests__/transaction-status-machine.test.ts +0 -152
  60. package/src/modules/checkout/lib/transaction-status-machine.ts +0 -71
  61. package/src/modules/checkout/subscribers/__tests__/search-reindex-transaction-created.test.ts +0 -29
  62. package/src/modules/checkout/subscribers/search-reindex-transaction-created.ts +0 -39
  63. 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 = extensionPoints.hosts.payPage.componentId;
40
- const HEADER_HANDLE = extensionPoints.hosts.header.componentId;
41
- const DESCRIPTION_HANDLE = extensionPoints.hosts.description.componentId;
42
- const SUMMARY_HANDLE = extensionPoints.hosts.summary.componentId;
43
- const PRICING_HANDLE = extensionPoints.hosts.pricing.componentId;
44
- const PAYMENT_HANDLE = extensionPoints.hosts.payment.componentId;
45
- const CUSTOMER_FORM_HANDLE = extensionPoints.hosts.customerForm.componentId;
46
- const LEGAL_CONSENT_HANDLE = extensionPoints.hosts.legalConsent.componentId;
47
- const GATEWAY_FORM_HANDLE = extensionPoints.hosts.gatewayForm.componentId;
48
- const HELP_HANDLE = extensionPoints.hosts.help.componentId;
49
- const FOOTER_HANDLE = extensionPoints.hosts.footer.componentId;
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: extensionPoints.hosts.gatewayWidgetBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.gatewayRendererBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.gatewayRendererAfter.spotId, context: injectionContext })
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: extensionPoints.hosts.gatewayActionsBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.gatewayActionsAfter.spotId, context: injectionContext })
889
+ /* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:gateway-widget:actions:after", context: injectionContext })
890
890
  ] }),
891
- /* @__PURE__ */ jsx(InjectionSpot, { spotId: extensionPoints.hosts.gatewayWidgetAfter.spotId, context: injectionContext }),
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: extensionPoints.hosts.headerBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.headerAfter.spotId, context: injectionContext }),
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: extensionPoints.hosts.descriptionAfter.spotId, context: injectionContext })
1658
+ /* @__PURE__ */ jsx(InjectionSpot, { spotId: "checkout.pay-page:description:after", context: injectionContext })
1660
1659
  ] }) : null,
1661
- /* @__PURE__ */ jsx(InjectionSpot, { spotId: extensionPoints.hosts.customerFieldsBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.customerFieldsAfter.spotId, context: injectionContext })
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: extensionPoints.hosts.pricingBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.pricingAfter.spotId, context: injectionContext }),
1711
- /* @__PURE__ */ jsx(InjectionSpot, { spotId: extensionPoints.hosts.summaryBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.summaryAfter.spotId, context: injectionContext }),
1724
- /* @__PURE__ */ jsx(InjectionSpot, { spotId: extensionPoints.hosts.legalConsentBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.legalConsentAfter.spotId, context: injectionContext }),
1738
- /* @__PURE__ */ jsx(InjectionSpot, { spotId: extensionPoints.hosts.submitBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.submitAfter.spotId, context: injectionContext }),
1768
- /* @__PURE__ */ jsx(InjectionSpot, { spotId: extensionPoints.hosts.helpBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.helpAfter.spotId, context: injectionContext })
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: extensionPoints.hosts.paymentBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.paymentAfter.spotId, context: injectionContext })
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: extensionPoints.hosts.footerBefore.spotId, context: injectionContext }),
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: extensionPoints.hosts.footerAfter.spotId, context: injectionContext })
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,