@solvapay/react 1.6.0 → 1.7.0-preview-031ea39902d26214be1783881a26a2000d5baf7c
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 +20 -2
- package/dist/{chunk-FL2AUJSS.js → chunk-HBD3FI4Q.js} +9 -3
- package/dist/{chunk-32645JVL.js → chunk-OGS3UOOB.js} +15 -15
- package/dist/{chunk-JL56A2Q6.js → chunk-RKNP7IY4.js} +1 -1
- package/dist/{index-C_71NEF-.d.ts → index-DJ7llYmK.d.cts} +2 -2
- package/dist/{index-D_6g3F4h.d.cts → index-SFxuDtdC.d.ts} +2 -2
- package/dist/index.cjs +23 -17
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/mcp/index.cjs +15 -15
- package/dist/mcp/index.d.cts +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +2 -2
- package/dist/primitives/index.cjs +23 -17
- package/dist/primitives/index.d.cts +5 -5
- package/dist/primitives/index.d.ts +5 -5
- package/dist/primitives/index.js +2 -2
- package/dist/{shared-C1gytO3r.d.ts → shared-B3YBHDMP.d.ts} +2303 -1964
- package/dist/{shared-y3ceQ8eH.d.cts → shared-BwfUleA3.d.cts} +2303 -1964
- package/dist/styles.css +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @solvapay/react changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.0-preview-031ea39902d26214be1783881a26a2000d5baf7c
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 848e235: Prefer `meterName` over the deprecated `usageType` on `payable()` options, paywall metadata, and `checkLimits`. `usageType` stays accepted as an alias and is now typed as `string` rather than `'requests' | 'tokens'`, so a custom meter name type-checks on either field.
|
|
8
|
+
|
|
9
|
+
React copy uses the meter noun (`{unit}`) instead of generic "calls" / "messages", and `useUsage` falls back from `meterRef` to `meterId` when resolving the meter off a plan snapshot.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 12f446b: Widen the `@solvapay/mcp-core` peer range to `^0.2.8 || ^0.3.0`, so this package stays installable against both lines. It consumes only stable type and constant exports and does not touch the `hideToolsByAudience` surface or zod schema construction that changed in `0.3.0`.
|
|
14
|
+
- Updated dependencies [800f081]
|
|
15
|
+
- Updated dependencies [12f446b]
|
|
16
|
+
- Updated dependencies [c6d3ddc]
|
|
17
|
+
- Updated dependencies [3a310eb]
|
|
18
|
+
- @solvapay/core@1.3.0-preview-031ea39902d26214be1783881a26a2000d5baf7c
|
|
19
|
+
- @solvapay/mcp-core@0.3.0-preview-031ea39902d26214be1783881a26a2000d5baf7c
|
|
20
|
+
|
|
3
21
|
## 1.6.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -432,8 +450,8 @@ pickPlanButton}` and `currentPlan.startedOn` copy keys.
|
|
|
432
450
|
|
|
433
451
|
- 92401d3: Add a `<LegalFooter>` primitive that renders a
|
|
434
452
|
`Terms · Privacy / Provided by SolvaPay` strip pointing at SolvaPay's own
|
|
435
|
-
legal pages. Mirrors the hosted-checkout footer
|
|
436
|
-
|
|
453
|
+
legal pages. Mirrors the hosted-checkout footer with self-contained styles
|
|
454
|
+
in the SDK.
|
|
437
455
|
- New `legalFooter.{terms, privacy, providedBy, poweredBy}` keys on the
|
|
438
456
|
i18n bundle, overridable via `<SolvaPayProvider config={{ copy }}>`.
|
|
439
457
|
- `<PaymentForm>` and `<TopupForm>` expose a `LegalFooter` namespace
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
useTopupAmountSelector,
|
|
40
40
|
withPaymentElementDefaults,
|
|
41
41
|
writeAutoRechargeCache
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-OGS3UOOB.js";
|
|
43
43
|
|
|
44
44
|
// src/TopupForm.tsx
|
|
45
45
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3074,15 +3074,21 @@ function resolvePaywallMessage(content, paywallCopy) {
|
|
|
3074
3074
|
const forProduct = productName ? interpolate(paywallCopy.paymentRequiredProductSuffix, { product: productName }) : "";
|
|
3075
3075
|
if (content.kind === "payment_required") {
|
|
3076
3076
|
const balance = content.balance;
|
|
3077
|
+
const unitSingular = "request";
|
|
3078
|
+
const unitPlural = "requests";
|
|
3077
3079
|
if (!balance) {
|
|
3078
|
-
return interpolate(paywallCopy.paymentRequiredMessageNoBalance, {
|
|
3080
|
+
return interpolate(paywallCopy.paymentRequiredMessageNoBalance, {
|
|
3081
|
+
forProduct,
|
|
3082
|
+
unit: unitPlural
|
|
3083
|
+
});
|
|
3079
3084
|
}
|
|
3080
3085
|
const remaining = balance.remainingUnits ?? 0;
|
|
3081
3086
|
if (remaining <= 0) {
|
|
3082
|
-
return interpolate(paywallCopy.paymentRequiredMessage, { forProduct });
|
|
3087
|
+
return interpolate(paywallCopy.paymentRequiredMessage, { forProduct, unit: unitPlural });
|
|
3083
3088
|
}
|
|
3084
3089
|
return interpolate(paywallCopy.paymentRequiredMessageRemaining, {
|
|
3085
3090
|
remaining: String(remaining),
|
|
3091
|
+
unit: remaining === 1 ? unitSingular : unitPlural,
|
|
3086
3092
|
pluralSuffix: remaining === 1 ? "" : "s",
|
|
3087
3093
|
forProduct
|
|
3088
3094
|
});
|
|
@@ -360,7 +360,7 @@ var enCopy = {
|
|
|
360
360
|
return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
|
|
361
361
|
},
|
|
362
362
|
usageMetered: (ctx) => {
|
|
363
|
-
const measures = ctx.plan?.measures ?? "
|
|
363
|
+
const measures = ctx.plan?.measures ?? "request";
|
|
364
364
|
const cycle = ctx.plan?.billingCycle ?? "monthly";
|
|
365
365
|
const product = ctx.product?.name ?? "the service";
|
|
366
366
|
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)}`;
|
|
@@ -434,12 +434,12 @@ var enCopy = {
|
|
|
434
434
|
creditEstimateApprox: "~ {credits} credits"
|
|
435
435
|
},
|
|
436
436
|
autoRecharge: {
|
|
437
|
-
heading: "Auto
|
|
438
|
-
description: "Automatically
|
|
439
|
-
settingsHeading: "Auto
|
|
437
|
+
heading: "Auto-recharge",
|
|
438
|
+
description: "Automatically recharge when your balance runs low, so you never run out. You can turn this off anytime.",
|
|
439
|
+
settingsHeading: "Auto-recharge settings",
|
|
440
440
|
setupTriggerLabel: "Set up auto-recharge",
|
|
441
441
|
modifyTriggerLabel: "Modify",
|
|
442
|
-
notConfiguredHint: "
|
|
442
|
+
notConfiguredHint: "Auto-recharge is off. Set it up if you want credits added when your balance runs low.",
|
|
443
443
|
enableLabel: "Enable auto-recharge",
|
|
444
444
|
enableQuestion: "Would you like to set up automatic recharge?",
|
|
445
445
|
enableSentence: "Yes, automatically recharge my card when my credit balance falls below a threshold",
|
|
@@ -449,12 +449,12 @@ var enCopy = {
|
|
|
449
449
|
fixedAmountAriaLabel: "Fixed top-up amount",
|
|
450
450
|
saveButton: "Save settings",
|
|
451
451
|
cancelButton: "Cancel",
|
|
452
|
-
disableButton: "Disable
|
|
453
|
-
savedMessage: "
|
|
454
|
-
disabledMessage: "
|
|
455
|
-
setupRequiredMessage: "Confirm your card to activate
|
|
452
|
+
disableButton: "Disable auto-recharge",
|
|
453
|
+
savedMessage: "Auto-recharge settings saved.",
|
|
454
|
+
disabledMessage: "Auto-recharge disabled.",
|
|
455
|
+
setupRequiredMessage: "Confirm your card to activate auto-recharge.",
|
|
456
456
|
setupHeading: "Authorize card",
|
|
457
|
-
setupDescription: "Authorize a card for
|
|
457
|
+
setupDescription: "Authorize a card for auto-recharge. You will not be charged now.",
|
|
458
458
|
setupSubmit: "Save card for auto-recharge",
|
|
459
459
|
setupProcessing: "Authorizing...",
|
|
460
460
|
setupAwaitingConfirmation: "Card authorized. Finishing activation \u2014 this can take a moment.",
|
|
@@ -595,9 +595,9 @@ var enCopy = {
|
|
|
595
595
|
resolvedHeading: "You can continue",
|
|
596
596
|
productContext: "For {product}",
|
|
597
597
|
balanceLine: "You have {available} credits, need {required}.",
|
|
598
|
-
paymentRequiredMessage: "You've used all your included
|
|
599
|
-
paymentRequiredMessageRemaining: "Only {remaining}
|
|
600
|
-
paymentRequiredMessageNoBalance: "You've used your included
|
|
598
|
+
paymentRequiredMessage: "You've used all your included {unit}{forProduct}. Choose a plan below to keep going.",
|
|
599
|
+
paymentRequiredMessageRemaining: "Only {remaining} {unit} left{forProduct}. Choose a plan below to keep going.",
|
|
600
|
+
paymentRequiredMessageNoBalance: "You've used your included {unit}{forProduct}. Pick a plan below to keep going.",
|
|
601
601
|
activationRequiredMessage: "You need an active plan{forProduct} to continue. Pick one below.",
|
|
602
602
|
topupRequiredMessage: "You're out of credits{forProduct}. Add more below to keep going.",
|
|
603
603
|
paymentRequiredProductSuffix: " for {product}",
|
|
@@ -6085,7 +6085,7 @@ function deriveUsage(purchase) {
|
|
|
6085
6085
|
if (!purchase) return null;
|
|
6086
6086
|
const snap = purchase.planSnapshot;
|
|
6087
6087
|
const usage = purchase.usage;
|
|
6088
|
-
const meterRef = snap?.meterRef ?? null;
|
|
6088
|
+
const meterRef = snap?.meterRef ?? snap?.meterId ?? null;
|
|
6089
6089
|
const creditsPerUnit = snap?.creditsPerUnit;
|
|
6090
6090
|
const isCreditBased = typeof creditsPerUnit === "number" && creditsPerUnit > 0;
|
|
6091
6091
|
const total = typeof snap?.limit === "number" ? snap.limit : null;
|
|
@@ -6263,7 +6263,7 @@ var Label = forwardRef12(function UsageMeterLabel({ className, children, ...rest
|
|
|
6263
6263
|
}
|
|
6264
6264
|
);
|
|
6265
6265
|
}
|
|
6266
|
-
const unit = ctx.usage.meterRef ?? "
|
|
6266
|
+
const unit = ctx.usage.meterRef ?? "requests";
|
|
6267
6267
|
const label = ctx.usage.total !== null ? interpolate(copy.usage.usedLabel, {
|
|
6268
6268
|
used: String(ctx.usage.used),
|
|
6269
6269
|
total: String(ctx.usage.total),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, r as UseTopupAmountSelectorReturn, a0 as AutoRechargeInput, t as AutoRechargeConfig, a1 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './shared-
|
|
1
|
+
import { $ as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, r as UseTopupAmountSelectorReturn, a0 as AutoRechargeInput, t as AutoRechargeConfig, a1 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './shared-BwfUleA3.cjs';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
|
|
4
4
|
import { TaxBreakdown } from '@solvapay/core';
|
|
@@ -586,7 +586,7 @@ interface UseUsageReturn {
|
|
|
586
586
|
isApproachingLimit: boolean;
|
|
587
587
|
/** Plan is usage-based, `percentUsed >= 100`. */
|
|
588
588
|
isAtLimit: boolean;
|
|
589
|
-
/** True when `usage.total === null` (no
|
|
589
|
+
/** True when `usage.total === null` (no included cap on this plan). */
|
|
590
590
|
isUnlimited: boolean;
|
|
591
591
|
/** The meter reference (e.g. `'tokens'`). `null` when not usage-based. */
|
|
592
592
|
meterRef: string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, r as UseTopupAmountSelectorReturn, a0 as AutoRechargeInput, t as AutoRechargeConfig, a1 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './shared-
|
|
1
|
+
import { $ as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, r as UseTopupAmountSelectorReturn, a0 as AutoRechargeInput, t as AutoRechargeConfig, a1 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './shared-B3YBHDMP.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
|
|
4
4
|
import { TaxBreakdown } from '@solvapay/core';
|
|
@@ -586,7 +586,7 @@ interface UseUsageReturn {
|
|
|
586
586
|
isApproachingLimit: boolean;
|
|
587
587
|
/** Plan is usage-based, `percentUsed >= 100`. */
|
|
588
588
|
isAtLimit: boolean;
|
|
589
|
-
/** True when `usage.total === null` (no
|
|
589
|
+
/** True when `usage.total === null` (no included cap on this plan). */
|
|
590
590
|
isUnlimited: boolean;
|
|
591
591
|
/** The meter reference (e.g. `'tokens'`). `null` when not usage-based. */
|
|
592
592
|
meterRef: string | null;
|
package/dist/index.cjs
CHANGED
|
@@ -603,7 +603,7 @@ var enCopy = {
|
|
|
603
603
|
return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
|
|
604
604
|
},
|
|
605
605
|
usageMetered: (ctx) => {
|
|
606
|
-
const measures = ctx.plan?.measures ?? "
|
|
606
|
+
const measures = ctx.plan?.measures ?? "request";
|
|
607
607
|
const cycle = ctx.plan?.billingCycle ?? "monthly";
|
|
608
608
|
const product = ctx.product?.name ?? "the service";
|
|
609
609
|
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)}`;
|
|
@@ -677,12 +677,12 @@ var enCopy = {
|
|
|
677
677
|
creditEstimateApprox: "~ {credits} credits"
|
|
678
678
|
},
|
|
679
679
|
autoRecharge: {
|
|
680
|
-
heading: "Auto
|
|
681
|
-
description: "Automatically
|
|
682
|
-
settingsHeading: "Auto
|
|
680
|
+
heading: "Auto-recharge",
|
|
681
|
+
description: "Automatically recharge when your balance runs low, so you never run out. You can turn this off anytime.",
|
|
682
|
+
settingsHeading: "Auto-recharge settings",
|
|
683
683
|
setupTriggerLabel: "Set up auto-recharge",
|
|
684
684
|
modifyTriggerLabel: "Modify",
|
|
685
|
-
notConfiguredHint: "
|
|
685
|
+
notConfiguredHint: "Auto-recharge is off. Set it up if you want credits added when your balance runs low.",
|
|
686
686
|
enableLabel: "Enable auto-recharge",
|
|
687
687
|
enableQuestion: "Would you like to set up automatic recharge?",
|
|
688
688
|
enableSentence: "Yes, automatically recharge my card when my credit balance falls below a threshold",
|
|
@@ -692,12 +692,12 @@ var enCopy = {
|
|
|
692
692
|
fixedAmountAriaLabel: "Fixed top-up amount",
|
|
693
693
|
saveButton: "Save settings",
|
|
694
694
|
cancelButton: "Cancel",
|
|
695
|
-
disableButton: "Disable
|
|
696
|
-
savedMessage: "
|
|
697
|
-
disabledMessage: "
|
|
698
|
-
setupRequiredMessage: "Confirm your card to activate
|
|
695
|
+
disableButton: "Disable auto-recharge",
|
|
696
|
+
savedMessage: "Auto-recharge settings saved.",
|
|
697
|
+
disabledMessage: "Auto-recharge disabled.",
|
|
698
|
+
setupRequiredMessage: "Confirm your card to activate auto-recharge.",
|
|
699
699
|
setupHeading: "Authorize card",
|
|
700
|
-
setupDescription: "Authorize a card for
|
|
700
|
+
setupDescription: "Authorize a card for auto-recharge. You will not be charged now.",
|
|
701
701
|
setupSubmit: "Save card for auto-recharge",
|
|
702
702
|
setupProcessing: "Authorizing...",
|
|
703
703
|
setupAwaitingConfirmation: "Card authorized. Finishing activation \u2014 this can take a moment.",
|
|
@@ -838,9 +838,9 @@ var enCopy = {
|
|
|
838
838
|
resolvedHeading: "You can continue",
|
|
839
839
|
productContext: "For {product}",
|
|
840
840
|
balanceLine: "You have {available} credits, need {required}.",
|
|
841
|
-
paymentRequiredMessage: "You've used all your included
|
|
842
|
-
paymentRequiredMessageRemaining: "Only {remaining}
|
|
843
|
-
paymentRequiredMessageNoBalance: "You've used your included
|
|
841
|
+
paymentRequiredMessage: "You've used all your included {unit}{forProduct}. Choose a plan below to keep going.",
|
|
842
|
+
paymentRequiredMessageRemaining: "Only {remaining} {unit} left{forProduct}. Choose a plan below to keep going.",
|
|
843
|
+
paymentRequiredMessageNoBalance: "You've used your included {unit}{forProduct}. Pick a plan below to keep going.",
|
|
844
844
|
activationRequiredMessage: "You need an active plan{forProduct} to continue. Pick one below.",
|
|
845
845
|
topupRequiredMessage: "You're out of credits{forProduct}. Add more below to keep going.",
|
|
846
846
|
paymentRequiredProductSuffix: " for {product}",
|
|
@@ -7639,7 +7639,7 @@ function deriveUsage(purchase) {
|
|
|
7639
7639
|
if (!purchase) return null;
|
|
7640
7640
|
const snap = purchase.planSnapshot;
|
|
7641
7641
|
const usage = purchase.usage;
|
|
7642
|
-
const meterRef = snap?.meterRef ?? null;
|
|
7642
|
+
const meterRef = snap?.meterRef ?? snap?.meterId ?? null;
|
|
7643
7643
|
const creditsPerUnit = snap?.creditsPerUnit;
|
|
7644
7644
|
const isCreditBased = typeof creditsPerUnit === "number" && creditsPerUnit > 0;
|
|
7645
7645
|
const total = typeof snap?.limit === "number" ? snap.limit : null;
|
|
@@ -7816,7 +7816,7 @@ var Label = (0, import_react42.forwardRef)(function UsageMeterLabel({ className,
|
|
|
7816
7816
|
}
|
|
7817
7817
|
);
|
|
7818
7818
|
}
|
|
7819
|
-
const unit = ctx.usage.meterRef ?? "
|
|
7819
|
+
const unit = ctx.usage.meterRef ?? "requests";
|
|
7820
7820
|
const label = ctx.usage.total !== null ? interpolate(copy.usage.usedLabel, {
|
|
7821
7821
|
used: String(ctx.usage.used),
|
|
7822
7822
|
total: String(ctx.usage.total),
|
|
@@ -10568,15 +10568,21 @@ function resolvePaywallMessage(content, paywallCopy) {
|
|
|
10568
10568
|
const forProduct = productName ? interpolate(paywallCopy.paymentRequiredProductSuffix, { product: productName }) : "";
|
|
10569
10569
|
if (content.kind === "payment_required") {
|
|
10570
10570
|
const balance = content.balance;
|
|
10571
|
+
const unitSingular = "request";
|
|
10572
|
+
const unitPlural = "requests";
|
|
10571
10573
|
if (!balance) {
|
|
10572
|
-
return interpolate(paywallCopy.paymentRequiredMessageNoBalance, {
|
|
10574
|
+
return interpolate(paywallCopy.paymentRequiredMessageNoBalance, {
|
|
10575
|
+
forProduct,
|
|
10576
|
+
unit: unitPlural
|
|
10577
|
+
});
|
|
10573
10578
|
}
|
|
10574
10579
|
const remaining = balance.remainingUnits ?? 0;
|
|
10575
10580
|
if (remaining <= 0) {
|
|
10576
|
-
return interpolate(paywallCopy.paymentRequiredMessage, { forProduct });
|
|
10581
|
+
return interpolate(paywallCopy.paymentRequiredMessage, { forProduct, unit: unitPlural });
|
|
10577
10582
|
}
|
|
10578
10583
|
return interpolate(paywallCopy.paymentRequiredMessageRemaining, {
|
|
10579
10584
|
remaining: String(remaining),
|
|
10585
|
+
unit: remaining === 1 ? unitSingular : unitPlural,
|
|
10580
10586
|
pluralSuffix: remaining === 1 ? "" : "s",
|
|
10581
10587
|
forProduct
|
|
10582
10588
|
});
|
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, 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, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-
|
|
3
|
-
export { D as BootstrapPlanLike, 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 } from './shared-
|
|
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 UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } 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, 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, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-BwfUleA3.cjs';
|
|
3
|
+
export { D as BootstrapPlanLike, 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 } from './shared-BwfUleA3.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-DJ7llYmK.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 UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } from './index-DJ7llYmK.cjs';
|
|
6
6
|
import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
|
|
7
7
|
import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
|
|
8
8
|
export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.cjs';
|
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, 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, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-
|
|
3
|
-
export { D as BootstrapPlanLike, 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 } from './shared-
|
|
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 UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } 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, 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, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-B3YBHDMP.js';
|
|
3
|
+
export { D as BootstrapPlanLike, 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 } from './shared-B3YBHDMP.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-SFxuDtdC.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 UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } from './index-SFxuDtdC.js';
|
|
6
6
|
import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
|
|
7
7
|
import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
|
|
8
8
|
export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.js';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
LaunchCustomerPortalButton,
|
|
8
8
|
UpdatePaymentMethodButton,
|
|
9
9
|
usePaymentMethod
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RKNP7IY4.js";
|
|
11
11
|
import {
|
|
12
12
|
ActivationFlow,
|
|
13
13
|
AutoRecharge,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
useCheckoutSteps,
|
|
24
24
|
useCreditGate,
|
|
25
25
|
usePaywallResolver
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HBD3FI4Q.js";
|
|
27
27
|
import {
|
|
28
28
|
AmountPicker,
|
|
29
29
|
BalanceBadge,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
useTopupAmountSelector,
|
|
96
96
|
useTransport,
|
|
97
97
|
useUsage
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-OGS3UOOB.js";
|
|
99
99
|
import {
|
|
100
100
|
createAnonymousAuthAdapter,
|
|
101
101
|
defaultAuthAdapter,
|
package/dist/mcp/index.cjs
CHANGED
|
@@ -1027,7 +1027,7 @@ var enCopy = {
|
|
|
1027
1027
|
return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
|
|
1028
1028
|
},
|
|
1029
1029
|
usageMetered: (ctx) => {
|
|
1030
|
-
const measures = ctx.plan?.measures ?? "
|
|
1030
|
+
const measures = ctx.plan?.measures ?? "request";
|
|
1031
1031
|
const cycle = ctx.plan?.billingCycle ?? "monthly";
|
|
1032
1032
|
const product = ctx.product?.name ?? "the service";
|
|
1033
1033
|
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)}`;
|
|
@@ -1101,12 +1101,12 @@ var enCopy = {
|
|
|
1101
1101
|
creditEstimateApprox: "~ {credits} credits"
|
|
1102
1102
|
},
|
|
1103
1103
|
autoRecharge: {
|
|
1104
|
-
heading: "Auto
|
|
1105
|
-
description: "Automatically
|
|
1106
|
-
settingsHeading: "Auto
|
|
1104
|
+
heading: "Auto-recharge",
|
|
1105
|
+
description: "Automatically recharge when your balance runs low, so you never run out. You can turn this off anytime.",
|
|
1106
|
+
settingsHeading: "Auto-recharge settings",
|
|
1107
1107
|
setupTriggerLabel: "Set up auto-recharge",
|
|
1108
1108
|
modifyTriggerLabel: "Modify",
|
|
1109
|
-
notConfiguredHint: "
|
|
1109
|
+
notConfiguredHint: "Auto-recharge is off. Set it up if you want credits added when your balance runs low.",
|
|
1110
1110
|
enableLabel: "Enable auto-recharge",
|
|
1111
1111
|
enableQuestion: "Would you like to set up automatic recharge?",
|
|
1112
1112
|
enableSentence: "Yes, automatically recharge my card when my credit balance falls below a threshold",
|
|
@@ -1116,12 +1116,12 @@ var enCopy = {
|
|
|
1116
1116
|
fixedAmountAriaLabel: "Fixed top-up amount",
|
|
1117
1117
|
saveButton: "Save settings",
|
|
1118
1118
|
cancelButton: "Cancel",
|
|
1119
|
-
disableButton: "Disable
|
|
1120
|
-
savedMessage: "
|
|
1121
|
-
disabledMessage: "
|
|
1122
|
-
setupRequiredMessage: "Confirm your card to activate
|
|
1119
|
+
disableButton: "Disable auto-recharge",
|
|
1120
|
+
savedMessage: "Auto-recharge settings saved.",
|
|
1121
|
+
disabledMessage: "Auto-recharge disabled.",
|
|
1122
|
+
setupRequiredMessage: "Confirm your card to activate auto-recharge.",
|
|
1123
1123
|
setupHeading: "Authorize card",
|
|
1124
|
-
setupDescription: "Authorize a card for
|
|
1124
|
+
setupDescription: "Authorize a card for auto-recharge. You will not be charged now.",
|
|
1125
1125
|
setupSubmit: "Save card for auto-recharge",
|
|
1126
1126
|
setupProcessing: "Authorizing...",
|
|
1127
1127
|
setupAwaitingConfirmation: "Card authorized. Finishing activation \u2014 this can take a moment.",
|
|
@@ -1262,9 +1262,9 @@ var enCopy = {
|
|
|
1262
1262
|
resolvedHeading: "You can continue",
|
|
1263
1263
|
productContext: "For {product}",
|
|
1264
1264
|
balanceLine: "You have {available} credits, need {required}.",
|
|
1265
|
-
paymentRequiredMessage: "You've used all your included
|
|
1266
|
-
paymentRequiredMessageRemaining: "Only {remaining}
|
|
1267
|
-
paymentRequiredMessageNoBalance: "You've used your included
|
|
1265
|
+
paymentRequiredMessage: "You've used all your included {unit}{forProduct}. Choose a plan below to keep going.",
|
|
1266
|
+
paymentRequiredMessageRemaining: "Only {remaining} {unit} left{forProduct}. Choose a plan below to keep going.",
|
|
1267
|
+
paymentRequiredMessageNoBalance: "You've used your included {unit}{forProduct}. Pick a plan below to keep going.",
|
|
1268
1268
|
activationRequiredMessage: "You need an active plan{forProduct} to continue. Pick one below.",
|
|
1269
1269
|
topupRequiredMessage: "You're out of credits{forProduct}. Add more below to keep going.",
|
|
1270
1270
|
paymentRequiredProductSuffix: " for {product}",
|
|
@@ -3296,7 +3296,7 @@ function deriveUsage(purchase) {
|
|
|
3296
3296
|
if (!purchase) return null;
|
|
3297
3297
|
const snap = purchase.planSnapshot;
|
|
3298
3298
|
const usage = purchase.usage;
|
|
3299
|
-
const meterRef = snap?.meterRef ?? null;
|
|
3299
|
+
const meterRef = snap?.meterRef ?? snap?.meterId ?? null;
|
|
3300
3300
|
const creditsPerUnit = snap?.creditsPerUnit;
|
|
3301
3301
|
const isCreditBased = typeof creditsPerUnit === "number" && creditsPerUnit > 0;
|
|
3302
3302
|
const total = typeof snap?.limit === "number" ? snap.limit : null;
|
|
@@ -3473,7 +3473,7 @@ var Label = (0, import_react24.forwardRef)(function UsageMeterLabel({ className,
|
|
|
3473
3473
|
}
|
|
3474
3474
|
);
|
|
3475
3475
|
}
|
|
3476
|
-
const unit = ctx.usage.meterRef ?? "
|
|
3476
|
+
const unit = ctx.usage.meterRef ?? "requests";
|
|
3477
3477
|
const label = ctx.usage.total !== null ? interpolate(copy.usage.usedLabel, {
|
|
3478
3478
|
used: String(ctx.usage.used),
|
|
3479
3479
|
total: String(ctx.usage.total),
|
package/dist/mcp/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-
|
|
1
|
+
import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-BwfUleA3.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';
|
|
@@ -32,8 +32,8 @@ import '../adapters/auth.cjs';
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Minimal shape of
|
|
36
|
-
* so consumers don't need `@modelcontextprotocol/
|
|
35
|
+
* Minimal shape of the official SDK's `CallToolResult` — kept here
|
|
36
|
+
* so consumers don't need `@modelcontextprotocol/core` installed just to
|
|
37
37
|
* satisfy TypeScript when they use the adapter.
|
|
38
38
|
*/
|
|
39
39
|
interface CallToolResultLike$1 {
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-
|
|
1
|
+
import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-B3YBHDMP.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';
|
|
@@ -32,8 +32,8 @@ import '../adapters/auth.js';
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Minimal shape of
|
|
36
|
-
* so consumers don't need `@modelcontextprotocol/
|
|
35
|
+
* Minimal shape of the official SDK's `CallToolResult` — kept here
|
|
36
|
+
* so consumers don't need `@modelcontextprotocol/core` installed just to
|
|
37
37
|
* satisfy TypeScript when they use the adapter.
|
|
38
38
|
*/
|
|
39
39
|
interface CallToolResultLike$1 {
|
package/dist/mcp/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ExternalLinkGlyph,
|
|
4
4
|
LaunchCustomerPortalButton,
|
|
5
5
|
paymentMethodCache
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-RKNP7IY4.js";
|
|
7
7
|
import {
|
|
8
8
|
AmountPicker,
|
|
9
9
|
BalanceBadge,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
usePurchaseStatus,
|
|
40
40
|
useTopupAmountSelector,
|
|
41
41
|
useTransport
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-OGS3UOOB.js";
|
|
43
43
|
import "../chunk-UMXOAUW7.js";
|
|
44
44
|
import "../chunk-MLKGABMK.js";
|
|
45
45
|
|
|
@@ -725,7 +725,7 @@ var enCopy = {
|
|
|
725
725
|
return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used. Payments are processed by SolvaPay.${termsSentence(ctx)}`;
|
|
726
726
|
},
|
|
727
727
|
usageMetered: (ctx) => {
|
|
728
|
-
const measures = ctx.plan?.measures ?? "
|
|
728
|
+
const measures = ctx.plan?.measures ?? "request";
|
|
729
729
|
const cycle = ctx.plan?.billingCycle ?? "monthly";
|
|
730
730
|
const product = ctx.product?.name ?? "the service";
|
|
731
731
|
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)}`;
|
|
@@ -799,12 +799,12 @@ var enCopy = {
|
|
|
799
799
|
creditEstimateApprox: "~ {credits} credits"
|
|
800
800
|
},
|
|
801
801
|
autoRecharge: {
|
|
802
|
-
heading: "Auto
|
|
803
|
-
description: "Automatically
|
|
804
|
-
settingsHeading: "Auto
|
|
802
|
+
heading: "Auto-recharge",
|
|
803
|
+
description: "Automatically recharge when your balance runs low, so you never run out. You can turn this off anytime.",
|
|
804
|
+
settingsHeading: "Auto-recharge settings",
|
|
805
805
|
setupTriggerLabel: "Set up auto-recharge",
|
|
806
806
|
modifyTriggerLabel: "Modify",
|
|
807
|
-
notConfiguredHint: "
|
|
807
|
+
notConfiguredHint: "Auto-recharge is off. Set it up if you want credits added when your balance runs low.",
|
|
808
808
|
enableLabel: "Enable auto-recharge",
|
|
809
809
|
enableQuestion: "Would you like to set up automatic recharge?",
|
|
810
810
|
enableSentence: "Yes, automatically recharge my card when my credit balance falls below a threshold",
|
|
@@ -814,12 +814,12 @@ var enCopy = {
|
|
|
814
814
|
fixedAmountAriaLabel: "Fixed top-up amount",
|
|
815
815
|
saveButton: "Save settings",
|
|
816
816
|
cancelButton: "Cancel",
|
|
817
|
-
disableButton: "Disable
|
|
818
|
-
savedMessage: "
|
|
819
|
-
disabledMessage: "
|
|
820
|
-
setupRequiredMessage: "Confirm your card to activate
|
|
817
|
+
disableButton: "Disable auto-recharge",
|
|
818
|
+
savedMessage: "Auto-recharge settings saved.",
|
|
819
|
+
disabledMessage: "Auto-recharge disabled.",
|
|
820
|
+
setupRequiredMessage: "Confirm your card to activate auto-recharge.",
|
|
821
821
|
setupHeading: "Authorize card",
|
|
822
|
-
setupDescription: "Authorize a card for
|
|
822
|
+
setupDescription: "Authorize a card for auto-recharge. You will not be charged now.",
|
|
823
823
|
setupSubmit: "Save card for auto-recharge",
|
|
824
824
|
setupProcessing: "Authorizing...",
|
|
825
825
|
setupAwaitingConfirmation: "Card authorized. Finishing activation \u2014 this can take a moment.",
|
|
@@ -960,9 +960,9 @@ var enCopy = {
|
|
|
960
960
|
resolvedHeading: "You can continue",
|
|
961
961
|
productContext: "For {product}",
|
|
962
962
|
balanceLine: "You have {available} credits, need {required}.",
|
|
963
|
-
paymentRequiredMessage: "You've used all your included
|
|
964
|
-
paymentRequiredMessageRemaining: "Only {remaining}
|
|
965
|
-
paymentRequiredMessageNoBalance: "You've used your included
|
|
963
|
+
paymentRequiredMessage: "You've used all your included {unit}{forProduct}. Choose a plan below to keep going.",
|
|
964
|
+
paymentRequiredMessageRemaining: "Only {remaining} {unit} left{forProduct}. Choose a plan below to keep going.",
|
|
965
|
+
paymentRequiredMessageNoBalance: "You've used your included {unit}{forProduct}. Pick a plan below to keep going.",
|
|
966
966
|
activationRequiredMessage: "You need an active plan{forProduct} to continue. Pick one below.",
|
|
967
967
|
topupRequiredMessage: "You're out of credits{forProduct}. Add more below to keep going.",
|
|
968
968
|
paymentRequiredProductSuffix: " for {product}",
|
|
@@ -8909,15 +8909,21 @@ function resolvePaywallMessage(content, paywallCopy) {
|
|
|
8909
8909
|
const forProduct = productName ? interpolate(paywallCopy.paymentRequiredProductSuffix, { product: productName }) : "";
|
|
8910
8910
|
if (content.kind === "payment_required") {
|
|
8911
8911
|
const balance = content.balance;
|
|
8912
|
+
const unitSingular = "request";
|
|
8913
|
+
const unitPlural = "requests";
|
|
8912
8914
|
if (!balance) {
|
|
8913
|
-
return interpolate(paywallCopy.paymentRequiredMessageNoBalance, {
|
|
8915
|
+
return interpolate(paywallCopy.paymentRequiredMessageNoBalance, {
|
|
8916
|
+
forProduct,
|
|
8917
|
+
unit: unitPlural
|
|
8918
|
+
});
|
|
8914
8919
|
}
|
|
8915
8920
|
const remaining = balance.remainingUnits ?? 0;
|
|
8916
8921
|
if (remaining <= 0) {
|
|
8917
|
-
return interpolate(paywallCopy.paymentRequiredMessage, { forProduct });
|
|
8922
|
+
return interpolate(paywallCopy.paymentRequiredMessage, { forProduct, unit: unitPlural });
|
|
8918
8923
|
}
|
|
8919
8924
|
return interpolate(paywallCopy.paymentRequiredMessageRemaining, {
|
|
8920
8925
|
remaining: String(remaining),
|
|
8926
|
+
unit: remaining === 1 ? unitSingular : unitPlural,
|
|
8921
8927
|
pluralSuffix: remaining === 1 ? "" : "s",
|
|
8922
8928
|
forProduct
|
|
8923
8929
|
});
|
|
@@ -9101,7 +9107,7 @@ function deriveUsage(purchase) {
|
|
|
9101
9107
|
if (!purchase) return null;
|
|
9102
9108
|
const snap = purchase.planSnapshot;
|
|
9103
9109
|
const usage = purchase.usage;
|
|
9104
|
-
const meterRef = snap?.meterRef ?? null;
|
|
9110
|
+
const meterRef = snap?.meterRef ?? snap?.meterId ?? null;
|
|
9105
9111
|
const creditsPerUnit = snap?.creditsPerUnit;
|
|
9106
9112
|
const isCreditBased = typeof creditsPerUnit === "number" && creditsPerUnit > 0;
|
|
9107
9113
|
const total = typeof snap?.limit === "number" ? snap.limit : null;
|
|
@@ -9278,7 +9284,7 @@ var Label = (0, import_react42.forwardRef)(function UsageMeterLabel({ className,
|
|
|
9278
9284
|
}
|
|
9279
9285
|
);
|
|
9280
9286
|
}
|
|
9281
|
-
const unit = ctx.usage.meterRef ?? "
|
|
9287
|
+
const unit = ctx.usage.meterRef ?? "requests";
|
|
9282
9288
|
const label = ctx.usage.total !== null ? interpolate(copy.usage.usedLabel, {
|
|
9283
9289
|
used: String(ctx.usage.used),
|
|
9284
9290
|
total: String(ctx.usage.total),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { Ref } from 'react';
|
|
3
|
-
import { b as Plan, y as Product, r as UseTopupAmountSelectorReturn, x as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, t as AutoRechargeConfig } from '../shared-
|
|
4
|
-
export { D as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../shared-
|
|
3
|
+
import { b as Plan, y as Product, r as UseTopupAmountSelectorReturn, x as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, t as AutoRechargeConfig } from '../shared-BwfUleA3.cjs';
|
|
4
|
+
export { D as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../shared-BwfUleA3.cjs';
|
|
5
5
|
import { TaxBreakdown, BusinessDetailsInput } from '@solvapay/core';
|
|
6
|
-
import { A as AutoRechargeInputPayload, I as AmountInputUnit, J as AutoRechargeFormState, l as PaywallStructuredContent, U as UsageSnapshot } from '../index-
|
|
7
|
-
export { K as ActivationFlow, L as ActivationFlowActivateButton, N as ActivationFlowActivated, O as ActivationFlowAmountPicker, Q as ActivationFlowContinueButton, R as ActivationFlowError, S as ActivationFlowLoading, T as ActivationFlowRetrying, V as ActivationFlowRoot, m as ActivationFlowStep, W as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, X as CheckoutStepsAmountContinueButton, Y as CheckoutStepsAmountPicker, Z as CheckoutStepsBackLink, _ as CheckoutStepsIfStep, $ as CheckoutStepsPayment, a0 as CheckoutStepsPlanContinueButton, a1 as CheckoutStepsPlanGrid, a2 as CheckoutStepsRoot, a3 as CheckoutStepsStepHeading, a4 as CheckoutStepsStepMessage, a5 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a6 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, a7 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a8 as PurchaseGateAllowed, a9 as PurchaseGateBlocked, aa as PurchaseGateError, ab as PurchaseGateLoading, ac as PurchaseGateRoot, ad as useActivationFlow, G as useCheckoutStepsContext, ae as usePurchaseGate } from '../index-
|
|
6
|
+
import { A as AutoRechargeInputPayload, I as AmountInputUnit, J as AutoRechargeFormState, l as PaywallStructuredContent, U as UsageSnapshot } from '../index-DJ7llYmK.cjs';
|
|
7
|
+
export { K as ActivationFlow, L as ActivationFlowActivateButton, N as ActivationFlowActivated, O as ActivationFlowAmountPicker, Q as ActivationFlowContinueButton, R as ActivationFlowError, S as ActivationFlowLoading, T as ActivationFlowRetrying, V as ActivationFlowRoot, m as ActivationFlowStep, W as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, X as CheckoutStepsAmountContinueButton, Y as CheckoutStepsAmountPicker, Z as CheckoutStepsBackLink, _ as CheckoutStepsIfStep, $ as CheckoutStepsPayment, a0 as CheckoutStepsPlanContinueButton, a1 as CheckoutStepsPlanGrid, a2 as CheckoutStepsRoot, a3 as CheckoutStepsStepHeading, a4 as CheckoutStepsStepMessage, a5 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a6 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, a7 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a8 as PurchaseGateAllowed, a9 as PurchaseGateBlocked, aa as PurchaseGateError, ab as PurchaseGateLoading, ac as PurchaseGateRoot, ad as useActivationFlow, G as useCheckoutStepsContext, ae as usePurchaseGate } from '../index-DJ7llYmK.cjs';
|
|
8
8
|
import { PaymentElement } from '@stripe/react-stripe-js';
|
|
9
9
|
import { Stripe, StripeElements } from '@stripe/stripe-js';
|
|
10
10
|
import '../adapters/auth.cjs';
|
|
@@ -907,7 +907,7 @@ declare function useAutoRechargeForm(): AutoRechargeContextValue;
|
|
|
907
907
|
* Renders a `Terms · Privacy · Provided by SolvaPay` strip pointing at
|
|
908
908
|
* SolvaPay's own legal pages. Mirrors the hosted-checkout
|
|
909
909
|
* `<LegalFooter>` (`solvapay-frontend/src/components/shared/LegalFooter.tsx`)
|
|
910
|
-
* but
|
|
910
|
+
* but dependency-free so it can ship inside `<PaymentForm>` / `<TopupForm>`
|
|
911
911
|
* default trees and the MCP shell footer.
|
|
912
912
|
*
|
|
913
913
|
* Merchant terms/privacy URLs are *not* rendered here — those continue
|