@solvapay/react 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @solvapay/react changelog
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b16c1b6: MandateText now always names SolvaPay's Terms of Service and Privacy Policy, and adds the merchant's own pair only when set.
8
+
9
+ `MandateContext` gains `solvapay: { termsUrl, privacyUrl }`. Mandate link labels live on `copy.legal.{termsOfService, privacyPolicy}`; `copy.legalFooter` stays the short footer strip. Custom `copy.mandate` templates no longer receive SolvaPay URLs on `ctx.merchant.termsUrl` / `privacyUrl` when the merchant has none — those fields are now merchant-only.
10
+
3
11
  ## 2.3.1
4
12
 
5
13
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as UsageSnapshot } from './useUsage-8NCXS45R.cjs';
2
+ import { _ as UsageSnapshot } from './useUsage-zYGsspbH.cjs';
3
3
 
4
4
  /**
5
5
  * `<UsageMeter>` compound primitive — renders the authenticated customer's
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as UsageSnapshot } from './useUsage-C5_XnS_6.js';
2
+ import { _ as UsageSnapshot } from './useUsage-B144Vck8.js';
3
3
 
4
4
  /**
5
5
  * `<UsageMeter>` compound primitive — renders the authenticated customer's
@@ -52,7 +52,7 @@ import {
52
52
  validateAutoRechargeForm,
53
53
  withPaymentElementDefaults,
54
54
  writeAutoRechargeCache
55
- } from "./chunk-JXH36VLL.js";
55
+ } from "./chunk-MMD6AOUR.js";
56
56
 
57
57
  // src/TopupForm.tsx
58
58
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -354,14 +354,20 @@ function trialPhrase(ctx) {
354
354
  const trialDays = ctx.plan?.trialDays ?? ctx.trialDays;
355
355
  return trialDays ? ` after your ${trialDays}-day free trial` : "";
356
356
  }
357
- function termsSentence(ctx) {
358
- const { termsUrl, privacyUrl } = ctx.merchant;
359
- if (termsUrl && privacyUrl) {
360
- return ` See ${termsUrl} and ${privacyUrl}.`;
357
+ function joinLegalDocs(urls) {
358
+ if (urls.length === 2) return `${urls[0]} and ${urls[1]}`;
359
+ return urls[0] ?? "";
360
+ }
361
+ function legalSentence(ctx) {
362
+ const solvaClause = `SolvaPay's ${ctx.solvapay.termsUrl} and ${ctx.solvapay.privacyUrl}`;
363
+ const merchantDocs = [];
364
+ if (ctx.merchant.termsUrl) merchantDocs.push(ctx.merchant.termsUrl);
365
+ if (ctx.merchant.privacyUrl) merchantDocs.push(ctx.merchant.privacyUrl);
366
+ if (merchantDocs.length === 0) {
367
+ return ` You agree to ${solvaClause}.`;
361
368
  }
362
- if (termsUrl) return ` See ${termsUrl}.`;
363
- if (privacyUrl) return ` See ${privacyUrl}.`;
364
- return "";
369
+ const brand = ctx.merchant.displayName || ctx.merchant.legalName;
370
+ return ` You agree to ${brand}'s ${joinLegalDocs(merchantDocs)}, and ${solvaClause}.`;
365
371
  }
366
372
  var enCopy = {
367
373
  mandate: {
@@ -369,27 +375,27 @@ var enCopy = {
369
375
  const period = intervalPhrase(ctx);
370
376
  const trial = trialPhrase(ctx);
371
377
  const every = period ? ` every ${period}` : "";
372
- return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
378
+ return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
373
379
  },
374
380
  oneTime: (ctx) => {
375
381
  const product = ctx.product?.name ? ` for ${ctx.product.name}` : "";
376
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
382
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
377
383
  },
378
384
  topup: (ctx) => {
379
385
  const product = ctx.product?.name ? ` to add credits to your ${ctx.product.name} balance` : " to add credits to your balance";
380
386
  const savedCard = ctx.savesPaymentMethod ? ` You also authorize ${ctx.merchant.legalName} to save this card and charge it for future auto-recharges, which you can turn off any time.` : "";
381
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${termsSentence(ctx)}`;
387
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${legalSentence(ctx)}`;
382
388
  },
383
389
  usageMetered: (ctx) => {
384
390
  const measures = ctx.plan?.measures ?? "request";
385
391
  const cycle = ctx.plan?.billingCycle ?? "monthly";
386
392
  const product = ctx.product?.name ?? "the service";
387
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
393
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
388
394
  },
389
395
  freeTier: (ctx) => {
390
396
  const product = ctx.product?.name ?? "this plan";
391
397
  const planPhrase = ctx.plan?.name ? ` on ${ctx.plan.name}` : "";
392
- return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
398
+ return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
393
399
  }
394
400
  },
395
401
  cta: {
@@ -663,6 +669,10 @@ var enCopy = {
663
669
  paymentPayg: "Confirm your card to add credits to your balance."
664
670
  }
665
671
  },
672
+ legal: {
673
+ termsOfService: "Terms of Service",
674
+ privacyPolicy: "Privacy Policy"
675
+ },
666
676
  legalFooter: {
667
677
  terms: "Terms",
668
678
  privacy: "Privacy",
@@ -3158,8 +3168,12 @@ var MandateText = forwardRef4(
3158
3168
  legalName: merchant?.legalName ?? merchant?.displayName ?? "",
3159
3169
  displayName: merchant?.displayName,
3160
3170
  supportEmail: merchant?.supportEmail,
3161
- termsUrl: merchant?.termsUrl ?? SOLVAPAY_TERMS_URL,
3162
- privacyUrl: merchant?.privacyUrl ?? SOLVAPAY_PRIVACY_URL
3171
+ termsUrl: merchant?.termsUrl,
3172
+ privacyUrl: merchant?.privacyUrl
3173
+ },
3174
+ solvapay: {
3175
+ termsUrl: SOLVAPAY_TERMS_URL,
3176
+ privacyUrl: SOLVAPAY_PRIVACY_URL
3163
3177
  },
3164
3178
  plan: plan ? {
3165
3179
  name: plan.name,
@@ -3187,16 +3201,26 @@ var MandateText = forwardRef4(
3187
3201
  "data-solvapay-mandate-text": "",
3188
3202
  "data-variant": resolvedVariant,
3189
3203
  ...rest,
3190
- children: children ?? linkifyMandateText(text, ctx.merchant, copy, handleExternalClick)
3204
+ children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
3191
3205
  }
3192
3206
  );
3193
3207
  }
3194
3208
  );
3195
- function linkifyMandateText(text, merchant, copy, onLinkClick) {
3196
- const entries = [
3197
- { url: merchant.termsUrl, label: copy.legalFooter.terms },
3198
- { url: merchant.privacyUrl, label: copy.legalFooter.privacy }
3199
- ].filter((entry) => Boolean(entry.url));
3209
+ function linkifyMandateText(text, ctx, copy, onLinkClick) {
3210
+ const termsLabel = copy.legal.termsOfService;
3211
+ const privacyLabel = copy.legal.privacyPolicy;
3212
+ const seen = /* @__PURE__ */ new Set();
3213
+ const entries = [];
3214
+ for (const entry of [
3215
+ { url: ctx.merchant.termsUrl, label: termsLabel },
3216
+ { url: ctx.merchant.privacyUrl, label: privacyLabel },
3217
+ { url: ctx.solvapay.termsUrl, label: termsLabel },
3218
+ { url: ctx.solvapay.privacyUrl, label: privacyLabel }
3219
+ ]) {
3220
+ if (!entry.url || seen.has(entry.url)) continue;
3221
+ seen.add(entry.url);
3222
+ entries.push({ url: entry.url, label: entry.label });
3223
+ }
3200
3224
  if (entries.length === 0) return [text];
3201
3225
  const pattern = new RegExp(`(${entries.map((e) => escapeRegExp(e.url)).join("|")})`, "g");
3202
3226
  return text.split(pattern).map((part, i) => {
@@ -8,7 +8,7 @@ import {
8
8
  useOpenExternal,
9
9
  useSolvaPay,
10
10
  useTransport
11
- } from "./chunk-JXH36VLL.js";
11
+ } from "./chunk-MMD6AOUR.js";
12
12
 
13
13
  // src/hooks/usePaymentMethod.ts
14
14
  import { useCallback, useEffect, useState } from "react";
@@ -1,4 +1,4 @@
1
- import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-C5_XnS_6.js';
1
+ import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-zYGsspbH.cjs';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import { TaxBreakdown } from '@solvapay/core';
@@ -168,14 +168,12 @@ declare function deriveVariant(plan: Plan | null | undefined, mode?: 'topup'): C
168
168
  * resolve through the localized copy bundle so integrators can override
169
169
  * text without forking the component.
170
170
  *
171
- * The copy templates embed the merchant's terms / privacy URLs verbatim
172
- * (e.g. "... See https://acme.com/terms and https://acme.com/privacy.").
173
- * `MandateText` post-processes the rendered string and swaps any
174
- * occurrence of `merchant.termsUrl` / `merchant.privacyUrl` for an
175
- * `<a target="_blank">` whose visible label comes from
176
- * `copy.legalFooter.{terms, privacy}` ("Terms" / "Privacy"). Keeps the
177
- * i18n template signature untouched while lifting the legal commitment
178
- * to the point of charge.
171
+ * The copy templates embed legal URLs verbatim (merchant terms/privacy
172
+ * when set, plus SolvaPay's own). `MandateText` post-processes the
173
+ * rendered string and swaps those URLs for `<a target="_blank">` whose
174
+ * visible label comes from `copy.legal.{termsOfService, privacyPolicy}`.
175
+ * Keeps the i18n template signature untouched while lifting the legal
176
+ * commitment to the point of charge.
179
177
  *
180
178
  * `savesPaymentMethod` marks a confirm that also stores the card for
181
179
  * later off-session charges (auto-recharge). The MCP payment surfaces
@@ -183,12 +181,10 @@ declare function deriveVariant(plan: Plan | null | undefined, mode?: 'topup'): C
183
181
  * place that discloses the storage — the topup template appends a
184
182
  * saved-card sentence when the flag is set.
185
183
  *
186
- * When the merchant record omits `termsUrl` / `privacyUrl`, we fall back
187
- * to SolvaPay's hosted legal pages so the mandate sentence always carries
188
- * working links. SolvaPay is the underlying processor on every charge, so
189
- * its terms always apply — using them as the universal fallback keeps the
190
- * SCA disclosure complete even for merchants who haven't published their
191
- * own pages yet.
184
+ * SolvaPay's Terms of Service and Privacy Policy are always named and
185
+ * linked. The merchant's own pair is added only when the merchant
186
+ * record publishes `termsUrl` / `privacyUrl` they are never used as
187
+ * a substitute for SolvaPay's.
192
188
  */
193
189
 
194
190
  type MandateTextProps = {
@@ -1,4 +1,4 @@
1
- import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-8NCXS45R.cjs';
1
+ import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-B144Vck8.js';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import { TaxBreakdown } from '@solvapay/core';
@@ -168,14 +168,12 @@ declare function deriveVariant(plan: Plan | null | undefined, mode?: 'topup'): C
168
168
  * resolve through the localized copy bundle so integrators can override
169
169
  * text without forking the component.
170
170
  *
171
- * The copy templates embed the merchant's terms / privacy URLs verbatim
172
- * (e.g. "... See https://acme.com/terms and https://acme.com/privacy.").
173
- * `MandateText` post-processes the rendered string and swaps any
174
- * occurrence of `merchant.termsUrl` / `merchant.privacyUrl` for an
175
- * `<a target="_blank">` whose visible label comes from
176
- * `copy.legalFooter.{terms, privacy}` ("Terms" / "Privacy"). Keeps the
177
- * i18n template signature untouched while lifting the legal commitment
178
- * to the point of charge.
171
+ * The copy templates embed legal URLs verbatim (merchant terms/privacy
172
+ * when set, plus SolvaPay's own). `MandateText` post-processes the
173
+ * rendered string and swaps those URLs for `<a target="_blank">` whose
174
+ * visible label comes from `copy.legal.{termsOfService, privacyPolicy}`.
175
+ * Keeps the i18n template signature untouched while lifting the legal
176
+ * commitment to the point of charge.
179
177
  *
180
178
  * `savesPaymentMethod` marks a confirm that also stores the card for
181
179
  * later off-session charges (auto-recharge). The MCP payment surfaces
@@ -183,12 +181,10 @@ declare function deriveVariant(plan: Plan | null | undefined, mode?: 'topup'): C
183
181
  * place that discloses the storage — the topup template appends a
184
182
  * saved-card sentence when the flag is set.
185
183
  *
186
- * When the merchant record omits `termsUrl` / `privacyUrl`, we fall back
187
- * to SolvaPay's hosted legal pages so the mandate sentence always carries
188
- * working links. SolvaPay is the underlying processor on every charge, so
189
- * its terms always apply — using them as the universal fallback keeps the
190
- * SCA disclosure complete even for merchants who haven't published their
191
- * own pages yet.
184
+ * SolvaPay's Terms of Service and Privacy Policy are always named and
185
+ * linked. The merchant's own pair is added only when the merchant
186
+ * record publishes `termsUrl` / `privacyUrl` they are never used as
187
+ * a substitute for SolvaPay's.
192
188
  */
193
189
 
194
190
  type MandateTextProps = {
package/dist/index.cjs CHANGED
@@ -601,14 +601,20 @@ function trialPhrase(ctx) {
601
601
  const trialDays = ctx.plan?.trialDays ?? ctx.trialDays;
602
602
  return trialDays ? ` after your ${trialDays}-day free trial` : "";
603
603
  }
604
- function termsSentence(ctx) {
605
- const { termsUrl, privacyUrl } = ctx.merchant;
606
- if (termsUrl && privacyUrl) {
607
- return ` See ${termsUrl} and ${privacyUrl}.`;
604
+ function joinLegalDocs(urls) {
605
+ if (urls.length === 2) return `${urls[0]} and ${urls[1]}`;
606
+ return urls[0] ?? "";
607
+ }
608
+ function legalSentence(ctx) {
609
+ const solvaClause = `SolvaPay's ${ctx.solvapay.termsUrl} and ${ctx.solvapay.privacyUrl}`;
610
+ const merchantDocs = [];
611
+ if (ctx.merchant.termsUrl) merchantDocs.push(ctx.merchant.termsUrl);
612
+ if (ctx.merchant.privacyUrl) merchantDocs.push(ctx.merchant.privacyUrl);
613
+ if (merchantDocs.length === 0) {
614
+ return ` You agree to ${solvaClause}.`;
608
615
  }
609
- if (termsUrl) return ` See ${termsUrl}.`;
610
- if (privacyUrl) return ` See ${privacyUrl}.`;
611
- return "";
616
+ const brand = ctx.merchant.displayName || ctx.merchant.legalName;
617
+ return ` You agree to ${brand}'s ${joinLegalDocs(merchantDocs)}, and ${solvaClause}.`;
612
618
  }
613
619
  var enCopy = {
614
620
  mandate: {
@@ -616,27 +622,27 @@ var enCopy = {
616
622
  const period = intervalPhrase(ctx);
617
623
  const trial = trialPhrase(ctx);
618
624
  const every = period ? ` every ${period}` : "";
619
- return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
625
+ return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
620
626
  },
621
627
  oneTime: (ctx) => {
622
628
  const product = ctx.product?.name ? ` for ${ctx.product.name}` : "";
623
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
629
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
624
630
  },
625
631
  topup: (ctx) => {
626
632
  const product = ctx.product?.name ? ` to add credits to your ${ctx.product.name} balance` : " to add credits to your balance";
627
633
  const savedCard = ctx.savesPaymentMethod ? ` You also authorize ${ctx.merchant.legalName} to save this card and charge it for future auto-recharges, which you can turn off any time.` : "";
628
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${termsSentence(ctx)}`;
634
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${legalSentence(ctx)}`;
629
635
  },
630
636
  usageMetered: (ctx) => {
631
637
  const measures = ctx.plan?.measures ?? "request";
632
638
  const cycle = ctx.plan?.billingCycle ?? "monthly";
633
639
  const product = ctx.product?.name ?? "the service";
634
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
640
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
635
641
  },
636
642
  freeTier: (ctx) => {
637
643
  const product = ctx.product?.name ?? "this plan";
638
644
  const planPhrase = ctx.plan?.name ? ` on ${ctx.plan.name}` : "";
639
- return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
645
+ return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
640
646
  }
641
647
  },
642
648
  cta: {
@@ -910,6 +916,10 @@ var enCopy = {
910
916
  paymentPayg: "Confirm your card to add credits to your balance."
911
917
  }
912
918
  },
919
+ legal: {
920
+ termsOfService: "Terms of Service",
921
+ privacyPolicy: "Privacy Policy"
922
+ },
913
923
  legalFooter: {
914
924
  terms: "Terms",
915
925
  privacy: "Privacy",
@@ -3569,8 +3579,12 @@ var MandateText = (0, import_react18.forwardRef)(
3569
3579
  legalName: merchant?.legalName ?? merchant?.displayName ?? "",
3570
3580
  displayName: merchant?.displayName,
3571
3581
  supportEmail: merchant?.supportEmail,
3572
- termsUrl: merchant?.termsUrl ?? SOLVAPAY_TERMS_URL,
3573
- privacyUrl: merchant?.privacyUrl ?? SOLVAPAY_PRIVACY_URL
3582
+ termsUrl: merchant?.termsUrl,
3583
+ privacyUrl: merchant?.privacyUrl
3584
+ },
3585
+ solvapay: {
3586
+ termsUrl: SOLVAPAY_TERMS_URL,
3587
+ privacyUrl: SOLVAPAY_PRIVACY_URL
3574
3588
  },
3575
3589
  plan: plan ? {
3576
3590
  name: plan.name,
@@ -3598,16 +3612,26 @@ var MandateText = (0, import_react18.forwardRef)(
3598
3612
  "data-solvapay-mandate-text": "",
3599
3613
  "data-variant": resolvedVariant,
3600
3614
  ...rest,
3601
- children: children ?? linkifyMandateText(text, ctx.merchant, copy, handleExternalClick)
3615
+ children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
3602
3616
  }
3603
3617
  );
3604
3618
  }
3605
3619
  );
3606
- function linkifyMandateText(text, merchant, copy, onLinkClick) {
3607
- const entries = [
3608
- { url: merchant.termsUrl, label: copy.legalFooter.terms },
3609
- { url: merchant.privacyUrl, label: copy.legalFooter.privacy }
3610
- ].filter((entry) => Boolean(entry.url));
3620
+ function linkifyMandateText(text, ctx, copy, onLinkClick) {
3621
+ const termsLabel = copy.legal.termsOfService;
3622
+ const privacyLabel = copy.legal.privacyPolicy;
3623
+ const seen = /* @__PURE__ */ new Set();
3624
+ const entries = [];
3625
+ for (const entry of [
3626
+ { url: ctx.merchant.termsUrl, label: termsLabel },
3627
+ { url: ctx.merchant.privacyUrl, label: privacyLabel },
3628
+ { url: ctx.solvapay.termsUrl, label: termsLabel },
3629
+ { url: ctx.solvapay.privacyUrl, label: privacyLabel }
3630
+ ]) {
3631
+ if (!entry.url || seen.has(entry.url)) continue;
3632
+ seen.add(entry.url);
3633
+ entries.push({ url: entry.url, label: entry.label });
3634
+ }
3611
3635
  if (entries.length === 0) return [text];
3612
3636
  const pattern = new RegExp(`(${entries.map((e) => escapeRegExp(e.url)).join("|")})`, "g");
3613
3637
  return text.split(pattern).map((part, i) => {
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-8NCXS45R.cjs';
3
- export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-8NCXS45R.cjs';
4
- import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-fuaNfBE5.cjs';
5
- export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-fuaNfBE5.cjs';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-zYGsspbH.cjs';
3
+ export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-zYGsspbH.cjs';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-BTZxR-Le.cjs';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-BTZxR-Le.cjs';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -1090,8 +1090,8 @@ type CopyProviderProps = {
1090
1090
  declare const CopyProvider: React.FC<CopyProviderProps>;
1091
1091
 
1092
1092
  /**
1093
- * Canonical English copy. Preserves the exact copy shipped before the i18n
1094
- * refactor so no visible behavior changes for English consumers.
1093
+ * Canonical English copy. Mandate variants keep their SCA lead-ins and
1094
+ * close with the hosted-style legal consent tail (`legalSentence`).
1095
1095
  */
1096
1096
  declare const enCopy: SolvaPayCopy;
1097
1097
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-C5_XnS_6.js';
3
- export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-C5_XnS_6.js';
4
- import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-CxGoNto4.js';
5
- export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-CxGoNto4.js';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-B144Vck8.js';
3
+ export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-B144Vck8.js';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-BY4aA8T2.js';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-BY4aA8T2.js';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -1090,8 +1090,8 @@ type CopyProviderProps = {
1090
1090
  declare const CopyProvider: React.FC<CopyProviderProps>;
1091
1091
 
1092
1092
  /**
1093
- * Canonical English copy. Preserves the exact copy shipped before the i18n
1094
- * refactor so no visible behavior changes for English consumers.
1093
+ * Canonical English copy. Mandate variants keep their SCA lead-ins and
1094
+ * close with the hosted-style legal consent tail (`legalSentence`).
1095
1095
  */
1096
1096
  declare const enCopy: SolvaPayCopy;
1097
1097
 
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  LaunchCustomerPortalButton,
6
6
  usePaymentMethod
7
- } from "./chunk-QWK3LMGG.js";
7
+ } from "./chunk-P4PPMKIK.js";
8
8
  import {
9
9
  ActivationFlow,
10
10
  AutoRecharge,
@@ -20,7 +20,7 @@ import {
20
20
  useCheckoutSteps,
21
21
  useCreditGate,
22
22
  usePaywallResolver
23
- } from "./chunk-LXG7QDM3.js";
23
+ } from "./chunk-BPF5NFWF.js";
24
24
  import {
25
25
  AmountPicker,
26
26
  BalanceBadge,
@@ -100,7 +100,7 @@ import {
100
100
  useTopupAmountSelector,
101
101
  useTransport,
102
102
  useUsage
103
- } from "./chunk-JXH36VLL.js";
103
+ } from "./chunk-MMD6AOUR.js";
104
104
  import {
105
105
  createAnonymousAuthAdapter,
106
106
  defaultAuthAdapter,
@@ -1223,14 +1223,20 @@ function trialPhrase(ctx) {
1223
1223
  const trialDays2 = ctx.plan?.trialDays ?? ctx.trialDays;
1224
1224
  return trialDays2 ? ` after your ${trialDays2}-day free trial` : "";
1225
1225
  }
1226
- function termsSentence(ctx) {
1227
- const { termsUrl, privacyUrl } = ctx.merchant;
1228
- if (termsUrl && privacyUrl) {
1229
- return ` See ${termsUrl} and ${privacyUrl}.`;
1226
+ function joinLegalDocs(urls) {
1227
+ if (urls.length === 2) return `${urls[0]} and ${urls[1]}`;
1228
+ return urls[0] ?? "";
1229
+ }
1230
+ function legalSentence(ctx) {
1231
+ const solvaClause = `SolvaPay's ${ctx.solvapay.termsUrl} and ${ctx.solvapay.privacyUrl}`;
1232
+ const merchantDocs = [];
1233
+ if (ctx.merchant.termsUrl) merchantDocs.push(ctx.merchant.termsUrl);
1234
+ if (ctx.merchant.privacyUrl) merchantDocs.push(ctx.merchant.privacyUrl);
1235
+ if (merchantDocs.length === 0) {
1236
+ return ` You agree to ${solvaClause}.`;
1230
1237
  }
1231
- if (termsUrl) return ` See ${termsUrl}.`;
1232
- if (privacyUrl) return ` See ${privacyUrl}.`;
1233
- return "";
1238
+ const brand = ctx.merchant.displayName || ctx.merchant.legalName;
1239
+ return ` You agree to ${brand}'s ${joinLegalDocs(merchantDocs)}, and ${solvaClause}.`;
1234
1240
  }
1235
1241
  var enCopy = {
1236
1242
  mandate: {
@@ -1238,27 +1244,27 @@ var enCopy = {
1238
1244
  const period = intervalPhrase(ctx);
1239
1245
  const trial = trialPhrase(ctx);
1240
1246
  const every = period ? ` every ${period}` : "";
1241
- return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
1247
+ return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
1242
1248
  },
1243
1249
  oneTime: (ctx) => {
1244
1250
  const product = ctx.product?.name ? ` for ${ctx.product.name}` : "";
1245
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
1251
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
1246
1252
  },
1247
1253
  topup: (ctx) => {
1248
1254
  const product = ctx.product?.name ? ` to add credits to your ${ctx.product.name} balance` : " to add credits to your balance";
1249
1255
  const savedCard = ctx.savesPaymentMethod ? ` You also authorize ${ctx.merchant.legalName} to save this card and charge it for future auto-recharges, which you can turn off any time.` : "";
1250
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${termsSentence(ctx)}`;
1256
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${legalSentence(ctx)}`;
1251
1257
  },
1252
1258
  usageMetered: (ctx) => {
1253
1259
  const measures = ctx.plan?.measures ?? "request";
1254
1260
  const cycle = ctx.plan?.billingCycle ?? "monthly";
1255
1261
  const product = ctx.product?.name ?? "the service";
1256
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
1262
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
1257
1263
  },
1258
1264
  freeTier: (ctx) => {
1259
1265
  const product = ctx.product?.name ?? "this plan";
1260
1266
  const planPhrase = ctx.plan?.name ? ` on ${ctx.plan.name}` : "";
1261
- return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
1267
+ return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
1262
1268
  }
1263
1269
  },
1264
1270
  cta: {
@@ -1532,6 +1538,10 @@ var enCopy = {
1532
1538
  paymentPayg: "Confirm your card to add credits to your balance."
1533
1539
  }
1534
1540
  },
1541
+ legal: {
1542
+ termsOfService: "Terms of Service",
1543
+ privacyPolicy: "Privacy Policy"
1544
+ },
1535
1545
  legalFooter: {
1536
1546
  terms: "Terms",
1537
1547
  privacy: "Privacy",
@@ -7860,8 +7870,12 @@ var MandateText = (0, import_react37.forwardRef)(
7860
7870
  legalName: merchant?.legalName ?? merchant?.displayName ?? "",
7861
7871
  displayName: merchant?.displayName,
7862
7872
  supportEmail: merchant?.supportEmail,
7863
- termsUrl: merchant?.termsUrl ?? SOLVAPAY_TERMS_URL,
7864
- privacyUrl: merchant?.privacyUrl ?? SOLVAPAY_PRIVACY_URL
7873
+ termsUrl: merchant?.termsUrl,
7874
+ privacyUrl: merchant?.privacyUrl
7875
+ },
7876
+ solvapay: {
7877
+ termsUrl: SOLVAPAY_TERMS_URL,
7878
+ privacyUrl: SOLVAPAY_PRIVACY_URL
7865
7879
  },
7866
7880
  plan: plan ? {
7867
7881
  name: plan.name,
@@ -7889,16 +7903,26 @@ var MandateText = (0, import_react37.forwardRef)(
7889
7903
  "data-solvapay-mandate-text": "",
7890
7904
  "data-variant": resolvedVariant,
7891
7905
  ...rest,
7892
- children: children ?? linkifyMandateText(text, ctx.merchant, copy, handleExternalClick)
7906
+ children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
7893
7907
  }
7894
7908
  );
7895
7909
  }
7896
7910
  );
7897
- function linkifyMandateText(text, merchant, copy, onLinkClick) {
7898
- const entries = [
7899
- { url: merchant.termsUrl, label: copy.legalFooter.terms },
7900
- { url: merchant.privacyUrl, label: copy.legalFooter.privacy }
7901
- ].filter((entry) => Boolean(entry.url));
7911
+ function linkifyMandateText(text, ctx, copy, onLinkClick) {
7912
+ const termsLabel = copy.legal.termsOfService;
7913
+ const privacyLabel = copy.legal.privacyPolicy;
7914
+ const seen = /* @__PURE__ */ new Set();
7915
+ const entries = [];
7916
+ for (const entry of [
7917
+ { url: ctx.merchant.termsUrl, label: termsLabel },
7918
+ { url: ctx.merchant.privacyUrl, label: privacyLabel },
7919
+ { url: ctx.solvapay.termsUrl, label: termsLabel },
7920
+ { url: ctx.solvapay.privacyUrl, label: privacyLabel }
7921
+ ]) {
7922
+ if (!entry.url || seen.has(entry.url)) continue;
7923
+ seen.add(entry.url);
7924
+ entries.push({ url: entry.url, label: entry.label });
7925
+ }
7902
7926
  if (entries.length === 0) return [text];
7903
7927
  const pattern = new RegExp(`(${entries.map((e) => escapeRegExp(e.url)).join("|")})`, "g");
7904
7928
  return text.split(pattern).map((part, i) => {
@@ -1,10 +1,10 @@
1
- import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-8NCXS45R.cjs';
1
+ import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-zYGsspbH.cjs';
2
2
  import { TOOL_FOR_VIEW, SolvaPayMcpViewKind, BootstrapMerchant, BootstrapProduct, BootstrapPlan, BootstrapCustomer } from '@solvapay/mcp-core';
3
3
  export { MCP_TOOL_NAMES, McpToolName } from '@solvapay/mcp-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import React from 'react';
6
6
  import { PricingOptionLike, PricedLike, BalancePegLike } from '@solvapay/core';
7
- import { U as UsageMeterRootProps } from '../UsageMeter-DWkwHgTP.cjs';
7
+ import { U as UsageMeterRootProps } from '../UsageMeter-DUeL64V4.cjs';
8
8
  import '@stripe/stripe-js';
9
9
  import '../adapters/auth.cjs';
10
10
 
@@ -1,10 +1,10 @@
1
- import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-C5_XnS_6.js';
1
+ import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-B144Vck8.js';
2
2
  import { TOOL_FOR_VIEW, SolvaPayMcpViewKind, BootstrapMerchant, BootstrapProduct, BootstrapPlan, BootstrapCustomer } from '@solvapay/mcp-core';
3
3
  export { MCP_TOOL_NAMES, McpToolName } from '@solvapay/mcp-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import React from 'react';
6
6
  import { PricingOptionLike, PricedLike, BalancePegLike } from '@solvapay/core';
7
- import { U as UsageMeterRootProps } from '../UsageMeter-DosUKnwg.js';
7
+ import { U as UsageMeterRootProps } from '../UsageMeter-iI9fukd0.js';
8
8
  import '@stripe/stripe-js';
9
9
  import '../adapters/auth.js';
10
10
 
package/dist/mcp/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  ExternalLinkGlyph,
3
3
  LaunchCustomerPortalButton,
4
4
  paymentMethodCache
5
- } from "../chunk-QWK3LMGG.js";
5
+ } from "../chunk-P4PPMKIK.js";
6
6
  import {
7
7
  AmountPicker,
8
8
  BalanceBadge,
@@ -57,7 +57,7 @@ import {
57
57
  useTransport,
58
58
  useUsage,
59
59
  validateAutoRechargeForm
60
- } from "../chunk-JXH36VLL.js";
60
+ } from "../chunk-MMD6AOUR.js";
61
61
  import "../chunk-UMXOAUW7.js";
62
62
  import "../chunk-MLKGABMK.js";
63
63
 
@@ -719,14 +719,20 @@ function trialPhrase(ctx) {
719
719
  const trialDays = ctx.plan?.trialDays ?? ctx.trialDays;
720
720
  return trialDays ? ` after your ${trialDays}-day free trial` : "";
721
721
  }
722
- function termsSentence(ctx) {
723
- const { termsUrl, privacyUrl } = ctx.merchant;
724
- if (termsUrl && privacyUrl) {
725
- return ` See ${termsUrl} and ${privacyUrl}.`;
722
+ function joinLegalDocs(urls) {
723
+ if (urls.length === 2) return `${urls[0]} and ${urls[1]}`;
724
+ return urls[0] ?? "";
725
+ }
726
+ function legalSentence(ctx) {
727
+ const solvaClause = `SolvaPay's ${ctx.solvapay.termsUrl} and ${ctx.solvapay.privacyUrl}`;
728
+ const merchantDocs = [];
729
+ if (ctx.merchant.termsUrl) merchantDocs.push(ctx.merchant.termsUrl);
730
+ if (ctx.merchant.privacyUrl) merchantDocs.push(ctx.merchant.privacyUrl);
731
+ if (merchantDocs.length === 0) {
732
+ return ` You agree to ${solvaClause}.`;
726
733
  }
727
- if (termsUrl) return ` See ${termsUrl}.`;
728
- if (privacyUrl) return ` See ${privacyUrl}.`;
729
- return "";
734
+ const brand = ctx.merchant.displayName || ctx.merchant.legalName;
735
+ return ` You agree to ${brand}'s ${joinLegalDocs(merchantDocs)}, and ${solvaClause}.`;
730
736
  }
731
737
  var enCopy = {
732
738
  mandate: {
@@ -734,27 +740,27 @@ var enCopy = {
734
740
  const period = intervalPhrase(ctx);
735
741
  const trial = trialPhrase(ctx);
736
742
  const every = period ? ` every ${period}` : "";
737
- return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
743
+ return `By subscribing, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${every}${trial} until you cancel. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
738
744
  },
739
745
  oneTime: (ctx) => {
740
746
  const product = ctx.product?.name ? ` for ${ctx.product.name}` : "";
741
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
747
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge a one-time ${ctx.amountFormatted}${product}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
742
748
  },
743
749
  topup: (ctx) => {
744
750
  const product = ctx.product?.name ? ` to add credits to your ${ctx.product.name} balance` : " to add credits to your balance";
745
751
  const savedCard = ctx.savesPaymentMethod ? ` You also authorize ${ctx.merchant.legalName} to save this card and charge it for future auto-recharges, which you can turn off any time.` : "";
746
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${termsSentence(ctx)}`;
752
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${legalSentence(ctx)}`;
747
753
  },
748
754
  usageMetered: (ctx) => {
749
755
  const measures = ctx.plan?.measures ?? "request";
750
756
  const cycle = ctx.plan?.billingCycle ?? "monthly";
751
757
  const product = ctx.product?.name ?? "the service";
752
- return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
758
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge your payment method for metered usage of ${product} at ${ctx.amountFormatted} per ${measures}, billed ${cycle}. You can cancel any time. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
753
759
  },
754
760
  freeTier: (ctx) => {
755
761
  const product = ctx.product?.name ?? "this plan";
756
762
  const planPhrase = ctx.plan?.name ? ` on ${ctx.plan.name}` : "";
757
- return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
763
+ return `By confirming, you activate ${product}${planPhrase}. Payments are processed by SolvaPay.${legalSentence(ctx)}`;
758
764
  }
759
765
  },
760
766
  cta: {
@@ -1028,6 +1034,10 @@ var enCopy = {
1028
1034
  paymentPayg: "Confirm your card to add credits to your balance."
1029
1035
  }
1030
1036
  },
1037
+ legal: {
1038
+ termsOfService: "Terms of Service",
1039
+ privacyPolicy: "Privacy Policy"
1040
+ },
1031
1041
  legalFooter: {
1032
1042
  terms: "Terms",
1033
1043
  privacy: "Privacy",
@@ -3397,8 +3407,12 @@ var MandateText = (0, import_react19.forwardRef)(
3397
3407
  legalName: merchant?.legalName ?? merchant?.displayName ?? "",
3398
3408
  displayName: merchant?.displayName,
3399
3409
  supportEmail: merchant?.supportEmail,
3400
- termsUrl: merchant?.termsUrl ?? SOLVAPAY_TERMS_URL,
3401
- privacyUrl: merchant?.privacyUrl ?? SOLVAPAY_PRIVACY_URL
3410
+ termsUrl: merchant?.termsUrl,
3411
+ privacyUrl: merchant?.privacyUrl
3412
+ },
3413
+ solvapay: {
3414
+ termsUrl: SOLVAPAY_TERMS_URL,
3415
+ privacyUrl: SOLVAPAY_PRIVACY_URL
3402
3416
  },
3403
3417
  plan: plan ? {
3404
3418
  name: plan.name,
@@ -3426,16 +3440,26 @@ var MandateText = (0, import_react19.forwardRef)(
3426
3440
  "data-solvapay-mandate-text": "",
3427
3441
  "data-variant": resolvedVariant,
3428
3442
  ...rest,
3429
- children: children ?? linkifyMandateText(text, ctx.merchant, copy, handleExternalClick)
3443
+ children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
3430
3444
  }
3431
3445
  );
3432
3446
  }
3433
3447
  );
3434
- function linkifyMandateText(text, merchant, copy, onLinkClick) {
3435
- const entries = [
3436
- { url: merchant.termsUrl, label: copy.legalFooter.terms },
3437
- { url: merchant.privacyUrl, label: copy.legalFooter.privacy }
3438
- ].filter((entry) => Boolean(entry.url));
3448
+ function linkifyMandateText(text, ctx, copy, onLinkClick) {
3449
+ const termsLabel = copy.legal.termsOfService;
3450
+ const privacyLabel = copy.legal.privacyPolicy;
3451
+ const seen = /* @__PURE__ */ new Set();
3452
+ const entries = [];
3453
+ for (const entry of [
3454
+ { url: ctx.merchant.termsUrl, label: termsLabel },
3455
+ { url: ctx.merchant.privacyUrl, label: privacyLabel },
3456
+ { url: ctx.solvapay.termsUrl, label: termsLabel },
3457
+ { url: ctx.solvapay.privacyUrl, label: privacyLabel }
3458
+ ]) {
3459
+ if (!entry.url || seen.has(entry.url)) continue;
3460
+ seen.add(entry.url);
3461
+ entries.push({ url: entry.url, label: entry.label });
3462
+ }
3439
3463
  if (entries.length === 0) return [text];
3440
3464
  const pattern = new RegExp(`(${entries.map((e) => escapeRegExp(e.url)).join("|")})`, "g");
3441
3465
  return text.split(pattern).map((part, i) => {
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { Ref } from 'react';
3
- import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-8NCXS45R.cjs';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-8NCXS45R.cjs';
3
+ import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-zYGsspbH.cjs';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-zYGsspbH.cjs';
5
5
  import { TaxBreakdown, BusinessDetailsInput } from '@solvapay/core';
6
- import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-fuaNfBE5.cjs';
7
- export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-fuaNfBE5.cjs';
6
+ import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-BTZxR-Le.cjs';
7
+ export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-BTZxR-Le.cjs';
8
8
  import { PaymentElement } from '@stripe/react-stripe-js';
9
9
  import { Stripe, StripeElements } from '@stripe/stripe-js';
10
- export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-DWkwHgTP.cjs';
10
+ export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-DUeL64V4.cjs';
11
11
  import '../adapters/auth.cjs';
12
12
 
13
13
  type PlanPricingOption = {
@@ -923,8 +923,9 @@ declare function useAutoRechargeForm(): AutoRechargeContextValue;
923
923
  * but dependency-free so it can ship inside `<PaymentForm>` / `<TopupForm>`
924
924
  * default trees and the MCP shell footer.
925
925
  *
926
- * Merchant terms/privacy URLs are *not* rendered here — those continue
927
- * to be woven into the mandate sentence by `<MandateText>`.
926
+ * Merchant terms/privacy URLs are *not* rendered here — those appear
927
+ * in the `<MandateText>` consent tail when the merchant has set them.
928
+ * This strip is always SolvaPay's own Terms · Privacy.
928
929
  */
929
930
 
930
931
  type LegalFooterProps = {
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { Ref } from 'react';
3
- import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-C5_XnS_6.js';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-C5_XnS_6.js';
3
+ import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-B144Vck8.js';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-B144Vck8.js';
5
5
  import { TaxBreakdown, BusinessDetailsInput } from '@solvapay/core';
6
- import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-CxGoNto4.js';
7
- export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-CxGoNto4.js';
6
+ import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-BY4aA8T2.js';
7
+ export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-BY4aA8T2.js';
8
8
  import { PaymentElement } from '@stripe/react-stripe-js';
9
9
  import { Stripe, StripeElements } from '@stripe/stripe-js';
10
- export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-DosUKnwg.js';
10
+ export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-iI9fukd0.js';
11
11
  import '../adapters/auth.js';
12
12
 
13
13
  type PlanPricingOption = {
@@ -923,8 +923,9 @@ declare function useAutoRechargeForm(): AutoRechargeContextValue;
923
923
  * but dependency-free so it can ship inside `<PaymentForm>` / `<TopupForm>`
924
924
  * default trees and the MCP shell footer.
925
925
  *
926
- * Merchant terms/privacy URLs are *not* rendered here — those continue
927
- * to be woven into the mandate sentence by `<MandateText>`.
926
+ * Merchant terms/privacy URLs are *not* rendered here — those appear
927
+ * in the `<MandateText>` consent tail when the merchant has set them.
928
+ * This strip is always SolvaPay's own Terms · Privacy.
928
929
  */
929
930
 
930
931
  type LegalFooterProps = {
@@ -89,7 +89,7 @@ import {
89
89
  useCreditGate,
90
90
  usePaywallNotice,
91
91
  usePurchaseGate
92
- } from "../chunk-LXG7QDM3.js";
92
+ } from "../chunk-BPF5NFWF.js";
93
93
  import {
94
94
  AmountPicker,
95
95
  AmountPickerConfirm,
@@ -175,7 +175,7 @@ import {
175
175
  usePlanSelector,
176
176
  useTopupForm,
177
177
  useUsageMeter
178
- } from "../chunk-JXH36VLL.js";
178
+ } from "../chunk-MMD6AOUR.js";
179
179
  import "../chunk-UMXOAUW7.js";
180
180
  import "../chunk-MLKGABMK.js";
181
181
  export {
@@ -4043,9 +4043,25 @@ type MandateContext = {
4043
4043
  legalName: string;
4044
4044
  displayName?: string;
4045
4045
  supportEmail?: string;
4046
+ /**
4047
+ * Merchant-published Terms of Service URL. Omitted when the merchant
4048
+ * has not set one — never a SolvaPay fallback.
4049
+ */
4046
4050
  termsUrl?: string;
4051
+ /**
4052
+ * Merchant-published Privacy Policy URL. Omitted when the merchant
4053
+ * has not set one — never a SolvaPay fallback.
4054
+ */
4047
4055
  privacyUrl?: string;
4048
4056
  };
4057
+ /**
4058
+ * SolvaPay's own legal pages. Always present — SolvaPay is the
4059
+ * processor on every charge, so its terms always apply.
4060
+ */
4061
+ solvapay: {
4062
+ termsUrl: string;
4063
+ privacyUrl: string;
4064
+ };
4049
4065
  plan?: {
4050
4066
  name?: string;
4051
4067
  interval?: string;
@@ -4448,6 +4464,16 @@ interface SolvaPayCopy {
4448
4464
  paymentPayg: string;
4449
4465
  };
4450
4466
  };
4467
+ /**
4468
+ * Full legal-document names used in the mandate consent tail
4469
+ * ("Terms of Service" / "Privacy Policy"). Distinct from
4470
+ * `legalFooter.terms` / `legalFooter.privacy`, which stay short
4471
+ * for the footer strip.
4472
+ */
4473
+ legal: {
4474
+ termsOfService: string;
4475
+ privacyPolicy: string;
4476
+ };
4451
4477
  legalFooter: {
4452
4478
  terms: string;
4453
4479
  privacy: string;
@@ -5038,14 +5064,12 @@ interface SolvaPayConfig {
5038
5064
  * @example
5039
5065
  * ```tsx
5040
5066
  * import { createSupabaseAuthAdapter } from '@solvapay/react-supabase';
5067
+ * import { supabase } from './supabase'; // your existing client
5041
5068
  *
5042
5069
  * <SolvaPayProvider
5043
5070
  * config={{
5044
5071
  * auth: {
5045
- * adapter: createSupabaseAuthAdapter({
5046
- * supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL!,
5047
- * supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
5048
- * })
5072
+ * adapter: createSupabaseAuthAdapter({ client: supabase })
5049
5073
  * }
5050
5074
  * }}
5051
5075
  * >
@@ -4043,9 +4043,25 @@ type MandateContext = {
4043
4043
  legalName: string;
4044
4044
  displayName?: string;
4045
4045
  supportEmail?: string;
4046
+ /**
4047
+ * Merchant-published Terms of Service URL. Omitted when the merchant
4048
+ * has not set one — never a SolvaPay fallback.
4049
+ */
4046
4050
  termsUrl?: string;
4051
+ /**
4052
+ * Merchant-published Privacy Policy URL. Omitted when the merchant
4053
+ * has not set one — never a SolvaPay fallback.
4054
+ */
4047
4055
  privacyUrl?: string;
4048
4056
  };
4057
+ /**
4058
+ * SolvaPay's own legal pages. Always present — SolvaPay is the
4059
+ * processor on every charge, so its terms always apply.
4060
+ */
4061
+ solvapay: {
4062
+ termsUrl: string;
4063
+ privacyUrl: string;
4064
+ };
4049
4065
  plan?: {
4050
4066
  name?: string;
4051
4067
  interval?: string;
@@ -4448,6 +4464,16 @@ interface SolvaPayCopy {
4448
4464
  paymentPayg: string;
4449
4465
  };
4450
4466
  };
4467
+ /**
4468
+ * Full legal-document names used in the mandate consent tail
4469
+ * ("Terms of Service" / "Privacy Policy"). Distinct from
4470
+ * `legalFooter.terms` / `legalFooter.privacy`, which stay short
4471
+ * for the footer strip.
4472
+ */
4473
+ legal: {
4474
+ termsOfService: string;
4475
+ privacyPolicy: string;
4476
+ };
4451
4477
  legalFooter: {
4452
4478
  terms: string;
4453
4479
  privacy: string;
@@ -5038,14 +5064,12 @@ interface SolvaPayConfig {
5038
5064
  * @example
5039
5065
  * ```tsx
5040
5066
  * import { createSupabaseAuthAdapter } from '@solvapay/react-supabase';
5067
+ * import { supabase } from './supabase'; // your existing client
5041
5068
  *
5042
5069
  * <SolvaPayProvider
5043
5070
  * config={{
5044
5071
  * auth: {
5045
- * adapter: createSupabaseAuthAdapter({
5046
- * supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL!,
5047
- * supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
5048
- * })
5072
+ * adapter: createSupabaseAuthAdapter({ client: supabase })
5049
5073
  * }
5050
5074
  * }}
5051
5075
  * >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -85,7 +85,7 @@
85
85
  "react-dom": "^19.2.5",
86
86
  "typescript": "^5.9.3",
87
87
  "vitest": "^4.1.2",
88
- "@solvapay/mcp-core": "0.4.4",
88
+ "@solvapay/mcp-core": "0.4.5",
89
89
  "@solvapay/server": "2.8.0",
90
90
  "@solvapay/test-utils": "0.0.0"
91
91
  },