@easypayment/medusa-paypal 0.2.9 → 0.3.0

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 (46) hide show
  1. package/.medusa/server/src/admin/index.js +18 -248
  2. package/.medusa/server/src/admin/index.mjs +18 -248
  3. package/.medusa/server/src/jobs/paypal-reconcile.d.ts.map +1 -1
  4. package/.medusa/server/src/jobs/paypal-reconcile.js +0 -36
  5. package/.medusa/server/src/jobs/paypal-reconcile.js.map +1 -1
  6. package/.medusa/server/src/modules/paypal/index.d.ts +0 -14
  7. package/.medusa/server/src/modules/paypal/index.d.ts.map +1 -1
  8. package/.medusa/server/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.d.ts +6 -0
  9. package/.medusa/server/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.d.ts.map +1 -0
  10. package/.medusa/server/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.js +28 -0
  11. package/.medusa/server/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.js.map +1 -0
  12. package/.medusa/server/src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.d.ts +6 -0
  13. package/.medusa/server/src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.d.ts.map +1 -0
  14. package/.medusa/server/src/modules/paypal/migrations/{20260301090000_create_paypal_audit_log.js → 20261201090000_remove_paypal_audit_log.js} +10 -10
  15. package/.medusa/server/src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.js.map +1 -0
  16. package/.medusa/server/src/modules/paypal/service.d.ts +2 -48
  17. package/.medusa/server/src/modules/paypal/service.d.ts.map +1 -1
  18. package/.medusa/server/src/modules/paypal/service.js +2 -99
  19. package/.medusa/server/src/modules/paypal/service.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/admin/routes/settings/paypal/_components/Tabs.tsx +0 -2
  22. package/src/admin/routes/settings/paypal/additional-settings/page.tsx +218 -226
  23. package/src/jobs/paypal-reconcile.ts +0 -37
  24. package/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.ts +25 -0
  25. package/src/modules/paypal/migrations/{20260301090000_create_paypal_audit_log.ts → 20261201090000_remove_paypal_audit_log.ts} +8 -8
  26. package/src/modules/paypal/service.ts +2 -112
  27. package/.medusa/server/src/api/admin/paypal/audit-logs/route.d.ts +0 -3
  28. package/.medusa/server/src/api/admin/paypal/audit-logs/route.d.ts.map +0 -1
  29. package/.medusa/server/src/api/admin/paypal/audit-logs/route.js +0 -12
  30. package/.medusa/server/src/api/admin/paypal/audit-logs/route.js.map +0 -1
  31. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.d.ts +0 -3
  32. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.d.ts.map +0 -1
  33. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.js +0 -8
  34. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.js.map +0 -1
  35. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.d.ts +0 -6
  36. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.d.ts.map +0 -1
  37. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.js.map +0 -1
  38. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.d.ts +0 -7
  39. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.d.ts.map +0 -1
  40. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.js +0 -10
  41. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.js.map +0 -1
  42. package/src/admin/routes/settings/paypal/audit-logs/page.tsx +0 -127
  43. package/src/admin/routes/settings/paypal/reconciliation-status/page.tsx +0 -120
  44. package/src/api/admin/paypal/audit-logs/route.ts +0 -13
  45. package/src/api/admin/paypal/reconciliation-status/route.ts +0 -7
  46. package/src/modules/paypal/models/paypal_audit_log.ts +0 -9
@@ -13,11 +13,9 @@ const TABS = [
13
13
  { label: "PayPal Connection", to: `${BASE}/connection` },
14
14
  { label: "PayPal Settings", to: `${BASE}/paypal-settings` },
15
15
  { label: "Advanced Card Payments", to: `${BASE}/advanced-card-payments` },
16
- { label: "Reconciliation Status", to: `${BASE}/reconciliation-status` },
17
16
  /* { label: "Google Pay", to: `${BASE}/google-pay` },
18
17
  { label: "Apple Pay", to: `${BASE}/apple-pay` },
19
18
  { label: "Pay Later Messaging", to: `${BASE}/pay-later-messaging` }, */
20
- { label: "Audit Logs", to: `${BASE}/audit-logs` },
21
19
  { label: "Additional Settings", to: `${BASE}/additional-settings` }
22
20
  ];
23
21
  function isActive(pathname, to) {
@@ -38,7 +36,7 @@ function PayPalTabs() {
38
36
  );
39
37
  }) }) });
40
38
  }
41
- async function adminFetch$4(path, opts = {}) {
39
+ async function adminFetch$2(path, opts = {}) {
42
40
  var _a;
43
41
  const { method = "GET", body, query } = opts;
44
42
  let url = path;
@@ -81,7 +79,6 @@ const DEFAULT_FORM$1 = {
81
79
  skipOrderReviewPage: true,
82
80
  invoicePrefix: "WC-",
83
81
  creditCardStatementName: "PayPal",
84
- enableLogging: true,
85
82
  logPath: "/uploads/wc-logs/"
86
83
  };
87
84
  function mergeWithDefaults$1(saved) {
@@ -122,7 +119,7 @@ function AdditionalSettingsTab() {
122
119
  (async () => {
123
120
  try {
124
121
  setLoading(true);
125
- const json = await adminFetch$4("/admin/paypal/settings");
122
+ const json = await adminFetch$2("/admin/paypal/settings");
126
123
  const payload = (json == null ? void 0 : json.data) ?? json;
127
124
  const saved = payload == null ? void 0 : payload.additional_settings;
128
125
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
@@ -136,7 +133,7 @@ function AdditionalSettingsTab() {
136
133
  try {
137
134
  setSaving(true);
138
135
  setToast(null);
139
- const json = await adminFetch$4("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
136
+ const json = await adminFetch$2("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
140
137
  const payload = (json == null ? void 0 : json.data) ?? json;
141
138
  const saved = payload == null ? void 0 : payload.additional_settings;
142
139
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
@@ -157,7 +154,7 @@ function AdditionalSettingsTab() {
157
154
  SectionCard$2,
158
155
  {
159
156
  title: "Additional Settings",
160
- description: "These settings control checkout behavior, PayPal experience, and logging.",
157
+ description: "These settings control checkout behavior and PayPal experience.",
161
158
  right: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
162
159
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "rounded-md bg-ui-button-neutral px-4 py-2 text-sm font-medium text-ui-fg-on-color shadow-sm hover:opacity-90 disabled:opacity-60", children: saving ? "Saving..." : "Save settings" }),
163
160
  loading ? /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
@@ -190,23 +187,16 @@ function AdditionalSettingsTab() {
190
187
  /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Skip Order Review Page" })
191
188
  ] }) }),
192
189
  /* @__PURE__ */ jsx(FieldRow$2, { label: "Invoice prefix", children: /* @__PURE__ */ jsx("input", { value: form.invoicePrefix, onChange: (e) => setForm((p) => ({ ...p, invoicePrefix: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "WC-" }) }),
193
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Credit Card Statement Name", children: /* @__PURE__ */ jsx("input", { value: form.creditCardStatementName, onChange: (e) => setForm((p) => ({ ...p, creditCardStatementName: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "PayPal" }) }),
194
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Debug log", hint: /* @__PURE__ */ jsxs("span", { children: [
195
- "Log PayPal events such as Webhook, Payment, Refund. ",
196
- form.logPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
197
- "Log location: ",
198
- /* @__PURE__ */ jsx("span", { className: "font-mono", children: form.logPath })
199
- ] }) : null
200
- ] }), children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
201
- /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.enableLogging, onChange: (e) => setForm((p) => ({ ...p, enableLogging: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
202
- /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Enable logging" })
203
- ] }) })
190
+ /* @__PURE__ */ jsx(FieldRow$2, { label: "Credit Card Statement Name", children: /* @__PURE__ */ jsx("input", { value: form.creditCardStatementName, onChange: (e) => setForm((p) => ({ ...p, creditCardStatementName: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "PayPal" }) })
204
191
  ] })
205
192
  }
206
193
  )
207
194
  ] }) });
208
195
  }
209
- async function adminFetch$3(path, opts = {}) {
196
+ function PayPalGooglePayPage() {
197
+ return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
198
+ }
199
+ async function adminFetch$1(path, opts = {}) {
210
200
  var _a;
211
201
  const { method = "GET", body, query } = opts;
212
202
  let url = path;
@@ -299,7 +289,7 @@ function AdvancedCardPaymentsTab() {
299
289
  (async () => {
300
290
  try {
301
291
  setLoading(true);
302
- const json = await adminFetch$3("/admin/paypal/settings");
292
+ const json = await adminFetch$1("/admin/paypal/settings");
303
293
  const payload = (json == null ? void 0 : json.data) ?? json;
304
294
  const saved = payload == null ? void 0 : payload.advanced_card_payments;
305
295
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
@@ -312,7 +302,7 @@ function AdvancedCardPaymentsTab() {
312
302
  async function onSave() {
313
303
  try {
314
304
  setSaving(true);
315
- const json = await adminFetch$3("/admin/paypal/settings", { method: "POST", body: { advanced_card_payments: form } });
305
+ const json = await adminFetch$1("/admin/paypal/settings", { method: "POST", body: { advanced_card_payments: form } });
316
306
  const payload = (json == null ? void 0 : json.data) ?? json;
317
307
  const saved = payload == null ? void 0 : payload.advanced_card_payments;
318
308
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
@@ -377,98 +367,6 @@ function AdvancedCardPaymentsTab() {
377
367
  )
378
368
  ] }) });
379
369
  }
380
- function PayPalApplePayPage() {
381
- return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
382
- }
383
- async function adminFetch$2(path, opts = {}) {
384
- var _a;
385
- const { method = "GET", body, query } = opts;
386
- let url = path;
387
- if (query && Object.keys(query).length > 0) {
388
- const params = new URLSearchParams(query);
389
- url = `${path}?${params.toString()}`;
390
- }
391
- const headers = { Accept: "application/json" };
392
- if (body !== void 0) headers["Content-Type"] = "application/json";
393
- if (typeof window !== "undefined") {
394
- const token = (_a = window.__medusa__) == null ? void 0 : _a.token;
395
- if (token) headers["Authorization"] = `Bearer ${token}`;
396
- }
397
- const res = await fetch(url, {
398
- method,
399
- headers,
400
- credentials: "include",
401
- body: body !== void 0 ? JSON.stringify(body) : void 0
402
- });
403
- const text = await res.text().catch(() => "");
404
- if (!res.ok) {
405
- if (res.status === 401) throw new Error("Unauthorized (401) - session may have expired. Please reload and log in again.");
406
- if (res.status === 403) throw new Error("Forbidden (403) - you do not have permission to perform this action.");
407
- throw new Error(text || `Request failed with status ${res.status}`);
408
- }
409
- if (!text) return {};
410
- try {
411
- return JSON.parse(text);
412
- } catch {
413
- return {};
414
- }
415
- }
416
- function formatDate$1(value) {
417
- if (!value) return "";
418
- const parsed = new Date(value);
419
- if (Number.isNaN(parsed.getTime())) return value;
420
- return parsed.toLocaleString();
421
- }
422
- function PayPalAuditLogsPage() {
423
- const [logs, setLogs] = useState([]);
424
- const [loading, setLoading] = useState(false);
425
- const [error, setError] = useState(null);
426
- const fetchLogs = useCallback(async () => {
427
- try {
428
- setLoading(true);
429
- setError(null);
430
- const data = await adminFetch$2("/admin/paypal/audit-logs", { query: { limit: "50" } });
431
- setLogs((data == null ? void 0 : data.logs) ?? []);
432
- } catch (fetchError) {
433
- setError(fetchError instanceof Error ? fetchError.message : "Failed to load audit logs.");
434
- setLogs([]);
435
- } finally {
436
- setLoading(false);
437
- }
438
- }, []);
439
- useEffect(() => {
440
- fetchLogs();
441
- }, [fetchLogs]);
442
- return /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
443
- /* @__PURE__ */ jsxs("div", { children: [
444
- /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-ui-fg-base", children: "PayPal Audit Logs" }),
445
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-ui-fg-subtle", children: "Track administrative changes and credential events for PayPal configuration." })
446
- ] }),
447
- /* @__PURE__ */ jsx(PayPalTabs, {}),
448
- /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
449
- /* @__PURE__ */ jsx("div", { className: "border-b border-ui-border-base p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
450
- /* @__PURE__ */ jsx("div", { className: "text-base font-semibold text-ui-fg-base", children: "Latest events" }),
451
- /* @__PURE__ */ jsx("button", { type: "button", onClick: fetchLogs, className: "rounded-md border border-ui-border-base px-3 py-2 text-sm text-ui-fg-base", disabled: loading, children: loading ? "Refreshing..." : "Refresh" })
452
- ] }) }),
453
- /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
454
- error ? /* @__PURE__ */ jsx("div", { className: "rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-600", children: error }) : null,
455
- !error && logs.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-sm text-ui-fg-subtle", children: loading ? "Loading audit logs..." : "No audit log entries found yet." }) : null,
456
- logs.length > 0 ? /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full text-left text-sm", children: [
457
- /* @__PURE__ */ jsx("thead", { className: "text-ui-fg-muted", children: /* @__PURE__ */ jsxs("tr", { children: [
458
- /* @__PURE__ */ jsx("th", { className: "pb-2 pr-4 font-medium", children: "Timestamp" }),
459
- /* @__PURE__ */ jsx("th", { className: "pb-2 pr-4 font-medium", children: "Event" }),
460
- /* @__PURE__ */ jsx("th", { className: "pb-2 font-medium", children: "Details" })
461
- ] }) }),
462
- /* @__PURE__ */ jsx("tbody", { children: logs.map((entry) => /* @__PURE__ */ jsxs("tr", { className: "border-t border-ui-border-base", children: [
463
- /* @__PURE__ */ jsx("td", { className: "py-3 pr-4 text-ui-fg-base", children: formatDate$1(entry.created_at) || "—" }),
464
- /* @__PURE__ */ jsx("td", { className: "py-3 pr-4 text-ui-fg-base", children: entry.event_type || "—" }),
465
- /* @__PURE__ */ jsx("td", { className: "py-3 text-ui-fg-subtle", children: /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap rounded-md bg-ui-bg-subtle p-2 text-xs text-ui-fg-subtle", children: JSON.stringify(entry.metadata || {}, null, 2) }) })
466
- ] }, entry.id)) })
467
- ] }) }) : null
468
- ] })
469
- ] })
470
- ] }) });
471
- }
472
370
  const config = defineRouteConfig({
473
371
  label: "PayPal Connection",
474
372
  hide: true
@@ -1053,132 +951,12 @@ function PayPalConnectionPage() {
1053
951
  ` })
1054
952
  ] });
1055
953
  }
1056
- function PayPalGooglePayPage() {
954
+ function PayPalApplePayPage() {
1057
955
  return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
1058
956
  }
1059
957
  function PayPalPayLaterMessagingPage() {
1060
958
  return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
1061
959
  }
1062
- async function adminFetch$1(path, opts = {}) {
1063
- var _a;
1064
- const { method = "GET", body, query } = opts;
1065
- let url = path;
1066
- if (query && Object.keys(query).length > 0) {
1067
- const params = new URLSearchParams(query);
1068
- url = `${path}?${params.toString()}`;
1069
- }
1070
- const headers = { Accept: "application/json" };
1071
- if (body !== void 0) headers["Content-Type"] = "application/json";
1072
- if (typeof window !== "undefined") {
1073
- const token = (_a = window.__medusa__) == null ? void 0 : _a.token;
1074
- if (token) headers["Authorization"] = `Bearer ${token}`;
1075
- }
1076
- const res = await fetch(url, {
1077
- method,
1078
- headers,
1079
- credentials: "include",
1080
- body: body !== void 0 ? JSON.stringify(body) : void 0
1081
- });
1082
- const text = await res.text().catch(() => "");
1083
- if (!res.ok) {
1084
- if (res.status === 401) throw new Error("Unauthorized (401) - session may have expired. Please reload and log in again.");
1085
- if (res.status === 403) throw new Error("Forbidden (403) - you do not have permission to perform this action.");
1086
- throw new Error(text || `Request failed with status ${res.status}`);
1087
- }
1088
- if (!text) return {};
1089
- try {
1090
- return JSON.parse(text);
1091
- } catch {
1092
- return {};
1093
- }
1094
- }
1095
- function formatDate(value) {
1096
- if (!value) return "—";
1097
- const parsed = new Date(value);
1098
- if (Number.isNaN(parsed.getTime())) return value;
1099
- return parsed.toLocaleString();
1100
- }
1101
- function PayPalReconciliationStatusPage() {
1102
- const [status, setStatus] = useState({});
1103
- const [loading, setLoading] = useState(false);
1104
- const [error, setError] = useState(null);
1105
- const fetchStatus = useCallback(async () => {
1106
- try {
1107
- setLoading(true);
1108
- setError(null);
1109
- const data = await adminFetch$1("/admin/paypal/reconciliation-status");
1110
- setStatus((data == null ? void 0 : data.status) ?? {});
1111
- } catch (fetchError) {
1112
- setError(fetchError instanceof Error ? fetchError.message : "Failed to load reconciliation status.");
1113
- setStatus({});
1114
- } finally {
1115
- setLoading(false);
1116
- }
1117
- }, []);
1118
- useEffect(() => {
1119
- fetchStatus();
1120
- }, [fetchStatus]);
1121
- return /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
1122
- /* @__PURE__ */ jsxs("div", { children: [
1123
- /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-ui-fg-base", children: "PayPal Reconciliation Status" }),
1124
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-ui-fg-subtle", children: "Monitor reconciliation health and drift detection for PayPal payment sessions." })
1125
- ] }),
1126
- /* @__PURE__ */ jsx(PayPalTabs, {}),
1127
- /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
1128
- /* @__PURE__ */ jsx("div", { className: "border-b border-ui-border-base p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
1129
- /* @__PURE__ */ jsx("div", { className: "text-base font-semibold text-ui-fg-base", children: "Latest reconciliation run" }),
1130
- /* @__PURE__ */ jsx("button", { type: "button", onClick: fetchStatus, className: "rounded-md border border-ui-border-base px-3 py-2 text-sm text-ui-fg-base", disabled: loading, children: loading ? "Refreshing..." : "Refresh" })
1131
- ] }) }),
1132
- /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
1133
- error ? /* @__PURE__ */ jsx("div", { className: "rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-600", children: error }) : null,
1134
- !error && Object.keys(status).length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-sm text-ui-fg-subtle", children: loading ? "Loading reconciliation status..." : "No reconciliation data yet." }) : null,
1135
- Object.keys(status).length > 0 ? /* @__PURE__ */ jsxs("div", { className: "grid gap-4 text-sm text-ui-fg-base md:grid-cols-2", children: [
1136
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1137
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Last run" }),
1138
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: formatDate(status.last_run_at) })
1139
- ] }),
1140
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1141
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Last run status" }),
1142
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium capitalize", children: status.last_run_status || "—" })
1143
- ] }),
1144
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1145
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Last success" }),
1146
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: formatDate(status.last_success_at) })
1147
- ] }),
1148
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1149
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Last failure" }),
1150
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: formatDate(status.last_failure_at) })
1151
- ] }),
1152
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1153
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Sessions checked" }),
1154
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: status.sessions_checked ?? 0 })
1155
- ] }),
1156
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1157
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Sessions updated" }),
1158
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: status.sessions_updated ?? 0 })
1159
- ] }),
1160
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1161
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Drift detections" }),
1162
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: status.drift_count ?? 0 })
1163
- ] }),
1164
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3", children: [
1165
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Last drift order" }),
1166
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: status.last_drift_order_id || "—" }),
1167
- /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-ui-fg-subtle", children: formatDate(status.last_drift_at) })
1168
- ] }),
1169
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3 md:col-span-2", children: [
1170
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Last error" }),
1171
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: status.last_error || "No errors recorded." })
1172
- ] }),
1173
- /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-subtle p-3 md:col-span-2", children: [
1174
- /* @__PURE__ */ jsx("div", { className: "text-ui-fg-subtle", children: "Total runs" }),
1175
- /* @__PURE__ */ jsx("div", { className: "mt-1 font-medium", children: status.runs ?? 0 })
1176
- ] })
1177
- ] }) : null
1178
- ] })
1179
- ] })
1180
- ] }) });
1181
- }
1182
960
  async function adminFetch(path, opts = {}) {
1183
961
  var _a;
1184
962
  const { method = "GET", body, query } = opts;
@@ -1654,33 +1432,25 @@ const routeModule = {
1654
1432
  path: "/settings/paypal/additional-settings"
1655
1433
  },
1656
1434
  {
1657
- Component: AdvancedCardPaymentsTab,
1658
- path: "/settings/paypal/advanced-card-payments"
1659
- },
1660
- {
1661
- Component: PayPalApplePayPage,
1662
- path: "/settings/paypal/apple-pay"
1435
+ Component: PayPalGooglePayPage,
1436
+ path: "/settings/paypal/google-pay"
1663
1437
  },
1664
1438
  {
1665
- Component: PayPalAuditLogsPage,
1666
- path: "/settings/paypal/audit-logs"
1439
+ Component: AdvancedCardPaymentsTab,
1440
+ path: "/settings/paypal/advanced-card-payments"
1667
1441
  },
1668
1442
  {
1669
1443
  Component: PayPalConnectionPage,
1670
1444
  path: "/settings/paypal/connection"
1671
1445
  },
1672
1446
  {
1673
- Component: PayPalGooglePayPage,
1674
- path: "/settings/paypal/google-pay"
1447
+ Component: PayPalApplePayPage,
1448
+ path: "/settings/paypal/apple-pay"
1675
1449
  },
1676
1450
  {
1677
1451
  Component: PayPalPayLaterMessagingPage,
1678
1452
  path: "/settings/paypal/pay-later-messaging"
1679
1453
  },
1680
- {
1681
- Component: PayPalReconciliationStatusPage,
1682
- path: "/settings/paypal/reconciliation-status"
1683
- },
1684
1454
  {
1685
1455
  Component: PayPalSettingsTab,
1686
1456
  path: "/settings/paypal/paypal-settings"
@@ -1 +1 @@
1
- {"version":3,"file":"paypal-reconcile.d.ts","sourceRoot":"","sources":["../../../../src/jobs/paypal-reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAchE,wBAA8B,eAAe,CAAC,SAAS,EAAE,eAAe,iBAkIvE;AAED,eAAO,MAAM,MAAM;;;CAGlB,CAAA"}
1
+ {"version":3,"file":"paypal-reconcile.d.ts","sourceRoot":"","sources":["../../../../src/jobs/paypal-reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAchE,wBAA8B,eAAe,CAAC,SAAS,EAAE,eAAe,iBA6FvE;AAED,eAAO,MAAM,MAAM;;;CAGlB,CAAA"}
@@ -27,13 +27,6 @@ async function paypalReconcile(container) {
27
27
  provider_id: [...provider_ids_1.PAYPAL_PROVIDER_IDS],
28
28
  status: ["pending", "authorized"],
29
29
  });
30
- let sessionsChecked = 0;
31
- let sessionsUpdated = 0;
32
- let driftCount = 0;
33
- let lastDriftAt = null;
34
- let lastDriftOrderId = null;
35
- let hadFailure = false;
36
- let lastErrorMessage = null;
37
30
  for (const session of sessions || []) {
38
31
  const data = (session?.data || {});
39
32
  const paypalData = (data.paypal || {});
@@ -41,7 +34,6 @@ async function paypalReconcile(container) {
41
34
  if (!orderId) {
42
35
  continue;
43
36
  }
44
- sessionsChecked += 1;
45
37
  try {
46
38
  const order = await paypal.getOrderDetails(orderId);
47
39
  const status = STATUS_MAP[String(order?.status || "").toUpperCase()];
@@ -50,9 +42,6 @@ async function paypalReconcile(container) {
50
42
  }
51
43
  const previousStatus = session?.status;
52
44
  if (previousStatus && previousStatus !== status) {
53
- driftCount += 1;
54
- lastDriftAt = new Date().toISOString();
55
- lastDriftOrderId = orderId;
56
45
  await paypal.recordPaymentLog("reconcile_drift", {
57
46
  session_id: session.id,
58
47
  order_id: orderId,
@@ -88,7 +77,6 @@ async function paypalReconcile(container) {
88
77
  },
89
78
  },
90
79
  });
91
- sessionsUpdated += 1;
92
80
  try {
93
81
  await paypal.recordMetric("reconcile_success");
94
82
  }
@@ -97,8 +85,6 @@ async function paypalReconcile(container) {
97
85
  }
98
86
  }
99
87
  catch (error) {
100
- hadFailure = true;
101
- lastErrorMessage = error instanceof Error ? error.message : String(error);
102
88
  try {
103
89
  await paypal.recordMetric("reconcile_failed");
104
90
  }
@@ -115,28 +101,6 @@ async function paypalReconcile(container) {
115
101
  console.error("[PayPal] reconcile error", error);
116
102
  }
117
103
  }
118
- try {
119
- await paypal.updateReconciliationStatus({
120
- status: hadFailure ? "failed" : "success",
121
- sessions_checked: sessionsChecked,
122
- sessions_updated: sessionsUpdated,
123
- drift_count: driftCount,
124
- last_drift_at: lastDriftAt,
125
- last_drift_order_id: lastDriftOrderId,
126
- error_message: hadFailure ? lastErrorMessage : null,
127
- });
128
- }
129
- catch (error) {
130
- await paypal.updateReconciliationStatus({
131
- status: "failed",
132
- sessions_checked: sessionsChecked,
133
- sessions_updated: sessionsUpdated,
134
- drift_count: driftCount,
135
- last_drift_at: lastDriftAt,
136
- last_drift_order_id: lastDriftOrderId,
137
- error_message: error?.message,
138
- });
139
- }
140
104
  }
141
105
  exports.config = {
142
106
  name: "paypal-reconcile",
@@ -1 +1 @@
1
- {"version":3,"file":"paypal-reconcile.js","sourceRoot":"","sources":["../../../../src/jobs/paypal-reconcile.ts"],"names":[],"mappings":";;;AAcA,k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ACF,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;AACH,CAAC;AAEY,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,cAAc;CACzB,CAAA"}
@@ -2,20 +2,6 @@ import PayPalModuleService from "./service";
2
2
  export declare const PAYPAL_MODULE = "paypal_onboarding";
3
3
  declare const _default: import("@medusajs/types").ModuleExports<typeof PayPalModuleService> & {
4
4
  linkable: {
5
- readonly paypalAuditLog: {
6
- id: {
7
- serviceName: "paypal_onboarding";
8
- field: "paypalAuditLog";
9
- linkable: "paypal_audit_log_id";
10
- primaryKey: "id";
11
- };
12
- toJSON: () => {
13
- serviceName: "paypal_onboarding";
14
- field: "paypalAuditLog";
15
- linkable: "paypal_audit_log_id";
16
- primaryKey: "id";
17
- };
18
- };
19
5
  readonly paypalConnection: {
20
6
  id: {
21
7
  serviceName: "paypal_onboarding";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/paypal/index.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,WAAW,CAAA;AAE3C,eAAO,MAAM,aAAa,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,wBAEE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/paypal/index.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,WAAW,CAAA;AAE3C,eAAO,MAAM,aAAa,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,wBAEE"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20261101090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20261101090000_remove_paypal_reconciliation_status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20261101090000_remove_paypal_reconciliation_status.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IASnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAY5B"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20261101090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20261101090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ DELETE FROM "paypal_metric"
9
+ WHERE "name" = 'reconcile_status';
10
+
11
+ DROP TABLE IF EXISTS "paypal_reconciliation_status" CASCADE;
12
+ `);
13
+ }
14
+ async down() {
15
+ this.addSql(`
16
+ CREATE TABLE IF NOT EXISTS "paypal_reconciliation_status" (
17
+ "id" text NOT NULL,
18
+ "status" text NOT NULL,
19
+ "data" jsonb NOT NULL DEFAULT '{}'::jsonb,
20
+ "created_at" timestamptz NOT NULL DEFAULT now(),
21
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
22
+ CONSTRAINT "paypal_reconciliation_status_pkey" PRIMARY KEY ("id")
23
+ );
24
+ `);
25
+ }
26
+ }
27
+ exports.Migration20261101090000 = Migration20261101090000;
28
+ //# sourceMappingURL=20261101090000_remove_paypal_reconciliation_status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20261101090000_remove_paypal_reconciliation_status.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;KAKX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;;;;;;;;KASX,CAAC,CAAA;IACJ,CAAC;CACF;AAtBD,0DAsBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20261201090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20261201090000_remove_paypal_audit_log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20261201090000_remove_paypal_audit_log.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB5B"}
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20260301090000 = void 0;
3
+ exports.Migration20261201090000 = void 0;
4
4
  const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20260301090000 extends migrations_1.Migration {
5
+ class Migration20261201090000 extends migrations_1.Migration {
6
6
  async up() {
7
7
  this.addSql(`
8
+ DROP TABLE IF EXISTS "paypal_audit_log" CASCADE;
9
+ `);
10
+ }
11
+ async down() {
12
+ this.addSql(`
8
13
  CREATE TABLE IF NOT EXISTS "paypal_audit_log" (
9
14
  "id" text NOT NULL,
10
15
  "event_type" text NOT NULL,
11
- "metadata" jsonb NOT NULL DEFAULT '{}'::jsonb,
16
+ "metadata" jsonb NULL,
12
17
  "created_at" timestamptz NOT NULL DEFAULT now(),
13
18
  "updated_at" timestamptz NOT NULL DEFAULT now(),
14
19
  "deleted_at" timestamptz NULL,
@@ -19,11 +24,6 @@ class Migration20260301090000 extends migrations_1.Migration {
19
24
  ON "paypal_audit_log" ("deleted_at");
20
25
  `);
21
26
  }
22
- async down() {
23
- this.addSql(`
24
- DROP TABLE IF EXISTS "paypal_audit_log" CASCADE;
25
- `);
26
- }
27
27
  }
28
- exports.Migration20260301090000 = Migration20260301090000;
29
- //# sourceMappingURL=20260301090000_create_paypal_audit_log.js.map
28
+ exports.Migration20261201090000 = Migration20261201090000;
29
+ //# sourceMappingURL=20261201090000_remove_paypal_audit_log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20261201090000_remove_paypal_audit_log.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;KAEX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;KAaX,CAAC,CAAA;IACJ,CAAC;CACF;AAvBD,0DAuBC"}