@solvapay/react 2.3.0 → 2.3.1-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @solvapay/react changelog
2
2
 
3
+ ## 2.3.1-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7
4
+
5
+ ### Patch Changes
6
+
7
+ - 389cffa: MCP hosted-checkout fallback now matches Add credits: a Change plan / Change amount back link, copy that the host blocked embedded payments, `Open SolvaPay checkout` as the CTA, and a single card instead of a nested one.
8
+ - Updated dependencies [af077fe]
9
+ - @solvapay/mcp-core@0.4.4-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7
10
+
3
11
  ## 2.3.0
4
12
 
5
13
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as UsageSnapshot } from './useUsage-DNXxsmyG.cjs';
2
+ import { _ as UsageSnapshot } from './useUsage-8NCXS45R.cjs';
3
3
 
4
4
  /**
5
5
  * `<UsageMeter>` compound primitive — renders the authenticated customer's
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as UsageSnapshot } from './useUsage-CwvxnICf.js';
2
+ import { _ as UsageSnapshot } from './useUsage-C5_XnS_6.js';
3
3
 
4
4
  /**
5
5
  * `<UsageMeter>` compound primitive — renders the authenticated customer's
@@ -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-CwvxnICf.js';
1
+ import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-C5_XnS_6.js';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import { TaxBreakdown } from '@solvapay/core';
@@ -59,9 +59,9 @@ type PaywallGateRecoveryFields = {
59
59
  creditBalance?: number;
60
60
  /**
61
61
  * `PaywallState.kind` — same vocabulary as the classifier, not a third enum.
62
- * `upgrade_required` / `limit_reached` / `reactivation_required` are
63
- * SDK-only; the backend's `paywallReason` is a smaller set
64
- * (`activation_required` / `topup_required` / `payment_required`).
62
+ * `upgrade_required` / `reactivation_required` are SDK-only. The
63
+ * backend's `paywallReason` covers `activation_required` /
64
+ * `topup_required` / `payment_required` / `limit_reached`.
65
65
  */
66
66
  reason?: PaywallReason;
67
67
  /** Single primary recovery the agent should take. */
@@ -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-DNXxsmyG.cjs';
1
+ import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-8NCXS45R.cjs';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import { TaxBreakdown } from '@solvapay/core';
@@ -59,9 +59,9 @@ type PaywallGateRecoveryFields = {
59
59
  creditBalance?: number;
60
60
  /**
61
61
  * `PaywallState.kind` — same vocabulary as the classifier, not a third enum.
62
- * `upgrade_required` / `limit_reached` / `reactivation_required` are
63
- * SDK-only; the backend's `paywallReason` is a smaller set
64
- * (`activation_required` / `topup_required` / `payment_required`).
62
+ * `upgrade_required` / `reactivation_required` are SDK-only. The
63
+ * backend's `paywallReason` covers `activation_required` /
64
+ * `topup_required` / `payment_required` / `limit_reached`.
65
65
  */
66
66
  reason?: PaywallReason;
67
67
  /** Single primary recovery the agent should take. */
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-DNXxsmyG.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-DNXxsmyG.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-BadShw3R.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-BadShw3R.cjs';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-8NCXS45R.cjs';
3
+ export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-8NCXS45R.cjs';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-fuaNfBE5.cjs';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-fuaNfBE5.cjs';
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';
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-CwvxnICf.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-CwvxnICf.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-DN66D54Q.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-DN66D54Q.js';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-C5_XnS_6.js';
3
+ export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-C5_XnS_6.js';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-CxGoNto4.js';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-CxGoNto4.js';
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';
@@ -11353,17 +11353,20 @@ var UpgradeBody = import_react51.default.memo(function UpgradeBody2({
11353
11353
  planName,
11354
11354
  checkout,
11355
11355
  onLaunch,
11356
+ onBack,
11357
+ backLabel,
11356
11358
  cx: cx2
11357
11359
  }) {
11358
11360
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
11361
+ onBack ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BackLink, { label: backLabel, onClick: onBack }) : null,
11359
11362
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { className: cx2.heading, children: planName ? `Complete your ${planName} purchase` : "Upgrade your plan" }),
11360
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cx2.muted, children: "The SolvaPay checkout opens in a new tab. Return here after payment and your purchase will show up automatically." }),
11363
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cx2.muted, children: "This host doesn't allow embedded payments. Open the SolvaPay checkout in a new tab to complete your purchase there. Return here after payment and your purchase will show up automatically." }),
11361
11364
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
11362
11365
  HostedLinkButton,
11363
11366
  {
11364
11367
  state: checkout,
11365
11368
  loadingLabel: "Loading checkout\u2026",
11366
- readyLabel: "Upgrade",
11369
+ readyLabel: "Open SolvaPay checkout",
11367
11370
  onLaunch,
11368
11371
  cx: cx2
11369
11372
  }
@@ -11376,6 +11379,8 @@ function HostedCheckout({
11376
11379
  planRef,
11377
11380
  planName,
11378
11381
  onPurchaseSuccess,
11382
+ onBack,
11383
+ backLabel = "Change plan",
11379
11384
  cx: cx2,
11380
11385
  children
11381
11386
  }) {
@@ -11499,7 +11504,17 @@ function HostedCheckout({
11499
11504
  }
11500
11505
  );
11501
11506
  }
11502
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(UpgradeBody, { planName, checkout, onLaunch: beginAwaiting, cx: cx2 });
11507
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
11508
+ UpgradeBody,
11509
+ {
11510
+ planName,
11511
+ checkout,
11512
+ onLaunch: beginAwaiting,
11513
+ onBack,
11514
+ backLabel,
11515
+ cx: cx2
11516
+ }
11517
+ );
11503
11518
  }, [
11504
11519
  awaiting,
11505
11520
  awaitingHref,
@@ -11514,12 +11529,14 @@ function HostedCheckout({
11514
11529
  checkout,
11515
11530
  beginAwaiting,
11516
11531
  planName,
11532
+ onBack,
11533
+ backLabel,
11517
11534
  cx2
11518
11535
  ]);
11519
11536
  if (loading) {
11520
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cx2.card, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "Loading purchase\u2026" }) });
11537
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "Loading purchase\u2026" });
11521
11538
  }
11522
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cx2.card, "data-refreshing": isRefetching ? "true" : void 0, children: [
11539
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { "data-refreshing": isRefetching ? "true" : void 0, children: [
11523
11540
  inner,
11524
11541
  children
11525
11542
  ] });
@@ -11713,6 +11730,7 @@ function McpCheckoutBody({
11713
11730
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "Loading checkout\u2026" });
11714
11731
  }
11715
11732
  if (stripeProbe === "blocked") {
11733
+ const hostedBackLabel = flow.branch === "payg" ? "Change amount" : "Change plan";
11716
11734
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11717
11735
  HostedCheckout,
11718
11736
  {
@@ -11720,6 +11738,8 @@ function McpCheckoutBody({
11720
11738
  planRef: flow.selectedPlanRef ?? void 0,
11721
11739
  planName: selectedPlanShape?.name ?? void 0,
11722
11740
  onPurchaseSuccess,
11741
+ onBack: () => flow.back(),
11742
+ backLabel: hostedBackLabel,
11723
11743
  cx: cx2
11724
11744
  }
11725
11745
  );
@@ -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-DNXxsmyG.cjs';
1
+ import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-8NCXS45R.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-zKMPnwCx.cjs';
7
+ import { U as UsageMeterRootProps } from '../UsageMeter-DWkwHgTP.cjs';
8
8
  import '@stripe/stripe-js';
9
9
  import '../adapters/auth.cjs';
10
10
 
@@ -1,10 +1,10 @@
1
- import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-CwvxnICf.js';
1
+ import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-C5_XnS_6.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-DZxLZt4A.js';
7
+ import { U as UsageMeterRootProps } from '../UsageMeter-DosUKnwg.js';
8
8
  import '@stripe/stripe-js';
9
9
  import '../adapters/auth.js';
10
10
 
package/dist/mcp/index.js CHANGED
@@ -3657,17 +3657,20 @@ var UpgradeBody = React10.memo(function UpgradeBody2({
3657
3657
  planName,
3658
3658
  checkout,
3659
3659
  onLaunch,
3660
+ onBack,
3661
+ backLabel,
3660
3662
  cx: cx2
3661
3663
  }) {
3662
3664
  return /* @__PURE__ */ jsxs18(Fragment11, { children: [
3665
+ onBack ? /* @__PURE__ */ jsx25(BackLink, { label: backLabel, onClick: onBack }) : null,
3663
3666
  /* @__PURE__ */ jsx25("h2", { className: cx2.heading, children: planName ? `Complete your ${planName} purchase` : "Upgrade your plan" }),
3664
- /* @__PURE__ */ jsx25("p", { className: cx2.muted, children: "The SolvaPay checkout opens in a new tab. Return here after payment and your purchase will show up automatically." }),
3667
+ /* @__PURE__ */ jsx25("p", { className: cx2.muted, children: "This host doesn't allow embedded payments. Open the SolvaPay checkout in a new tab to complete your purchase there. Return here after payment and your purchase will show up automatically." }),
3665
3668
  /* @__PURE__ */ jsx25(
3666
3669
  HostedLinkButton,
3667
3670
  {
3668
3671
  state: checkout,
3669
3672
  loadingLabel: "Loading checkout\u2026",
3670
- readyLabel: "Upgrade",
3673
+ readyLabel: "Open SolvaPay checkout",
3671
3674
  onLaunch,
3672
3675
  cx: cx2
3673
3676
  }
@@ -3680,6 +3683,8 @@ function HostedCheckout({
3680
3683
  planRef,
3681
3684
  planName,
3682
3685
  onPurchaseSuccess,
3686
+ onBack,
3687
+ backLabel = "Change plan",
3683
3688
  cx: cx2,
3684
3689
  children
3685
3690
  }) {
@@ -3803,7 +3808,17 @@ function HostedCheckout({
3803
3808
  }
3804
3809
  );
3805
3810
  }
3806
- return /* @__PURE__ */ jsx25(UpgradeBody, { planName, checkout, onLaunch: beginAwaiting, cx: cx2 });
3811
+ return /* @__PURE__ */ jsx25(
3812
+ UpgradeBody,
3813
+ {
3814
+ planName,
3815
+ checkout,
3816
+ onLaunch: beginAwaiting,
3817
+ onBack,
3818
+ backLabel,
3819
+ cx: cx2
3820
+ }
3821
+ );
3807
3822
  }, [
3808
3823
  awaiting,
3809
3824
  awaitingHref,
@@ -3818,12 +3833,14 @@ function HostedCheckout({
3818
3833
  checkout,
3819
3834
  beginAwaiting,
3820
3835
  planName,
3836
+ onBack,
3837
+ backLabel,
3821
3838
  cx2
3822
3839
  ]);
3823
3840
  if (loading) {
3824
- return /* @__PURE__ */ jsx25("div", { className: cx2.card, children: /* @__PURE__ */ jsx25("p", { children: "Loading purchase\u2026" }) });
3841
+ return /* @__PURE__ */ jsx25("p", { children: "Loading purchase\u2026" });
3825
3842
  }
3826
- return /* @__PURE__ */ jsxs18("div", { className: cx2.card, "data-refreshing": isRefetching ? "true" : void 0, children: [
3843
+ return /* @__PURE__ */ jsxs18("div", { "data-refreshing": isRefetching ? "true" : void 0, children: [
3827
3844
  inner,
3828
3845
  children
3829
3846
  ] });
@@ -4017,6 +4034,7 @@ function McpCheckoutBody({
4017
4034
  return /* @__PURE__ */ jsx26("p", { children: "Loading checkout\u2026" });
4018
4035
  }
4019
4036
  if (stripeProbe === "blocked") {
4037
+ const hostedBackLabel = flow.branch === "payg" ? "Change amount" : "Change plan";
4020
4038
  return /* @__PURE__ */ jsx26(
4021
4039
  HostedCheckout,
4022
4040
  {
@@ -4024,6 +4042,8 @@ function McpCheckoutBody({
4024
4042
  planRef: flow.selectedPlanRef ?? void 0,
4025
4043
  planName: selectedPlanShape?.name ?? void 0,
4026
4044
  onPurchaseSuccess,
4045
+ onBack: () => flow.back(),
4046
+ backLabel: hostedBackLabel,
4027
4047
  cx: cx2
4028
4048
  }
4029
4049
  );
@@ -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-DNXxsmyG.cjs';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-DNXxsmyG.cjs';
3
+ import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-8NCXS45R.cjs';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-8NCXS45R.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-BadShw3R.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-BadShw3R.cjs';
6
+ import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-fuaNfBE5.cjs';
7
+ export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-fuaNfBE5.cjs';
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-zKMPnwCx.cjs';
10
+ export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-DWkwHgTP.cjs';
11
11
  import '../adapters/auth.cjs';
12
12
 
13
13
  type PlanPricingOption = {
@@ -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-CwvxnICf.js';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-CwvxnICf.js';
3
+ import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-C5_XnS_6.js';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-C5_XnS_6.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-DN66D54Q.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-DN66D54Q.js';
6
+ import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-CxGoNto4.js';
7
+ export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-CxGoNto4.js';
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-DZxLZt4A.js';
10
+ export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-DosUKnwg.js';
11
11
  import '../adapters/auth.js';
12
12
 
13
13
  type PlanPricingOption = {
@@ -257,6 +257,15 @@ interface components {
257
257
  };
258
258
  CheckLimitRequest: {
259
259
  customerRef: string;
260
+ /** @description SDK-only free-tool allowance. Authenticated by the provider secret key, so `cap` is the provider's own declaration, not customer input. */
261
+ freeAllowance?: {
262
+ cap?: number;
263
+ /** @description Free meter name. Must match `/^free-[a-z0-9-]+$/`. */
264
+ meter?: string;
265
+ /** @enum {string} */
266
+ scope?: 'rolling_window' | 'lifetime';
267
+ windowDays?: number;
268
+ };
260
269
  includeCheckoutSession?: boolean;
261
270
  meterName?: string;
262
271
  productRef: string;
@@ -912,7 +921,7 @@ interface components {
912
921
  * Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
913
922
  * @enum {string}
914
923
  */
915
- paywallReason?: 'activation_required' | 'topup_required' | 'payment_required';
924
+ paywallReason?: 'activation_required' | 'topup_required' | 'payment_required' | 'limit_reached';
916
925
  /** @description Display name of the active or default plan */
917
926
  planName?: string;
918
927
  /** @description Active plan reference when the customer already holds a purchase */
@@ -257,6 +257,15 @@ interface components {
257
257
  };
258
258
  CheckLimitRequest: {
259
259
  customerRef: string;
260
+ /** @description SDK-only free-tool allowance. Authenticated by the provider secret key, so `cap` is the provider's own declaration, not customer input. */
261
+ freeAllowance?: {
262
+ cap?: number;
263
+ /** @description Free meter name. Must match `/^free-[a-z0-9-]+$/`. */
264
+ meter?: string;
265
+ /** @enum {string} */
266
+ scope?: 'rolling_window' | 'lifetime';
267
+ windowDays?: number;
268
+ };
260
269
  includeCheckoutSession?: boolean;
261
270
  meterName?: string;
262
271
  productRef: string;
@@ -912,7 +921,7 @@ interface components {
912
921
  * Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
913
922
  * @enum {string}
914
923
  */
915
- paywallReason?: 'activation_required' | 'topup_required' | 'payment_required';
924
+ paywallReason?: 'activation_required' | 'topup_required' | 'payment_required' | 'limit_reached';
916
925
  /** @description Display name of the active or default plan */
917
926
  planName?: string;
918
927
  /** @description Active plan reference when the customer already holds a purchase */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -57,7 +57,7 @@
57
57
  "directory": "packages/react"
58
58
  },
59
59
  "peerDependencies": {
60
- "@solvapay/mcp-core": "^0.2.8 || ^0.3.0 || ^0.4.0",
60
+ "@solvapay/mcp-core": "0.4.4-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7",
61
61
  "react": "^18.2.0 || ^19.0.0",
62
62
  "react-dom": "^18.2.0 || ^19.0.0"
63
63
  },
@@ -85,8 +85,8 @@
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.3",
89
- "@solvapay/server": "2.7.0",
88
+ "@solvapay/mcp-core": "0.4.4-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7",
89
+ "@solvapay/server": "2.8.0-preview-fac876555de66d02a17ebc2c433d1f2d5250ede7",
90
90
  "@solvapay/test-utils": "0.0.0"
91
91
  },
92
92
  "scripts": {