@easypayment/medusa-payment-paypal 0.9.3 → 0.9.4

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.
@@ -68,20 +68,19 @@ async function adminFetch$2(path, opts = {}) {
68
68
  }
69
69
  }
70
70
  const DEFAULT_FORM$1 = {
71
- enabled: true,
72
- title: "Credit or Debit Card",
73
- threeDS: "when_required"
71
+ paymentAction: "capture",
72
+ brandName: "PayPal",
73
+ landingPage: "no_preference",
74
+ requireInstantPayment: false,
75
+ sendItemDetails: true,
76
+ invoicePrefix: "WC-",
77
+ creditCardStatementName: "PayPal"
74
78
  };
75
79
  function mergeWithDefaults$1(saved) {
76
80
  if (!saved) return { ...DEFAULT_FORM$1 };
77
81
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
78
82
  return { ...DEFAULT_FORM$1, ...Object.fromEntries(entries) };
79
83
  }
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
- ];
85
84
  function SectionCard$2({ title, description, right, children }) {
86
85
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
87
86
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -103,8 +102,7 @@ function FieldRow$2({ label, hint, children }) {
103
102
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 md:col-span-8", children })
104
103
  ] });
105
104
  }
106
- function AdvancedCardPaymentsTab() {
107
- var _a, _b;
105
+ function AdditionalSettingsTab() {
108
106
  const [form, setForm] = react.useState(() => ({ ...DEFAULT_FORM$1 }));
109
107
  const [loading, setLoading] = react.useState(false);
110
108
  const [saving, setSaving] = react.useState(false);
@@ -118,7 +116,7 @@ function AdvancedCardPaymentsTab() {
118
116
  setLoading(true);
119
117
  const json = await adminFetch$2("/admin/paypal/settings");
120
118
  const payload = (json == null ? void 0 : json.data) ?? json;
121
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
119
+ const saved = payload == null ? void 0 : payload.additional_settings;
122
120
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
123
121
  } catch {
124
122
  } finally {
@@ -129,17 +127,15 @@ function AdvancedCardPaymentsTab() {
129
127
  async function onSave() {
130
128
  try {
131
129
  setSaving(true);
132
- const json = await adminFetch$2("/admin/paypal/settings", {
133
- method: "POST",
134
- body: { advanced_card_payments: form }
135
- });
130
+ setToast(null);
131
+ const json = await adminFetch$2("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
136
132
  const payload = (json == null ? void 0 : json.data) ?? json;
137
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
133
+ const saved = payload == null ? void 0 : payload.additional_settings;
138
134
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
139
135
  setToast({ type: "success", message: "Settings saved" });
140
136
  window.setTimeout(() => setToast(null), 2500);
141
137
  } catch (e) {
142
- setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
138
+ setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
143
139
  window.setTimeout(() => setToast(null), 3500);
144
140
  } finally {
145
141
  setSaving(false);
@@ -152,22 +148,33 @@ function AdvancedCardPaymentsTab() {
152
148
  /* @__PURE__ */ jsxRuntime.jsx(
153
149
  SectionCard$2,
154
150
  {
155
- title: "Advanced Card Payments",
156
- description: "Control card checkout settings and 3D Secure behavior.",
151
+ title: "Additional Settings",
152
+ description: "These settings control checkout behavior and PayPal experience.",
157
153
  right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
158
154
  /* @__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" }),
159
155
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
160
156
  ] }),
161
157
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-ui-border-base", children: [
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" })
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" })
165
161
  ] }) }),
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
- ] }) })
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" })
175
+ ] }) }),
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" }) })
171
178
  ] })
172
179
  }
173
180
  )
@@ -207,19 +214,20 @@ async function adminFetch$1(path, opts = {}) {
207
214
  }
208
215
  }
209
216
  const DEFAULT_FORM = {
210
- paymentAction: "capture",
211
- brandName: "PayPal",
212
- landingPage: "no_preference",
213
- requireInstantPayment: false,
214
- sendItemDetails: true,
215
- invoicePrefix: "WC-",
216
- creditCardStatementName: "PayPal"
217
+ enabled: true,
218
+ title: "Credit or Debit Card",
219
+ threeDS: "when_required"
217
220
  };
218
221
  function mergeWithDefaults(saved) {
219
222
  if (!saved) return { ...DEFAULT_FORM };
220
223
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
221
224
  return { ...DEFAULT_FORM, ...Object.fromEntries(entries) };
222
225
  }
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
+ ];
223
231
  function SectionCard$1({ title, description, right, children }) {
224
232
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
225
233
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -241,7 +249,8 @@ function FieldRow$1({ label, hint, children }) {
241
249
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 md:col-span-8", children })
242
250
  ] });
243
251
  }
244
- function AdditionalSettingsTab() {
252
+ function AdvancedCardPaymentsTab() {
253
+ var _a, _b;
245
254
  const [form, setForm] = react.useState(() => ({ ...DEFAULT_FORM }));
246
255
  const [loading, setLoading] = react.useState(false);
247
256
  const [saving, setSaving] = react.useState(false);
@@ -255,7 +264,7 @@ function AdditionalSettingsTab() {
255
264
  setLoading(true);
256
265
  const json = await adminFetch$1("/admin/paypal/settings");
257
266
  const payload = (json == null ? void 0 : json.data) ?? json;
258
- const saved = payload == null ? void 0 : payload.additional_settings;
267
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
259
268
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
260
269
  } catch {
261
270
  } finally {
@@ -266,15 +275,17 @@ function AdditionalSettingsTab() {
266
275
  async function onSave() {
267
276
  try {
268
277
  setSaving(true);
269
- setToast(null);
270
- const json = await adminFetch$1("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
278
+ const json = await adminFetch$1("/admin/paypal/settings", {
279
+ method: "POST",
280
+ body: { advanced_card_payments: form }
281
+ });
271
282
  const payload = (json == null ? void 0 : json.data) ?? json;
272
- const saved = payload == null ? void 0 : payload.additional_settings;
283
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
273
284
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
274
285
  setToast({ type: "success", message: "Settings saved" });
275
286
  window.setTimeout(() => setToast(null), 2500);
276
287
  } catch (e) {
277
- setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
288
+ setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
278
289
  window.setTimeout(() => setToast(null), 3500);
279
290
  } finally {
280
291
  setSaving(false);
@@ -287,33 +298,22 @@ function AdditionalSettingsTab() {
287
298
  /* @__PURE__ */ jsxRuntime.jsx(
288
299
  SectionCard$1,
289
300
  {
290
- title: "Additional Settings",
291
- description: "These settings control checkout behavior and PayPal experience.",
301
+ title: "Advanced Card Payments",
302
+ description: "Control card checkout settings and 3D Secure behavior.",
292
303
  right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
293
304
  /* @__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" }),
294
305
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
295
306
  ] }),
296
307
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-ui-border-base", children: [
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" })
300
- ] }) }),
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" })
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" })
314
311
  ] }) }),
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" }) })
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
+ ] }) })
317
317
  ] })
318
318
  }
319
319
  )
@@ -322,6 +322,9 @@ function AdditionalSettingsTab() {
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
+ }
325
328
  const config = adminSdk.defineRouteConfig({
326
329
  label: "PayPal Connection",
327
330
  hide: true
@@ -915,9 +918,6 @@ function PayPalConnectionPage() {
915
918
  ` })
916
919
  ] });
917
920
  }
918
- function PayPalGooglePayPage() {
919
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
920
- }
921
921
  function PayPalPayLaterMessagingPage() {
922
922
  return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
923
923
  }
@@ -1201,26 +1201,26 @@ const routeModule = {
1201
1201
  Component: PayPalSettingsIndexRoute,
1202
1202
  path: "/settings/paypal"
1203
1203
  },
1204
- {
1205
- Component: AdvancedCardPaymentsTab,
1206
- path: "/settings/paypal/advanced-card-payments"
1207
- },
1208
1204
  {
1209
1205
  Component: AdditionalSettingsTab,
1210
1206
  path: "/settings/paypal/additional-settings"
1211
1207
  },
1212
1208
  {
1213
- Component: PayPalApplePayPage,
1214
- path: "/settings/paypal/apple-pay"
1209
+ Component: AdvancedCardPaymentsTab,
1210
+ path: "/settings/paypal/advanced-card-payments"
1215
1211
  },
1216
1212
  {
1217
- Component: PayPalConnectionPage,
1218
- path: "/settings/paypal/connection"
1213
+ Component: PayPalApplePayPage,
1214
+ path: "/settings/paypal/apple-pay"
1219
1215
  },
1220
1216
  {
1221
1217
  Component: PayPalGooglePayPage,
1222
1218
  path: "/settings/paypal/google-pay"
1223
1219
  },
1220
+ {
1221
+ Component: PayPalConnectionPage,
1222
+ path: "/settings/paypal/connection"
1223
+ },
1224
1224
  {
1225
1225
  Component: PayPalPayLaterMessagingPage,
1226
1226
  path: "/settings/paypal/pay-later-messaging"
@@ -67,20 +67,19 @@ async function adminFetch$2(path, opts = {}) {
67
67
  }
68
68
  }
69
69
  const DEFAULT_FORM$1 = {
70
- enabled: true,
71
- title: "Credit or Debit Card",
72
- threeDS: "when_required"
70
+ paymentAction: "capture",
71
+ brandName: "PayPal",
72
+ landingPage: "no_preference",
73
+ requireInstantPayment: false,
74
+ sendItemDetails: true,
75
+ invoicePrefix: "WC-",
76
+ creditCardStatementName: "PayPal"
73
77
  };
74
78
  function mergeWithDefaults$1(saved) {
75
79
  if (!saved) return { ...DEFAULT_FORM$1 };
76
80
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
77
81
  return { ...DEFAULT_FORM$1, ...Object.fromEntries(entries) };
78
82
  }
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
- ];
84
83
  function SectionCard$2({ title, description, right, children }) {
85
84
  return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
86
85
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -102,8 +101,7 @@ function FieldRow$2({ label, hint, children }) {
102
101
  /* @__PURE__ */ jsx("div", { className: "col-span-12 md:col-span-8", children })
103
102
  ] });
104
103
  }
105
- function AdvancedCardPaymentsTab() {
106
- var _a, _b;
104
+ function AdditionalSettingsTab() {
107
105
  const [form, setForm] = useState(() => ({ ...DEFAULT_FORM$1 }));
108
106
  const [loading, setLoading] = useState(false);
109
107
  const [saving, setSaving] = useState(false);
@@ -117,7 +115,7 @@ function AdvancedCardPaymentsTab() {
117
115
  setLoading(true);
118
116
  const json = await adminFetch$2("/admin/paypal/settings");
119
117
  const payload = (json == null ? void 0 : json.data) ?? json;
120
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
118
+ const saved = payload == null ? void 0 : payload.additional_settings;
121
119
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
122
120
  } catch {
123
121
  } finally {
@@ -128,17 +126,15 @@ function AdvancedCardPaymentsTab() {
128
126
  async function onSave() {
129
127
  try {
130
128
  setSaving(true);
131
- const json = await adminFetch$2("/admin/paypal/settings", {
132
- method: "POST",
133
- body: { advanced_card_payments: form }
134
- });
129
+ setToast(null);
130
+ const json = await adminFetch$2("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
135
131
  const payload = (json == null ? void 0 : json.data) ?? json;
136
- const saved = payload == null ? void 0 : payload.advanced_card_payments;
132
+ const saved = payload == null ? void 0 : payload.additional_settings;
137
133
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
138
134
  setToast({ type: "success", message: "Settings saved" });
139
135
  window.setTimeout(() => setToast(null), 2500);
140
136
  } catch (e) {
141
- setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
137
+ setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
142
138
  window.setTimeout(() => setToast(null), 3500);
143
139
  } finally {
144
140
  setSaving(false);
@@ -151,22 +147,33 @@ function AdvancedCardPaymentsTab() {
151
147
  /* @__PURE__ */ jsx(
152
148
  SectionCard$2,
153
149
  {
154
- title: "Advanced Card Payments",
155
- description: "Control card checkout settings and 3D Secure behavior.",
150
+ title: "Additional Settings",
151
+ description: "These settings control checkout behavior and PayPal experience.",
156
152
  right: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
157
153
  /* @__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" }),
158
154
  loading ? /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
159
155
  ] }),
160
156
  children: /* @__PURE__ */ jsxs("div", { className: "divide-y divide-ui-border-base", children: [
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" })
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" })
164
160
  ] }) }),
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
- ] }) })
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" })
174
+ ] }) }),
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" }) })
170
177
  ] })
171
178
  }
172
179
  )
@@ -206,19 +213,20 @@ async function adminFetch$1(path, opts = {}) {
206
213
  }
207
214
  }
208
215
  const DEFAULT_FORM = {
209
- paymentAction: "capture",
210
- brandName: "PayPal",
211
- landingPage: "no_preference",
212
- requireInstantPayment: false,
213
- sendItemDetails: true,
214
- invoicePrefix: "WC-",
215
- creditCardStatementName: "PayPal"
216
+ enabled: true,
217
+ title: "Credit or Debit Card",
218
+ threeDS: "when_required"
216
219
  };
217
220
  function mergeWithDefaults(saved) {
218
221
  if (!saved) return { ...DEFAULT_FORM };
219
222
  const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
220
223
  return { ...DEFAULT_FORM, ...Object.fromEntries(entries) };
221
224
  }
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
+ ];
222
230
  function SectionCard$1({ title, description, right, children }) {
223
231
  return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base bg-ui-bg-base shadow-sm", children: [
224
232
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-ui-border-base p-4", children: [
@@ -240,7 +248,8 @@ function FieldRow$1({ label, hint, children }) {
240
248
  /* @__PURE__ */ jsx("div", { className: "col-span-12 md:col-span-8", children })
241
249
  ] });
242
250
  }
243
- function AdditionalSettingsTab() {
251
+ function AdvancedCardPaymentsTab() {
252
+ var _a, _b;
244
253
  const [form, setForm] = useState(() => ({ ...DEFAULT_FORM }));
245
254
  const [loading, setLoading] = useState(false);
246
255
  const [saving, setSaving] = useState(false);
@@ -254,7 +263,7 @@ function AdditionalSettingsTab() {
254
263
  setLoading(true);
255
264
  const json = await adminFetch$1("/admin/paypal/settings");
256
265
  const payload = (json == null ? void 0 : json.data) ?? json;
257
- const saved = payload == null ? void 0 : payload.additional_settings;
266
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
258
267
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
259
268
  } catch {
260
269
  } finally {
@@ -265,15 +274,17 @@ function AdditionalSettingsTab() {
265
274
  async function onSave() {
266
275
  try {
267
276
  setSaving(true);
268
- setToast(null);
269
- const json = await adminFetch$1("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
277
+ const json = await adminFetch$1("/admin/paypal/settings", {
278
+ method: "POST",
279
+ body: { advanced_card_payments: form }
280
+ });
270
281
  const payload = (json == null ? void 0 : json.data) ?? json;
271
- const saved = payload == null ? void 0 : payload.additional_settings;
282
+ const saved = payload == null ? void 0 : payload.advanced_card_payments;
272
283
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
273
284
  setToast({ type: "success", message: "Settings saved" });
274
285
  window.setTimeout(() => setToast(null), 2500);
275
286
  } catch (e) {
276
- setToast({ type: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
287
+ setToast({ type: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
277
288
  window.setTimeout(() => setToast(null), 3500);
278
289
  } finally {
279
290
  setSaving(false);
@@ -286,33 +297,22 @@ function AdditionalSettingsTab() {
286
297
  /* @__PURE__ */ jsx(
287
298
  SectionCard$1,
288
299
  {
289
- title: "Additional Settings",
290
- description: "These settings control checkout behavior and PayPal experience.",
300
+ title: "Advanced Card Payments",
301
+ description: "Control card checkout settings and 3D Secure behavior.",
291
302
  right: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
292
303
  /* @__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" }),
293
304
  loading ? /* @__PURE__ */ jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading..." }) : null
294
305
  ] }),
295
306
  children: /* @__PURE__ */ jsxs("div", { className: "divide-y divide-ui-border-base", children: [
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" })
299
- ] }) }),
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" })
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" })
313
310
  ] }) }),
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" }) })
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
+ ] }) })
316
316
  ] })
317
317
  }
318
318
  )
@@ -321,6 +321,9 @@ function AdditionalSettingsTab() {
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
+ }
324
327
  const config = defineRouteConfig({
325
328
  label: "PayPal Connection",
326
329
  hide: true
@@ -914,9 +917,6 @@ function PayPalConnectionPage() {
914
917
  ` })
915
918
  ] });
916
919
  }
917
- function PayPalGooglePayPage() {
918
- return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
919
- }
920
920
  function PayPalPayLaterMessagingPage() {
921
921
  return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
922
922
  }
@@ -1200,26 +1200,26 @@ const routeModule = {
1200
1200
  Component: PayPalSettingsIndexRoute,
1201
1201
  path: "/settings/paypal"
1202
1202
  },
1203
- {
1204
- Component: AdvancedCardPaymentsTab,
1205
- path: "/settings/paypal/advanced-card-payments"
1206
- },
1207
1203
  {
1208
1204
  Component: AdditionalSettingsTab,
1209
1205
  path: "/settings/paypal/additional-settings"
1210
1206
  },
1211
1207
  {
1212
- Component: PayPalApplePayPage,
1213
- path: "/settings/paypal/apple-pay"
1208
+ Component: AdvancedCardPaymentsTab,
1209
+ path: "/settings/paypal/advanced-card-payments"
1214
1210
  },
1215
1211
  {
1216
- Component: PayPalConnectionPage,
1217
- path: "/settings/paypal/connection"
1212
+ Component: PayPalApplePayPage,
1213
+ path: "/settings/paypal/apple-pay"
1218
1214
  },
1219
1215
  {
1220
1216
  Component: PayPalGooglePayPage,
1221
1217
  path: "/settings/paypal/google-pay"
1222
1218
  },
1219
+ {
1220
+ Component: PayPalConnectionPage,
1221
+ path: "/settings/paypal/connection"
1222
+ },
1223
1223
  {
1224
1224
  Component: PayPalPayLaterMessagingPage,
1225
1225
  path: "/settings/paypal/pay-later-messaging"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easypayment/medusa-payment-paypal",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "PayPal integration for Medusa v2",
5
5
  "author": "EasyPayment Plugins",
6
6
  "license": "MIT",