@solvapay/react 2.2.2 → 2.3.0-preview-e77af6c08d8a185342e1a74903c8545b94a9f51d

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.
@@ -742,7 +742,8 @@ var enCopy = {
742
742
  },
743
743
  topup: (ctx) => {
744
744
  const product = ctx.product?.name ? ` to add credits to your ${ctx.product.name} balance` : " to add credits to your balance";
745
- 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)}`;
745
+ const savedCard = ctx.savesPaymentMethod ? ` You also authorize ${ctx.merchant.legalName} to save this card and charge it for future auto-recharges, which you can turn off any time.` : "";
746
+ return `By confirming, you authorize ${ctx.merchant.legalName} to charge ${ctx.amountFormatted}${product}. Credits are non-refundable once used.${savedCard} Payments are processed by SolvaPay.${termsSentence(ctx)}`;
746
747
  },
747
748
  usageMetered: (ctx) => {
748
749
  const measures = ctx.plan?.measures ?? "request";
@@ -981,8 +982,10 @@ var enCopy = {
981
982
  addFunds: "Add funds",
982
983
  autoRechargeOn: "Auto-recharge on",
983
984
  autoRechargeOff: "Auto-recharge off",
984
- turnOn: "Turn on \u2192",
985
- manage: "Manage \u2192",
985
+ autoRechargePending: "Auto-recharge starts once this payment clears",
986
+ turnOn: "Turn on",
987
+ manage: "Manage",
988
+ fixCard: "Fix card",
986
989
  autoRechargeOffCaption: "Calls fail the moment the balance runs out.",
987
990
  autoRechargeOffFixCaption: "Turning it on stops this happening again.",
988
991
  callsFailingCaption: "The plan is active, but calls fail until you add credits.",
@@ -3365,6 +3368,7 @@ var MandateText = (0, import_react19.forwardRef)(
3365
3368
  mode,
3366
3369
  amountMinor,
3367
3370
  currency,
3371
+ savesPaymentMethod,
3368
3372
  asChild,
3369
3373
  children,
3370
3374
  ...rest
@@ -3406,9 +3410,10 @@ var MandateText = (0, import_react19.forwardRef)(
3406
3410
  } : void 0,
3407
3411
  product: product ? { name: product.name } : void 0,
3408
3412
  amountFormatted,
3409
- trialDays: plan?.trialDays
3413
+ trialDays: plan?.trialDays,
3414
+ savesPaymentMethod
3410
3415
  }),
3411
- [merchant, plan, product, amountFormatted]
3416
+ [merchant, plan, product, amountFormatted, savesPaymentMethod]
3412
3417
  );
3413
3418
  const template = copy.mandate[resolvedVariant];
3414
3419
  const text = typeof template === "function" ? template(ctx) : template;
@@ -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-CRd_E6J3.cjs';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-CRd_E6J3.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-DNXxsmyG.cjs';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-DNXxsmyG.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-B5QUesJE.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-B5QUesJE.cjs';
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';
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-BiujMmVR.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-zKMPnwCx.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-DSPWQ37m.js';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-DSPWQ37m.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-CwvxnICf.js';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-CwvxnICf.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-BAYpUp5R.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-BAYpUp5R.js';
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';
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-BZWfC5KX.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';
11
11
  import '../adapters/auth.js';
12
12
 
13
13
  type PlanPricingOption = {
@@ -89,7 +89,7 @@ import {
89
89
  useCreditGate,
90
90
  usePaywallNotice,
91
91
  usePurchaseGate
92
- } from "../chunk-KUH3SNWZ.js";
92
+ } from "../chunk-LXG7QDM3.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-GPP4MY3I.js";
178
+ } from "../chunk-JXH36VLL.js";
179
179
  import "../chunk-UMXOAUW7.js";
180
180
  import "../chunk-MLKGABMK.js";
181
181
  export {
@@ -829,15 +829,15 @@ interface components {
829
829
  LimitBalanceDto: {
830
830
  /** @description Credit balance in credits (100 credits = 1 minor currency unit) */
831
831
  creditBalance: number;
832
+ /** @description Credits per minor unit of `currency` (typically 100) */
833
+ creditsPerMinorUnit?: number;
832
834
  /** @description Credits deducted per metered item (wallet coverage: remainingUnits = balance / creditsPerUnit) */
833
835
  creditsPerUnit: number;
834
836
  currency: string;
835
- /** @description How many metered items the credit balance still covers (`balance / creditsPerUnit`) */
836
- remainingUnits?: number;
837
- /** @description Credits per minor unit of `currency` (typically 100) */
838
- creditsPerMinorUnit?: number;
839
837
  /** @description USD → display-currency rate used with creditsPerMinorUnit */
840
838
  displayExchangeRate?: number;
839
+ /** @description How many metered items the credit balance still covers (`balance / creditsPerUnit`) */
840
+ remainingUnits?: number;
841
841
  };
842
842
  LimitPlanItemDto: {
843
843
  /** @description Derived billing cycle */
@@ -1208,17 +1208,17 @@ interface components {
1208
1208
  };
1209
1209
  ProcessPaymentCancelled: {
1210
1210
  /**
1211
- * discriminator enum property added by openapi-typescript
1211
+ * @example cancelled
1212
1212
  * @enum {string}
1213
1213
  */
1214
- status: 'ProcessPaymentCancelled';
1214
+ status: 'cancelled';
1215
1215
  };
1216
1216
  ProcessPaymentFailed: {
1217
1217
  /**
1218
- * discriminator enum property added by openapi-typescript
1218
+ * @example failed
1219
1219
  * @enum {string}
1220
1220
  */
1221
- status: 'ProcessPaymentFailed';
1221
+ status: 'failed';
1222
1222
  };
1223
1223
  ProcessPaymentIntentDto: {
1224
1224
  customerRef: string;
@@ -1227,25 +1227,25 @@ interface components {
1227
1227
  };
1228
1228
  ProcessPaymentProcessing: {
1229
1229
  /**
1230
- * discriminator enum property added by openapi-typescript
1230
+ * @example processing
1231
1231
  * @enum {string}
1232
1232
  */
1233
- status: 'ProcessPaymentProcessing';
1233
+ status: 'processing';
1234
1234
  };
1235
1235
  ProcessPaymentSucceededBare: {
1236
1236
  /**
1237
- * discriminator enum property added by openapi-typescript
1237
+ * @example succeeded
1238
1238
  * @enum {string}
1239
1239
  */
1240
- status: 'ProcessPaymentSucceededBare';
1240
+ status: 'succeeded';
1241
1241
  };
1242
1242
  ProcessPaymentSucceededOneTime: {
1243
1243
  oneTimePurchase: components['schemas']['OneTimePurchaseInfo'];
1244
1244
  /**
1245
- * discriminator enum property added by openapi-typescript
1245
+ * @example succeeded
1246
1246
  * @enum {string}
1247
1247
  */
1248
- status: 'ProcessPaymentSucceededOneTime';
1248
+ status: 'succeeded';
1249
1249
  /**
1250
1250
  * @example one-time
1251
1251
  * @enum {string}
@@ -1255,10 +1255,10 @@ interface components {
1255
1255
  ProcessPaymentSucceededRecurring: {
1256
1256
  purchase: components['schemas']['SdkPurchaseResponse'];
1257
1257
  /**
1258
- * discriminator enum property added by openapi-typescript
1258
+ * @example succeeded
1259
1259
  * @enum {string}
1260
1260
  */
1261
- status: 'ProcessPaymentSucceededRecurring';
1261
+ status: 'succeeded';
1262
1262
  /**
1263
1263
  * @example recurring
1264
1264
  * @enum {string}
@@ -1269,10 +1269,10 @@ interface components {
1269
1269
  /** @description Detail message describing the timeout */
1270
1270
  message?: string;
1271
1271
  /**
1272
- * discriminator enum property added by openapi-typescript
1272
+ * @example timeout
1273
1273
  * @enum {string}
1274
1274
  */
1275
- status: 'ProcessPaymentTimeout';
1275
+ status: 'timeout';
1276
1276
  };
1277
1277
  ProductConfigDto: {
1278
1278
  /**
@@ -3214,10 +3214,10 @@ interface operations {
3214
3214
  content: {
3215
3215
  'application/json': {
3216
3216
  /**
3217
- * Outcome of the delete: hard delete in sandbox, soft-delete or deactivation in live depending on existing purchases
3217
+ * Outcome of the delete: deactivation when purchases exist, otherwise soft-delete. Same in sandbox and live.
3218
3218
  * @enum {string}
3219
3219
  */
3220
- action?: 'deleted' | 'deactivated' | 'soft_deleted';
3220
+ action?: 'deactivated' | 'soft_deleted';
3221
3221
  success?: boolean;
3222
3222
  };
3223
3223
  };
@@ -3884,42 +3884,23 @@ type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3884
3884
  /** @deprecated Never populated by the backend. Read `planRef` instead. */
3885
3885
  plan?: string;
3886
3886
  };
3887
- type OneTimePurchaseInfo = components['schemas']['OneTimePurchaseInfo'];
3888
3887
  /**
3889
3888
  * Result from processing a payment intent.
3890
3889
  *
3891
- * Mirrors the backend's discriminated `oneOf` response. The `succeeded`
3892
- * branches are further discriminated on `type` so consumers can route to
3893
- * recurring vs one-time purchase handling without guarding against
3894
- * `purchase === undefined`. A bare `{ status: 'succeeded' }` is returned
3895
- * when the webhook race means the backend can't yet enrich the response
3896
- * with the created purchase — callers should fall back to refetching.
3890
+ * Derived from the generated `/v1/sdk/payment-intents/{id}/process` 200
3891
+ * response. The `succeeded` branches further discriminate on `type` so
3892
+ * consumers can route to recurring vs one-time handling without guarding
3893
+ * against `purchase === undefined`. A bare `{ status: 'succeeded' }` is
3894
+ * returned when the webhook race means the backend can't yet enrich the
3895
+ * response with the created purchase — callers should fall back to
3896
+ * refetching.
3897
3897
  *
3898
- * `failed` and `cancelled` are returned by the backend when the Stripe
3899
- * PaymentIntent is in a terminal non-success state and are routed to
3900
- * `onError` by `reconcilePayment`. `timeout` carries a retry hint and is
3901
- * routed to the timeout branch.
3898
+ * `failed` and `cancelled` are returned when the Stripe PaymentIntent is
3899
+ * in a terminal non-success state and are routed to `onError` by
3900
+ * `reconcilePayment`. `timeout` carries a retry hint and is routed to
3901
+ * the timeout branch.
3902
3902
  */
3903
- type ProcessPaymentResult = {
3904
- status: 'succeeded';
3905
- type: 'recurring';
3906
- purchase: PurchaseInfo;
3907
- } | {
3908
- status: 'succeeded';
3909
- type: 'one-time';
3910
- oneTimePurchase: OneTimePurchaseInfo;
3911
- } | {
3912
- status: 'succeeded';
3913
- } | {
3914
- status: 'processing';
3915
- } | {
3916
- status: 'timeout';
3917
- message?: string;
3918
- } | {
3919
- status: 'failed';
3920
- } | {
3921
- status: 'cancelled';
3922
- };
3903
+ type ProcessPaymentResult = operations['PaymentIntentSdkController_processPaymentIntent']['responses']['200']['content']['application/json'];
3923
3904
  /**
3924
3905
  * Result from processing a credit-topup payment intent.
3925
3906
  *
@@ -4069,6 +4050,12 @@ type MandateContext = {
4069
4050
  };
4070
4051
  amountFormatted: string;
4071
4052
  trialDays?: number;
4053
+ /**
4054
+ * True when the confirm also stores the card for later off-session
4055
+ * charges (auto-recharge). The mandate has to disclose the storage,
4056
+ * because SolvaPay surfaces hide Stripe's own `terms` line.
4057
+ */
4058
+ savesPaymentMethod?: boolean;
4072
4059
  };
4073
4060
  type MandateTemplate = string | ((ctx: MandateContext) => string);
4074
4061
  interface SolvaPayCopy {
@@ -4312,9 +4299,13 @@ interface SolvaPayCopy {
4312
4299
  addFunds: string;
4313
4300
  autoRechargeOn: string;
4314
4301
  autoRechargeOff: string;
4302
+ /** Status line while a top-up that enabled auto-recharge is still pending. */
4303
+ autoRechargePending: string;
4315
4304
  turnOn: string;
4316
- /** On-state link that opens the dedicated auto-recharge view. */
4305
+ /** On-state link that opens the hosted portal auto-recharge form. */
4317
4306
  manage: string;
4307
+ /** Failed-card link that opens the hosted portal auto-recharge form. */
4308
+ fixCard: string;
4318
4309
  /** Caption under auto-recharge off on a running credit plan (B). */
4319
4310
  autoRechargeOffCaption: string;
4320
4311
  /** Caption under auto-recharge off when calls are already failing (D). */
@@ -829,15 +829,15 @@ interface components {
829
829
  LimitBalanceDto: {
830
830
  /** @description Credit balance in credits (100 credits = 1 minor currency unit) */
831
831
  creditBalance: number;
832
+ /** @description Credits per minor unit of `currency` (typically 100) */
833
+ creditsPerMinorUnit?: number;
832
834
  /** @description Credits deducted per metered item (wallet coverage: remainingUnits = balance / creditsPerUnit) */
833
835
  creditsPerUnit: number;
834
836
  currency: string;
835
- /** @description How many metered items the credit balance still covers (`balance / creditsPerUnit`) */
836
- remainingUnits?: number;
837
- /** @description Credits per minor unit of `currency` (typically 100) */
838
- creditsPerMinorUnit?: number;
839
837
  /** @description USD → display-currency rate used with creditsPerMinorUnit */
840
838
  displayExchangeRate?: number;
839
+ /** @description How many metered items the credit balance still covers (`balance / creditsPerUnit`) */
840
+ remainingUnits?: number;
841
841
  };
842
842
  LimitPlanItemDto: {
843
843
  /** @description Derived billing cycle */
@@ -1208,17 +1208,17 @@ interface components {
1208
1208
  };
1209
1209
  ProcessPaymentCancelled: {
1210
1210
  /**
1211
- * discriminator enum property added by openapi-typescript
1211
+ * @example cancelled
1212
1212
  * @enum {string}
1213
1213
  */
1214
- status: 'ProcessPaymentCancelled';
1214
+ status: 'cancelled';
1215
1215
  };
1216
1216
  ProcessPaymentFailed: {
1217
1217
  /**
1218
- * discriminator enum property added by openapi-typescript
1218
+ * @example failed
1219
1219
  * @enum {string}
1220
1220
  */
1221
- status: 'ProcessPaymentFailed';
1221
+ status: 'failed';
1222
1222
  };
1223
1223
  ProcessPaymentIntentDto: {
1224
1224
  customerRef: string;
@@ -1227,25 +1227,25 @@ interface components {
1227
1227
  };
1228
1228
  ProcessPaymentProcessing: {
1229
1229
  /**
1230
- * discriminator enum property added by openapi-typescript
1230
+ * @example processing
1231
1231
  * @enum {string}
1232
1232
  */
1233
- status: 'ProcessPaymentProcessing';
1233
+ status: 'processing';
1234
1234
  };
1235
1235
  ProcessPaymentSucceededBare: {
1236
1236
  /**
1237
- * discriminator enum property added by openapi-typescript
1237
+ * @example succeeded
1238
1238
  * @enum {string}
1239
1239
  */
1240
- status: 'ProcessPaymentSucceededBare';
1240
+ status: 'succeeded';
1241
1241
  };
1242
1242
  ProcessPaymentSucceededOneTime: {
1243
1243
  oneTimePurchase: components['schemas']['OneTimePurchaseInfo'];
1244
1244
  /**
1245
- * discriminator enum property added by openapi-typescript
1245
+ * @example succeeded
1246
1246
  * @enum {string}
1247
1247
  */
1248
- status: 'ProcessPaymentSucceededOneTime';
1248
+ status: 'succeeded';
1249
1249
  /**
1250
1250
  * @example one-time
1251
1251
  * @enum {string}
@@ -1255,10 +1255,10 @@ interface components {
1255
1255
  ProcessPaymentSucceededRecurring: {
1256
1256
  purchase: components['schemas']['SdkPurchaseResponse'];
1257
1257
  /**
1258
- * discriminator enum property added by openapi-typescript
1258
+ * @example succeeded
1259
1259
  * @enum {string}
1260
1260
  */
1261
- status: 'ProcessPaymentSucceededRecurring';
1261
+ status: 'succeeded';
1262
1262
  /**
1263
1263
  * @example recurring
1264
1264
  * @enum {string}
@@ -1269,10 +1269,10 @@ interface components {
1269
1269
  /** @description Detail message describing the timeout */
1270
1270
  message?: string;
1271
1271
  /**
1272
- * discriminator enum property added by openapi-typescript
1272
+ * @example timeout
1273
1273
  * @enum {string}
1274
1274
  */
1275
- status: 'ProcessPaymentTimeout';
1275
+ status: 'timeout';
1276
1276
  };
1277
1277
  ProductConfigDto: {
1278
1278
  /**
@@ -3214,10 +3214,10 @@ interface operations {
3214
3214
  content: {
3215
3215
  'application/json': {
3216
3216
  /**
3217
- * Outcome of the delete: hard delete in sandbox, soft-delete or deactivation in live depending on existing purchases
3217
+ * Outcome of the delete: deactivation when purchases exist, otherwise soft-delete. Same in sandbox and live.
3218
3218
  * @enum {string}
3219
3219
  */
3220
- action?: 'deleted' | 'deactivated' | 'soft_deleted';
3220
+ action?: 'deactivated' | 'soft_deleted';
3221
3221
  success?: boolean;
3222
3222
  };
3223
3223
  };
@@ -3884,42 +3884,23 @@ type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3884
3884
  /** @deprecated Never populated by the backend. Read `planRef` instead. */
3885
3885
  plan?: string;
3886
3886
  };
3887
- type OneTimePurchaseInfo = components['schemas']['OneTimePurchaseInfo'];
3888
3887
  /**
3889
3888
  * Result from processing a payment intent.
3890
3889
  *
3891
- * Mirrors the backend's discriminated `oneOf` response. The `succeeded`
3892
- * branches are further discriminated on `type` so consumers can route to
3893
- * recurring vs one-time purchase handling without guarding against
3894
- * `purchase === undefined`. A bare `{ status: 'succeeded' }` is returned
3895
- * when the webhook race means the backend can't yet enrich the response
3896
- * with the created purchase — callers should fall back to refetching.
3890
+ * Derived from the generated `/v1/sdk/payment-intents/{id}/process` 200
3891
+ * response. The `succeeded` branches further discriminate on `type` so
3892
+ * consumers can route to recurring vs one-time handling without guarding
3893
+ * against `purchase === undefined`. A bare `{ status: 'succeeded' }` is
3894
+ * returned when the webhook race means the backend can't yet enrich the
3895
+ * response with the created purchase — callers should fall back to
3896
+ * refetching.
3897
3897
  *
3898
- * `failed` and `cancelled` are returned by the backend when the Stripe
3899
- * PaymentIntent is in a terminal non-success state and are routed to
3900
- * `onError` by `reconcilePayment`. `timeout` carries a retry hint and is
3901
- * routed to the timeout branch.
3898
+ * `failed` and `cancelled` are returned when the Stripe PaymentIntent is
3899
+ * in a terminal non-success state and are routed to `onError` by
3900
+ * `reconcilePayment`. `timeout` carries a retry hint and is routed to
3901
+ * the timeout branch.
3902
3902
  */
3903
- type ProcessPaymentResult = {
3904
- status: 'succeeded';
3905
- type: 'recurring';
3906
- purchase: PurchaseInfo;
3907
- } | {
3908
- status: 'succeeded';
3909
- type: 'one-time';
3910
- oneTimePurchase: OneTimePurchaseInfo;
3911
- } | {
3912
- status: 'succeeded';
3913
- } | {
3914
- status: 'processing';
3915
- } | {
3916
- status: 'timeout';
3917
- message?: string;
3918
- } | {
3919
- status: 'failed';
3920
- } | {
3921
- status: 'cancelled';
3922
- };
3903
+ type ProcessPaymentResult = operations['PaymentIntentSdkController_processPaymentIntent']['responses']['200']['content']['application/json'];
3923
3904
  /**
3924
3905
  * Result from processing a credit-topup payment intent.
3925
3906
  *
@@ -4069,6 +4050,12 @@ type MandateContext = {
4069
4050
  };
4070
4051
  amountFormatted: string;
4071
4052
  trialDays?: number;
4053
+ /**
4054
+ * True when the confirm also stores the card for later off-session
4055
+ * charges (auto-recharge). The mandate has to disclose the storage,
4056
+ * because SolvaPay surfaces hide Stripe's own `terms` line.
4057
+ */
4058
+ savesPaymentMethod?: boolean;
4072
4059
  };
4073
4060
  type MandateTemplate = string | ((ctx: MandateContext) => string);
4074
4061
  interface SolvaPayCopy {
@@ -4312,9 +4299,13 @@ interface SolvaPayCopy {
4312
4299
  addFunds: string;
4313
4300
  autoRechargeOn: string;
4314
4301
  autoRechargeOff: string;
4302
+ /** Status line while a top-up that enabled auto-recharge is still pending. */
4303
+ autoRechargePending: string;
4315
4304
  turnOn: string;
4316
- /** On-state link that opens the dedicated auto-recharge view. */
4305
+ /** On-state link that opens the hosted portal auto-recharge form. */
4317
4306
  manage: string;
4307
+ /** Failed-card link that opens the hosted portal auto-recharge form. */
4308
+ fixCard: string;
4318
4309
  /** Caption under auto-recharge off on a running credit plan (B). */
4319
4310
  autoRechargeOffCaption: string;
4320
4311
  /** Caption under auto-recharge off when calls are already failing (D). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "2.2.2",
3
+ "version": "2.3.0-preview-e77af6c08d8a185342e1a74903c8545b94a9f51d",
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.2-preview-e77af6c08d8a185342e1a74903c8545b94a9f51d",
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.2",
89
- "@solvapay/server": "2.6.0",
88
+ "@solvapay/mcp-core": "0.4.2-preview-e77af6c08d8a185342e1a74903c8545b94a9f51d",
89
+ "@solvapay/server": "2.6.0-preview-e77af6c08d8a185342e1a74903c8545b94a9f51d",
90
90
  "@solvapay/test-utils": "0.0.0"
91
91
  },
92
92
  "scripts": {