@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 +8 -0
- package/dist/{UsageMeter-DWkwHgTP.d.cts → UsageMeter-DUeL64V4.d.cts} +1 -1
- package/dist/{UsageMeter-DosUKnwg.d.ts → UsageMeter-iI9fukd0.d.ts} +1 -1
- package/dist/{chunk-LXG7QDM3.js → chunk-BPF5NFWF.js} +1 -1
- package/dist/{chunk-JXH36VLL.js → chunk-MMD6AOUR.js} +44 -20
- package/dist/{chunk-QWK3LMGG.js → chunk-P4PPMKIK.js} +1 -1
- package/dist/{index-CxGoNto4.d.ts → index-BTZxR-Le.d.cts} +11 -15
- package/dist/{index-fuaNfBE5.d.cts → index-BY4aA8T2.d.ts} +11 -15
- package/dist/index.cjs +44 -20
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/mcp/index.cjs +44 -20
- package/dist/mcp/index.d.cts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +2 -2
- package/dist/primitives/index.cjs +44 -20
- package/dist/primitives/index.d.cts +8 -7
- package/dist/primitives/index.d.ts +8 -7
- package/dist/primitives/index.js +2 -2
- package/dist/{useUsage-C5_XnS_6.d.ts → useUsage-B144Vck8.d.ts} +28 -4
- package/dist/{useUsage-8NCXS45R.d.cts → useUsage-zYGsspbH.d.cts} +28 -4
- package/package.json +2 -2
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
|
|
@@ -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
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
-
|
|
363
|
-
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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
|
|
3162
|
-
privacyUrl: merchant?.privacyUrl
|
|
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
|
|
3204
|
+
children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
|
|
3191
3205
|
}
|
|
3192
3206
|
);
|
|
3193
3207
|
}
|
|
3194
3208
|
);
|
|
3195
|
-
function linkifyMandateText(text,
|
|
3196
|
-
const
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
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) => {
|
|
@@ -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-
|
|
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
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
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
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
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-
|
|
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
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
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
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
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
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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
|
-
|
|
610
|
-
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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
|
|
3573
|
-
privacyUrl: merchant?.privacyUrl
|
|
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
|
|
3615
|
+
children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
|
|
3602
3616
|
}
|
|
3603
3617
|
);
|
|
3604
3618
|
}
|
|
3605
3619
|
);
|
|
3606
|
-
function linkifyMandateText(text,
|
|
3607
|
-
const
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
1094
|
-
*
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
1094
|
-
*
|
|
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-
|
|
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-
|
|
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-
|
|
103
|
+
} from "./chunk-MMD6AOUR.js";
|
|
104
104
|
import {
|
|
105
105
|
createAnonymousAuthAdapter,
|
|
106
106
|
defaultAuthAdapter,
|
package/dist/mcp/index.cjs
CHANGED
|
@@ -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
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
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
|
-
|
|
1232
|
-
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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
|
|
7864
|
-
privacyUrl: merchant?.privacyUrl
|
|
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
|
|
7906
|
+
children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
|
|
7893
7907
|
}
|
|
7894
7908
|
);
|
|
7895
7909
|
}
|
|
7896
7910
|
);
|
|
7897
|
-
function linkifyMandateText(text,
|
|
7898
|
-
const
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
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) => {
|
package/dist/mcp/index.d.cts
CHANGED
|
@@ -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-
|
|
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-
|
|
7
|
+
import { U as UsageMeterRootProps } from '../UsageMeter-DUeL64V4.cjs';
|
|
8
8
|
import '@stripe/stripe-js';
|
|
9
9
|
import '../adapters/auth.cjs';
|
|
10
10
|
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
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
|
-
|
|
728
|
-
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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.${
|
|
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
|
|
3401
|
-
privacyUrl: merchant?.privacyUrl
|
|
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
|
|
3443
|
+
children: children ?? linkifyMandateText(text, ctx, copy, handleExternalClick)
|
|
3430
3444
|
}
|
|
3431
3445
|
);
|
|
3432
3446
|
}
|
|
3433
3447
|
);
|
|
3434
|
-
function linkifyMandateText(text,
|
|
3435
|
-
const
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
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-
|
|
4
|
-
export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
927
|
-
*
|
|
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-
|
|
4
|
-
export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
927
|
-
*
|
|
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 = {
|
package/dist/primitives/index.js
CHANGED
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
useCreditGate,
|
|
90
90
|
usePaywallNotice,
|
|
91
91
|
usePurchaseGate
|
|
92
|
-
} from "../chunk-
|
|
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-
|
|
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
|
+
"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.
|
|
88
|
+
"@solvapay/mcp-core": "0.4.5",
|
|
89
89
|
"@solvapay/server": "2.8.0",
|
|
90
90
|
"@solvapay/test-utils": "0.0.0"
|
|
91
91
|
},
|