@easypayment/medusa-payment-paypal 0.9.2 → 0.9.3

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 (48) hide show
  1. package/.medusa/server/src/admin/index.js +74 -73
  2. package/.medusa/server/src/admin/index.mjs +74 -73
  3. package/package.json +23 -18
  4. package/src/admin/index.ts +7 -1
  5. package/src/admin/routes/settings/paypal/connection/page.tsx +1 -0
  6. package/.medusa/server/src/admin/index.d.ts +0 -2
  7. package/.medusa/server/src/admin/index.d.ts.map +0 -1
  8. package/.medusa/server/src/admin/index.js.map +0 -1
  9. package/.medusa/server/src/admin/routes/settings/paypal/_components/Tabs.d.ts +0 -2
  10. package/.medusa/server/src/admin/routes/settings/paypal/_components/Tabs.d.ts.map +0 -1
  11. package/.medusa/server/src/admin/routes/settings/paypal/_components/Tabs.js +0 -25
  12. package/.medusa/server/src/admin/routes/settings/paypal/_components/Tabs.js.map +0 -1
  13. package/.medusa/server/src/admin/routes/settings/paypal/_components/Toast.d.ts +0 -12
  14. package/.medusa/server/src/admin/routes/settings/paypal/_components/Toast.d.ts.map +0 -1
  15. package/.medusa/server/src/admin/routes/settings/paypal/_components/Toast.js +0 -21
  16. package/.medusa/server/src/admin/routes/settings/paypal/_components/Toast.js.map +0 -1
  17. package/.medusa/server/src/admin/routes/settings/paypal/additional-settings/page.d.ts +0 -2
  18. package/.medusa/server/src/admin/routes/settings/paypal/additional-settings/page.d.ts.map +0 -1
  19. package/.medusa/server/src/admin/routes/settings/paypal/additional-settings/page.js +0 -115
  20. package/.medusa/server/src/admin/routes/settings/paypal/additional-settings/page.js.map +0 -1
  21. package/.medusa/server/src/admin/routes/settings/paypal/advanced-card-payments/page.d.ts +0 -2
  22. package/.medusa/server/src/admin/routes/settings/paypal/advanced-card-payments/page.d.ts.map +0 -1
  23. package/.medusa/server/src/admin/routes/settings/paypal/advanced-card-payments/page.js +0 -120
  24. package/.medusa/server/src/admin/routes/settings/paypal/advanced-card-payments/page.js.map +0 -1
  25. package/.medusa/server/src/admin/routes/settings/paypal/apple-pay/page.d.ts +0 -2
  26. package/.medusa/server/src/admin/routes/settings/paypal/apple-pay/page.d.ts.map +0 -1
  27. package/.medusa/server/src/admin/routes/settings/paypal/apple-pay/page.js +0 -9
  28. package/.medusa/server/src/admin/routes/settings/paypal/apple-pay/page.js.map +0 -1
  29. package/.medusa/server/src/admin/routes/settings/paypal/connection/page.d.ts +0 -20
  30. package/.medusa/server/src/admin/routes/settings/paypal/connection/page.d.ts.map +0 -1
  31. package/.medusa/server/src/admin/routes/settings/paypal/connection/page.js +0 -407
  32. package/.medusa/server/src/admin/routes/settings/paypal/connection/page.js.map +0 -1
  33. package/.medusa/server/src/admin/routes/settings/paypal/google-pay/page.d.ts +0 -2
  34. package/.medusa/server/src/admin/routes/settings/paypal/google-pay/page.d.ts.map +0 -1
  35. package/.medusa/server/src/admin/routes/settings/paypal/google-pay/page.js +0 -9
  36. package/.medusa/server/src/admin/routes/settings/paypal/google-pay/page.js.map +0 -1
  37. package/.medusa/server/src/admin/routes/settings/paypal/page.d.ts +0 -4
  38. package/.medusa/server/src/admin/routes/settings/paypal/page.d.ts.map +0 -1
  39. package/.medusa/server/src/admin/routes/settings/paypal/page.js +0 -14
  40. package/.medusa/server/src/admin/routes/settings/paypal/page.js.map +0 -1
  41. package/.medusa/server/src/admin/routes/settings/paypal/pay-later-messaging/page.d.ts +0 -2
  42. package/.medusa/server/src/admin/routes/settings/paypal/pay-later-messaging/page.d.ts.map +0 -1
  43. package/.medusa/server/src/admin/routes/settings/paypal/pay-later-messaging/page.js +0 -9
  44. package/.medusa/server/src/admin/routes/settings/paypal/pay-later-messaging/page.js.map +0 -1
  45. package/.medusa/server/src/admin/routes/settings/paypal/paypal-settings/page.d.ts +0 -2
  46. package/.medusa/server/src/admin/routes/settings/paypal/paypal-settings/page.d.ts.map +0 -1
  47. package/.medusa/server/src/admin/routes/settings/paypal/paypal-settings/page.js +0 -148
  48. package/.medusa/server/src/admin/routes/settings/paypal/paypal-settings/page.js.map +0 -1
@@ -68,19 +68,20 @@ async function adminFetch$2(path, opts = {}) {
68
68
  }
69
69
  }
70
70
  const DEFAULT_FORM$1 = {
71
- paymentAction: "capture",
72
- brandName: "PayPal",
73
- landingPage: "no_preference",
74
- requireInstantPayment: false,
75
- sendItemDetails: true,
76
- invoicePrefix: "WC-",
77
- creditCardStatementName: "PayPal"
71
+ enabled: true,
72
+ title: "Credit or Debit Card",
73
+ threeDS: "when_required"
78
74
  };
79
75
  function mergeWithDefaults$1(saved) {
80
76
  if (!saved) return { ...DEFAULT_FORM$1 };
81
77
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
82
78
  return { ...DEFAULT_FORM$1, ...Object.fromEntries(entries) };
83
79
  }
80
+ const THREE_DS_OPTIONS = [
81
+ { value: "when_required", label: "3D Secure when required", hint: "Triggers 3DS only when the card / issuer requires it." },
82
+ { value: "sli", label: "3D Secure (SCA) / liability shift (recommended)", hint: "Attempts to optimize for liability shift while remaining compliant." },
83
+ { value: "always", label: "Always request 3D Secure", hint: "Forces 3DS challenge whenever possible (may reduce conversion)." }
84
+ ];
84
85
  function SectionCard$2({ title, description, right, children }) {
85
86
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
86
87
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -102,7 +103,8 @@ function FieldRow$2({ label, hint, children }) {
102
103
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 md:col-span-8", children })
103
104
  ] });
104
105
  }
105
- function AdditionalSettingsTab() {
106
+ function AdvancedCardPaymentsTab() {
107
+ var _a, _b;
106
108
  const [form, setForm] = react.useState(() => ({ ...DEFAULT_FORM$1 }));
107
109
  const [loading, setLoading] = react.useState(false);
108
110
  const [saving, setSaving] = react.useState(false);
@@ -116,7 +118,7 @@ function AdditionalSettingsTab() {
116
118
  setLoading(true);
117
119
  const json = await adminFetch$2("/admin/paypal/settings");
118
120
  const payload = (json == null ? void 0 : json.data) ?? json;
119
- const saved = payload == null ? void 0 : payload.additional_settings;
121
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
120
122
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
121
123
  } catch {
122
124
  } finally {
@@ -127,15 +129,17 @@ function AdditionalSettingsTab() {
127
129
  async function onSave() {
128
130
  try {
129
131
  setSaving(true);
130
- setToast(null);
131
- const json = await adminFetch$2("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
132
+ const json = await adminFetch$2("/admin/paypal/settings", {
133
+ method: "POST",
134
+ body: { advanced_card_payments: form }
135
+ });
132
136
  const payload = (json == null ? void 0 : json.data) ?? json;
133
- const saved = payload == null ? void 0 : payload.additional_settings;
137
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
134
138
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
135
139
  setToast({ type: "success", message: "Settings saved" });
136
140
  window.setTimeout(() => setToast(null), 2500);
137
141
  } catch (e) {
138
- setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
142
+ setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
139
143
  window.setTimeout(() => setToast(null), 3500);
140
144
  } finally {
141
145
  setSaving(false);
@@ -148,33 +152,22 @@ function AdditionalSettingsTab() {
148
152
  /* @__PURE__ */ jsxRuntime.jsx(
149
153
  SectionCard$2,
150
154
  {
151
- title: "Additional Settings",
152
- description: "These settings control checkout behavior and PayPal experience.",
155
+ title: "Advanced Card Payments",
156
+ description: "Control card checkout settings and 3D Secure behavior.",
153
157
  right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
154
158
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5", children: saving ? "Saving..." : "Save settings" }),
155
159
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
156
160
  ] }),
157
161
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-ui-border-base", children: [
158
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Payment action", children: /* @__PURE__ */ jsxRuntime.jsxs("select", { value: form.paymentAction, onChange: (e) => setForm((p) => ({ ...p, paymentAction: 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", children: [
159
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "capture", children: "Capture" }),
160
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "authorize", children: "Authorize" })
161
- ] }) }),
162
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Brand Name", children: /* @__PURE__ */ jsxRuntime.jsx("input", { value: form.brandName, onChange: (e) => setForm((p) => ({ ...p, brandName: 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" }) }),
163
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Landing Page", children: /* @__PURE__ */ jsxRuntime.jsxs("select", { value: form.landingPage, onChange: (e) => setForm((p) => ({ ...p, landingPage: 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", children: [
164
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "no_preference", children: "No Preference" }),
165
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "login", children: "Login" }),
166
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "billing", children: "Billing" })
167
- ] }) }),
168
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Instant Payments", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
169
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.requireInstantPayment, onChange: (e) => setForm((p) => ({ ...p, requireInstantPayment: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
170
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Require Instant Payment" })
171
- ] }) }),
172
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Send Item Details", hint: "Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
173
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.sendItemDetails, onChange: (e) => setForm((p) => ({ ...p, sendItemDetails: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
174
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Send line item details to PayPal" })
162
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Enable/Disable", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
163
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.enabled, onChange: (e) => setForm((p) => ({ ...p, enabled: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
164
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Enable Advanced Credit/Debit Card" })
175
165
  ] }) }),
176
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Invoice prefix", children: /* @__PURE__ */ jsxRuntime.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-" }) }),
177
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Credit Card Statement Name", children: /* @__PURE__ */ jsxRuntime.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" }) })
166
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Title", children: /* @__PURE__ */ jsxRuntime.jsx("input", { value: form.title, onChange: (e) => setForm((p) => ({ ...p, title: 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: "Credit or Debit Card" }) }),
167
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$2, { label: "Contingency for 3D Secure", hint: "Choose when 3D Secure should be triggered during card payments.", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
168
+ /* @__PURE__ */ jsxRuntime.jsx("select", { value: form.threeDS, onChange: (e) => setForm((p) => ({ ...p, threeDS: 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", children: THREE_DS_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value)) }),
169
+ ((_a = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _a.hint) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-ui-fg-subtle", children: (_b = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _b.hint }) : null
170
+ ] }) })
178
171
  ] })
179
172
  }
180
173
  )
@@ -214,20 +207,19 @@ async function adminFetch$1(path, opts = {}) {
214
207
  }
215
208
  }
216
209
  const DEFAULT_FORM = {
217
- enabled: true,
218
- title: "Credit or Debit Card",
219
- threeDS: "when_required"
210
+ paymentAction: "capture",
211
+ brandName: "PayPal",
212
+ landingPage: "no_preference",
213
+ requireInstantPayment: false,
214
+ sendItemDetails: true,
215
+ invoicePrefix: "WC-",
216
+ creditCardStatementName: "PayPal"
220
217
  };
221
218
  function mergeWithDefaults(saved) {
222
219
  if (!saved) return { ...DEFAULT_FORM };
223
220
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
224
221
  return { ...DEFAULT_FORM, ...Object.fromEntries(entries) };
225
222
  }
226
- const THREE_DS_OPTIONS = [
227
- { value: "when_required", label: "3D Secure when required", hint: "Triggers 3DS only when the card / issuer requires it." },
228
- { value: "sli", label: "3D Secure (SCA) / liability shift (recommended)", hint: "Attempts to optimize for liability shift while remaining compliant." },
229
- { value: "always", label: "Always request 3D Secure", hint: "Forces 3DS challenge whenever possible (may reduce conversion)." }
230
- ];
231
223
  function SectionCard$1({ title, description, right, children }) {
232
224
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
233
225
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -249,8 +241,7 @@ function FieldRow$1({ label, hint, children }) {
249
241
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 md:col-span-8", children })
250
242
  ] });
251
243
  }
252
- function AdvancedCardPaymentsTab() {
253
- var _a, _b;
244
+ function AdditionalSettingsTab() {
254
245
  const [form, setForm] = react.useState(() => ({ ...DEFAULT_FORM }));
255
246
  const [loading, setLoading] = react.useState(false);
256
247
  const [saving, setSaving] = react.useState(false);
@@ -264,7 +255,7 @@ function AdvancedCardPaymentsTab() {
264
255
  setLoading(true);
265
256
  const json = await adminFetch$1("/admin/paypal/settings");
266
257
  const payload = (json == null ? void 0 : json.data) ?? json;
267
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
258
+ const saved = payload == null ? void 0 : payload.additional_settings;
268
259
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
269
260
  } catch {
270
261
  } finally {
@@ -275,17 +266,15 @@ function AdvancedCardPaymentsTab() {
275
266
  async function onSave() {
276
267
  try {
277
268
  setSaving(true);
278
- const json = await adminFetch$1("/admin/paypal/settings", {
279
- method: "POST",
280
- body: { advanced_card_payments: form }
281
- });
269
+ setToast(null);
270
+ const json = await adminFetch$1("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
282
271
  const payload = (json == null ? void 0 : json.data) ?? json;
283
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
272
+ const saved = payload == null ? void 0 : payload.additional_settings;
284
273
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
285
274
  setToast({ type: "success", message: "Settings saved" });
286
275
  window.setTimeout(() => setToast(null), 2500);
287
276
  } catch (e) {
288
- setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
277
+ setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
289
278
  window.setTimeout(() => setToast(null), 3500);
290
279
  } finally {
291
280
  setSaving(false);
@@ -298,22 +287,33 @@ function AdvancedCardPaymentsTab() {
298
287
  /* @__PURE__ */ jsxRuntime.jsx(
299
288
  SectionCard$1,
300
289
  {
301
- title: "Advanced Card Payments",
302
- description: "Control card checkout settings and 3D Secure behavior.",
290
+ title: "Additional Settings",
291
+ description: "These settings control checkout behavior and PayPal experience.",
303
292
  right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
304
293
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5", children: saving ? "Saving..." : "Save settings" }),
305
294
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
306
295
  ] }),
307
296
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-ui-border-base", children: [
308
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Enable/Disable", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
309
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.enabled, onChange: (e) => setForm((p) => ({ ...p, enabled: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
310
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Enable Advanced Credit/Debit Card" })
297
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Payment action", children: /* @__PURE__ */ jsxRuntime.jsxs("select", { value: form.paymentAction, onChange: (e) => setForm((p) => ({ ...p, paymentAction: 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", children: [
298
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "capture", children: "Capture" }),
299
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "authorize", children: "Authorize" })
311
300
  ] }) }),
312
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Title", children: /* @__PURE__ */ jsxRuntime.jsx("input", { value: form.title, onChange: (e) => setForm((p) => ({ ...p, title: 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: "Credit or Debit Card" }) }),
313
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Contingency for 3D Secure", hint: "Choose when 3D Secure should be triggered during card payments.", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
314
- /* @__PURE__ */ jsxRuntime.jsx("select", { value: form.threeDS, onChange: (e) => setForm((p) => ({ ...p, threeDS: 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", children: THREE_DS_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value)) }),
315
- ((_a = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _a.hint) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-ui-fg-subtle", children: (_b = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _b.hint }) : null
316
- ] }) })
301
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Brand Name", children: /* @__PURE__ */ jsxRuntime.jsx("input", { value: form.brandName, onChange: (e) => setForm((p) => ({ ...p, brandName: 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" }) }),
302
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Landing Page", children: /* @__PURE__ */ jsxRuntime.jsxs("select", { value: form.landingPage, onChange: (e) => setForm((p) => ({ ...p, landingPage: 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", children: [
303
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "no_preference", children: "No Preference" }),
304
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "login", children: "Login" }),
305
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "billing", children: "Billing" })
306
+ ] }) }),
307
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Instant Payments", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
308
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.requireInstantPayment, onChange: (e) => setForm((p) => ({ ...p, requireInstantPayment: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
309
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Require Instant Payment" })
310
+ ] }) }),
311
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Send Item Details", hint: "Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
312
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.sendItemDetails, onChange: (e) => setForm((p) => ({ ...p, sendItemDetails: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
313
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Send line item details to PayPal" })
314
+ ] }) }),
315
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Invoice prefix", children: /* @__PURE__ */ jsxRuntime.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-" }) }),
316
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow$1, { label: "Credit Card Statement Name", children: /* @__PURE__ */ jsxRuntime.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" }) })
317
317
  ] })
318
318
  }
319
319
  )
@@ -322,11 +322,9 @@ function AdvancedCardPaymentsTab() {
322
322
  function PayPalApplePayPage() {
323
323
  return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
324
324
  }
325
- function PayPalGooglePayPage() {
326
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
327
- }
328
325
  const config = adminSdk.defineRouteConfig({
329
- label: "PayPal Connection"
326
+ label: "PayPal Connection",
327
+ hide: true
330
328
  });
331
329
  if (typeof window !== "undefined") {
332
330
  const preloadHref = "https://www.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js";
@@ -917,6 +915,9 @@ function PayPalConnectionPage() {
917
915
  ` })
918
916
  ] });
919
917
  }
918
+ function PayPalGooglePayPage() {
919
+ return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
920
+ }
920
921
  function PayPalPayLaterMessagingPage() {
921
922
  return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
922
923
  }
@@ -1200,26 +1201,26 @@ const routeModule = {
1200
1201
  Component: PayPalSettingsIndexRoute,
1201
1202
  path: "/settings/paypal"
1202
1203
  },
1203
- {
1204
- Component: AdditionalSettingsTab,
1205
- path: "/settings/paypal/additional-settings"
1206
- },
1207
1204
  {
1208
1205
  Component: AdvancedCardPaymentsTab,
1209
1206
  path: "/settings/paypal/advanced-card-payments"
1210
1207
  },
1211
1208
  {
1212
- Component: PayPalApplePayPage,
1213
- path: "/settings/paypal/apple-pay"
1209
+ Component: AdditionalSettingsTab,
1210
+ path: "/settings/paypal/additional-settings"
1214
1211
  },
1215
1212
  {
1216
- Component: PayPalGooglePayPage,
1217
- path: "/settings/paypal/google-pay"
1213
+ Component: PayPalApplePayPage,
1214
+ path: "/settings/paypal/apple-pay"
1218
1215
  },
1219
1216
  {
1220
1217
  Component: PayPalConnectionPage,
1221
1218
  path: "/settings/paypal/connection"
1222
1219
  },
1220
+ {
1221
+ Component: PayPalGooglePayPage,
1222
+ path: "/settings/paypal/google-pay"
1223
+ },
1223
1224
  {
1224
1225
  Component: PayPalPayLaterMessagingPage,
1225
1226
  path: "/settings/paypal/pay-later-messaging"
@@ -67,19 +67,20 @@ async function adminFetch$2(path, opts = {}) {
67
67
  }
68
68
  }
69
69
  const DEFAULT_FORM$1 = {
70
- paymentAction: "capture",
71
- brandName: "PayPal",
72
- landingPage: "no_preference",
73
- requireInstantPayment: false,
74
- sendItemDetails: true,
75
- invoicePrefix: "WC-",
76
- creditCardStatementName: "PayPal"
70
+ enabled: true,
71
+ title: "Credit or Debit Card",
72
+ threeDS: "when_required"
77
73
  };
78
74
  function mergeWithDefaults$1(saved) {
79
75
  if (!saved) return { ...DEFAULT_FORM$1 };
80
76
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
81
77
  return { ...DEFAULT_FORM$1, ...Object.fromEntries(entries) };
82
78
  }
79
+ const THREE_DS_OPTIONS = [
80
+ { value: "when_required", label: "3D Secure when required", hint: "Triggers 3DS only when the card / issuer requires it." },
81
+ { value: "sli", label: "3D Secure (SCA) / liability shift (recommended)", hint: "Attempts to optimize for liability shift while remaining compliant." },
82
+ { value: "always", label: "Always request 3D Secure", hint: "Forces 3DS challenge whenever possible (may reduce conversion)." }
83
+ ];
83
84
  function SectionCard$2({ title, description, right, children }) {
84
85
  return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
85
86
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -101,7 +102,8 @@ function FieldRow$2({ label, hint, children }) {
101
102
  /* @__PURE__ */ jsx("div", { className: "col-span-12 md:col-span-8", children })
102
103
  ] });
103
104
  }
104
- function AdditionalSettingsTab() {
105
+ function AdvancedCardPaymentsTab() {
106
+ var _a, _b;
105
107
  const [form, setForm] = useState(() => ({ ...DEFAULT_FORM$1 }));
106
108
  const [loading, setLoading] = useState(false);
107
109
  const [saving, setSaving] = useState(false);
@@ -115,7 +117,7 @@ function AdditionalSettingsTab() {
115
117
  setLoading(true);
116
118
  const json = await adminFetch$2("/admin/paypal/settings");
117
119
  const payload = (json == null ? void 0 : json.data) ?? json;
118
- const saved = payload == null ? void 0 : payload.additional_settings;
120
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
119
121
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
120
122
  } catch {
121
123
  } finally {
@@ -126,15 +128,17 @@ function AdditionalSettingsTab() {
126
128
  async function onSave() {
127
129
  try {
128
130
  setSaving(true);
129
- setToast(null);
130
- const json = await adminFetch$2("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
131
+ const json = await adminFetch$2("/admin/paypal/settings", {
132
+ method: "POST",
133
+ body: { advanced_card_payments: form }
134
+ });
131
135
  const payload = (json == null ? void 0 : json.data) ?? json;
132
- const saved = payload == null ? void 0 : payload.additional_settings;
136
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
133
137
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
134
138
  setToast({ type: "success", message: "Settings saved" });
135
139
  window.setTimeout(() => setToast(null), 2500);
136
140
  } catch (e) {
137
- setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
141
+ setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
138
142
  window.setTimeout(() => setToast(null), 3500);
139
143
  } finally {
140
144
  setSaving(false);
@@ -147,33 +151,22 @@ function AdditionalSettingsTab() {
147
151
  /* @__PURE__ */ jsx(
148
152
  SectionCard$2,
149
153
  {
150
- title: "Additional Settings",
151
- description: "These settings control checkout behavior and PayPal experience.",
154
+ title: "Advanced Card Payments",
155
+ description: "Control card checkout settings and 3D Secure behavior.",
152
156
  right: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
153
157
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5", children: saving ? "Saving..." : "Save settings" }),
154
158
  loading ? /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
155
159
  ] }),
156
160
  children: /* @__PURE__ */ jsxs("div", { className: "divide-y divide-ui-border-base", children: [
157
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Payment action", children: /* @__PURE__ */ jsxs("select", { value: form.paymentAction, onChange: (e) => setForm((p) => ({ ...p, paymentAction: 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", children: [
158
- /* @__PURE__ */ jsx("option", { value: "capture", children: "Capture" }),
159
- /* @__PURE__ */ jsx("option", { value: "authorize", children: "Authorize" })
160
- ] }) }),
161
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Brand Name", children: /* @__PURE__ */ jsx("input", { value: form.brandName, onChange: (e) => setForm((p) => ({ ...p, brandName: 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" }) }),
162
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Landing Page", children: /* @__PURE__ */ jsxs("select", { value: form.landingPage, onChange: (e) => setForm((p) => ({ ...p, landingPage: 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", children: [
163
- /* @__PURE__ */ jsx("option", { value: "no_preference", children: "No Preference" }),
164
- /* @__PURE__ */ jsx("option", { value: "login", children: "Login" }),
165
- /* @__PURE__ */ jsx("option", { value: "billing", children: "Billing" })
166
- ] }) }),
167
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Instant Payments", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
168
- /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.requireInstantPayment, onChange: (e) => setForm((p) => ({ ...p, requireInstantPayment: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
169
- /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Require Instant Payment" })
170
- ] }) }),
171
- /* @__PURE__ */ jsx(FieldRow$2, { label: "Send Item Details", hint: "Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
172
- /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.sendItemDetails, onChange: (e) => setForm((p) => ({ ...p, sendItemDetails: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
173
- /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Send line item details to PayPal" })
161
+ /* @__PURE__ */ jsx(FieldRow$2, { label: "Enable/Disable", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
162
+ /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.enabled, onChange: (e) => setForm((p) => ({ ...p, enabled: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
163
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Enable Advanced Credit/Debit Card" })
174
164
  ] }) }),
175
- /* @__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-" }) }),
176
- /* @__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" }) })
165
+ /* @__PURE__ */ jsx(FieldRow$2, { label: "Title", children: /* @__PURE__ */ jsx("input", { value: form.title, onChange: (e) => setForm((p) => ({ ...p, title: 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: "Credit or Debit Card" }) }),
166
+ /* @__PURE__ */ jsx(FieldRow$2, { label: "Contingency for 3D Secure", hint: "Choose when 3D Secure should be triggered during card payments.", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
167
+ /* @__PURE__ */ jsx("select", { value: form.threeDS, onChange: (e) => setForm((p) => ({ ...p, threeDS: 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", children: THREE_DS_OPTIONS.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value)) }),
168
+ ((_a = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _a.hint) ? /* @__PURE__ */ jsx("div", { className: "text-xs text-ui-fg-subtle", children: (_b = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _b.hint }) : null
169
+ ] }) })
177
170
  ] })
178
171
  }
179
172
  )
@@ -213,20 +206,19 @@ async function adminFetch$1(path, opts = {}) {
213
206
  }
214
207
  }
215
208
  const DEFAULT_FORM = {
216
- enabled: true,
217
- title: "Credit or Debit Card",
218
- threeDS: "when_required"
209
+ paymentAction: "capture",
210
+ brandName: "PayPal",
211
+ landingPage: "no_preference",
212
+ requireInstantPayment: false,
213
+ sendItemDetails: true,
214
+ invoicePrefix: "WC-",
215
+ creditCardStatementName: "PayPal"
219
216
  };
220
217
  function mergeWithDefaults(saved) {
221
218
  if (!saved) return { ...DEFAULT_FORM };
222
219
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
223
220
  return { ...DEFAULT_FORM, ...Object.fromEntries(entries) };
224
221
  }
225
- const THREE_DS_OPTIONS = [
226
- { value: "when_required", label: "3D Secure when required", hint: "Triggers 3DS only when the card / issuer requires it." },
227
- { value: "sli", label: "3D Secure (SCA) / liability shift (recommended)", hint: "Attempts to optimize for liability shift while remaining compliant." },
228
- { value: "always", label: "Always request 3D Secure", hint: "Forces 3DS challenge whenever possible (may reduce conversion)." }
229
- ];
230
222
  function SectionCard$1({ title, description, right, children }) {
231
223
  return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
232
224
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -248,8 +240,7 @@ function FieldRow$1({ label, hint, children }) {
248
240
  /* @__PURE__ */ jsx("div", { className: "col-span-12 md:col-span-8", children })
249
241
  ] });
250
242
  }
251
- function AdvancedCardPaymentsTab() {
252
- var _a, _b;
243
+ function AdditionalSettingsTab() {
253
244
  const [form, setForm] = useState(() => ({ ...DEFAULT_FORM }));
254
245
  const [loading, setLoading] = useState(false);
255
246
  const [saving, setSaving] = useState(false);
@@ -263,7 +254,7 @@ function AdvancedCardPaymentsTab() {
263
254
  setLoading(true);
264
255
  const json = await adminFetch$1("/admin/paypal/settings");
265
256
  const payload = (json == null ? void 0 : json.data) ?? json;
266
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
257
+ const saved = payload == null ? void 0 : payload.additional_settings;
267
258
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
268
259
  } catch {
269
260
  } finally {
@@ -274,17 +265,15 @@ function AdvancedCardPaymentsTab() {
274
265
  async function onSave() {
275
266
  try {
276
267
  setSaving(true);
277
- const json = await adminFetch$1("/admin/paypal/settings", {
278
- method: "POST",
279
- body: { advanced_card_payments: form }
280
- });
268
+ setToast(null);
269
+ const json = await adminFetch$1("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
281
270
  const payload = (json == null ? void 0 : json.data) ?? json;
282
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
271
+ const saved = payload == null ? void 0 : payload.additional_settings;
283
272
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
284
273
  setToast({ type: "success", message: "Settings saved" });
285
274
  window.setTimeout(() => setToast(null), 2500);
286
275
  } catch (e) {
287
- setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
276
+ setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
288
277
  window.setTimeout(() => setToast(null), 3500);
289
278
  } finally {
290
279
  setSaving(false);
@@ -297,22 +286,33 @@ function AdvancedCardPaymentsTab() {
297
286
  /* @__PURE__ */ jsx(
298
287
  SectionCard$1,
299
288
  {
300
- title: "Advanced Card Payments",
301
- description: "Control card checkout settings and 3D Secure behavior.",
289
+ title: "Additional Settings",
290
+ description: "These settings control checkout behavior and PayPal experience.",
302
291
  right: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
303
292
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5", children: saving ? "Saving..." : "Save settings" }),
304
293
  loading ? /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
305
294
  ] }),
306
295
  children: /* @__PURE__ */ jsxs("div", { className: "divide-y divide-ui-border-base", children: [
307
- /* @__PURE__ */ jsx(FieldRow$1, { label: "Enable/Disable", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
308
- /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.enabled, onChange: (e) => setForm((p) => ({ ...p, enabled: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
309
- /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Enable Advanced Credit/Debit Card" })
296
+ /* @__PURE__ */ jsx(FieldRow$1, { label: "Payment action", children: /* @__PURE__ */ jsxs("select", { value: form.paymentAction, onChange: (e) => setForm((p) => ({ ...p, paymentAction: 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", children: [
297
+ /* @__PURE__ */ jsx("option", { value: "capture", children: "Capture" }),
298
+ /* @__PURE__ */ jsx("option", { value: "authorize", children: "Authorize" })
310
299
  ] }) }),
311
- /* @__PURE__ */ jsx(FieldRow$1, { label: "Title", children: /* @__PURE__ */ jsx("input", { value: form.title, onChange: (e) => setForm((p) => ({ ...p, title: 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: "Credit or Debit Card" }) }),
312
- /* @__PURE__ */ jsx(FieldRow$1, { label: "Contingency for 3D Secure", hint: "Choose when 3D Secure should be triggered during card payments.", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
313
- /* @__PURE__ */ jsx("select", { value: form.threeDS, onChange: (e) => setForm((p) => ({ ...p, threeDS: 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", children: THREE_DS_OPTIONS.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value)) }),
314
- ((_a = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _a.hint) ? /* @__PURE__ */ jsx("div", { className: "text-xs text-ui-fg-subtle", children: (_b = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _b.hint }) : null
315
- ] }) })
300
+ /* @__PURE__ */ jsx(FieldRow$1, { label: "Brand Name", children: /* @__PURE__ */ jsx("input", { value: form.brandName, onChange: (e) => setForm((p) => ({ ...p, brandName: 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" }) }),
301
+ /* @__PURE__ */ jsx(FieldRow$1, { label: "Landing Page", children: /* @__PURE__ */ jsxs("select", { value: form.landingPage, onChange: (e) => setForm((p) => ({ ...p, landingPage: 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", children: [
302
+ /* @__PURE__ */ jsx("option", { value: "no_preference", children: "No Preference" }),
303
+ /* @__PURE__ */ jsx("option", { value: "login", children: "Login" }),
304
+ /* @__PURE__ */ jsx("option", { value: "billing", children: "Billing" })
305
+ ] }) }),
306
+ /* @__PURE__ */ jsx(FieldRow$1, { label: "Instant Payments", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
307
+ /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.requireInstantPayment, onChange: (e) => setForm((p) => ({ ...p, requireInstantPayment: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
308
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Require Instant Payment" })
309
+ ] }) }),
310
+ /* @__PURE__ */ jsx(FieldRow$1, { label: "Send Item Details", hint: "Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2", children: [
311
+ /* @__PURE__ */ jsx("input", { type: "checkbox", checked: form.sendItemDetails, onChange: (e) => setForm((p) => ({ ...p, sendItemDetails: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
312
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-base", children: "Send line item details to PayPal" })
313
+ ] }) }),
314
+ /* @__PURE__ */ jsx(FieldRow$1, { 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-" }) }),
315
+ /* @__PURE__ */ jsx(FieldRow$1, { 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" }) })
316
316
  ] })
317
317
  }
318
318
  )
@@ -321,11 +321,9 @@ function AdvancedCardPaymentsTab() {
321
321
  function PayPalApplePayPage() {
322
322
  return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
323
323
  }
324
- function PayPalGooglePayPage() {
325
- return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
326
- }
327
324
  const config = defineRouteConfig({
328
- label: "PayPal Connection"
325
+ label: "PayPal Connection",
326
+ hide: true
329
327
  });
330
328
  if (typeof window !== "undefined") {
331
329
  const preloadHref = "https://www.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js";
@@ -916,6 +914,9 @@ function PayPalConnectionPage() {
916
914
  ` })
917
915
  ] });
918
916
  }
917
+ function PayPalGooglePayPage() {
918
+ return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
919
+ }
919
920
  function PayPalPayLaterMessagingPage() {
920
921
  return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
921
922
  }
@@ -1199,26 +1200,26 @@ const routeModule = {
1199
1200
  Component: PayPalSettingsIndexRoute,
1200
1201
  path: "/settings/paypal"
1201
1202
  },
1202
- {
1203
- Component: AdditionalSettingsTab,
1204
- path: "/settings/paypal/additional-settings"
1205
- },
1206
1203
  {
1207
1204
  Component: AdvancedCardPaymentsTab,
1208
1205
  path: "/settings/paypal/advanced-card-payments"
1209
1206
  },
1210
1207
  {
1211
- Component: PayPalApplePayPage,
1212
- path: "/settings/paypal/apple-pay"
1208
+ Component: AdditionalSettingsTab,
1209
+ path: "/settings/paypal/additional-settings"
1213
1210
  },
1214
1211
  {
1215
- Component: PayPalGooglePayPage,
1216
- path: "/settings/paypal/google-pay"
1212
+ Component: PayPalApplePayPage,
1213
+ path: "/settings/paypal/apple-pay"
1217
1214
  },
1218
1215
  {
1219
1216
  Component: PayPalConnectionPage,
1220
1217
  path: "/settings/paypal/connection"
1221
1218
  },
1219
+ {
1220
+ Component: PayPalGooglePayPage,
1221
+ path: "/settings/paypal/google-pay"
1222
+ },
1222
1223
  {
1223
1224
  Component: PayPalPayLaterMessagingPage,
1224
1225
  path: "/settings/paypal/pay-later-messaging"