@solvapay/react 2.0.1 → 2.0.2-preview-e0daec2e600e51dda2adb4993d7d551508ead29c

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.
@@ -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-BgyNW-D3.cjs';
4
- export { D as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../shared-BgyNW-D3.cjs';
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-DCZFtpM2.cjs';
4
+ export { D as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../shared-DCZFtpM2.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-jmmZYs2K.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-jmmZYs2K.cjs';
6
+ import { A as AutoRechargeInputPayload, I as AmountInputUnit, J as AutoRechargeFormState, l as PaywallStructuredContent, U as UsageSnapshot } from '../index-CJ-SLEFD.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-CJ-SLEFD.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';
@@ -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-BI78qUom.js';
4
- export { D as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../shared-BI78qUom.js';
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-B1FBbnL6.js';
4
+ export { D as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../shared-B1FBbnL6.js';
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-DHcgeDBy.js';
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-DHcgeDBy.js';
6
+ import { A as AutoRechargeInputPayload, I as AmountInputUnit, J as AutoRechargeFormState, l as PaywallStructuredContent, U as UsageSnapshot } from '../index-C_-dCyA9.js';
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-C_-dCyA9.js';
8
8
  import { PaymentElement } from '@stripe/react-stripe-js';
9
9
  import { Stripe, StripeElements } from '@stripe/stripe-js';
10
10
  import '../adapters/auth.js';
@@ -88,7 +88,7 @@ import {
88
88
  useCreditGate,
89
89
  usePaywallNotice,
90
90
  usePurchaseGate
91
- } from "../chunk-ZKFTT5WD.js";
91
+ } from "../chunk-Z2CCCBDY.js";
92
92
  import {
93
93
  AmountPicker,
94
94
  AmountPickerConfirm,
@@ -175,7 +175,7 @@ import {
175
175
  usePlanSelector,
176
176
  useTopupForm,
177
177
  useUsageMeter
178
- } from "../chunk-GMZU5M6R.js";
178
+ } from "../chunk-JFW3WPVY.js";
179
179
  import "../chunk-UMXOAUW7.js";
180
180
  import "../chunk-MLKGABMK.js";
181
181
  export {
@@ -336,13 +336,6 @@ interface components {
336
336
  label?: string;
337
337
  /** @enum {string} */
338
338
  onEnd: 'convert' | 'cancel' | 'downgrade';
339
- requireCard?: boolean;
340
- } | {
341
- /** @enum {string} */
342
- kind: 'prepaid';
343
- label?: string;
344
- lowBalanceUnits?: number;
345
- minTopUpMinor?: number;
346
339
  } | {
347
340
  /** @enum {string} */
348
341
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -539,13 +532,6 @@ interface components {
539
532
  label?: string;
540
533
  /** @enum {string} */
541
534
  onEnd: 'convert' | 'cancel' | 'downgrade';
542
- requireCard?: boolean;
543
- } | {
544
- /** @enum {string} */
545
- kind: 'prepaid';
546
- label?: string;
547
- lowBalanceUnits?: number;
548
- minTopUpMinor?: number;
549
535
  } | {
550
536
  /** @enum {string} */
551
537
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -636,7 +622,7 @@ interface components {
636
622
  * @example duplicate
637
623
  * @enum {string}
638
624
  */
639
- reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based';
625
+ reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based' | 'plan_billed_at_period_end';
640
626
  };
641
627
  CreditDebitSuccessResponse: {
642
628
  /**
@@ -685,7 +671,7 @@ interface components {
685
671
  * @example parity
686
672
  * @enum {string}
687
673
  */
688
- rateSource: 'parity' | 'db' | 'fallback';
674
+ rateSource: 'parity' | 'db' | 'fallback' | 'funding';
689
675
  };
690
676
  CustomerBalanceResponse: {
691
677
  /**
@@ -742,11 +728,10 @@ interface components {
742
728
  };
743
729
  DisableAutoRechargeResponse: {
744
730
  /**
745
- * Always true on success
731
+ * Whether auto-recharge was disabled
746
732
  * @example true
747
- * @enum {number}
748
733
  */
749
- success: true;
734
+ success: boolean;
750
735
  };
751
736
  GetCustomerSessionResponse: {
752
737
  /**
@@ -971,13 +956,6 @@ interface components {
971
956
  label?: string;
972
957
  /** @enum {string} */
973
958
  onEnd: 'convert' | 'cancel' | 'downgrade';
974
- requireCard?: boolean;
975
- } | {
976
- /** @enum {string} */
977
- kind: 'prepaid';
978
- label?: string;
979
- lowBalanceUnits?: number;
980
- minTopUpMinor?: number;
981
959
  } | {
982
960
  /** @enum {string} */
983
961
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -1558,7 +1536,7 @@ interface components {
1558
1536
  [key: string]: unknown;
1559
1537
  } | null;
1560
1538
  /**
1561
- * Whether the frozen plan meters usage
1539
+ * Whether the frozen plan counts usage (prices per unit, or has a limit). Shipped clients read this to show an allowance.
1562
1540
  * @example true
1563
1541
  */
1564
1542
  isMetered?: boolean;
@@ -1879,13 +1857,6 @@ interface components {
1879
1857
  label?: string;
1880
1858
  /** @enum {string} */
1881
1859
  onEnd: 'convert' | 'cancel' | 'downgrade';
1882
- requireCard?: boolean;
1883
- } | {
1884
- /** @enum {string} */
1885
- kind: 'prepaid';
1886
- label?: string;
1887
- lowBalanceUnits?: number;
1888
- minTopUpMinor?: number;
1889
1860
  } | {
1890
1861
  /** @enum {string} */
1891
1862
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -3777,19 +3748,7 @@ interface operations {
3777
3748
 
3778
3749
  /** SDK purchase row. Generated from the OpenAPI `SdkPurchaseResponse` schema. */
3779
3750
  type PurchaseInfo = components['schemas']['SdkPurchaseResponse'];
3780
- /**
3781
- * One-time purchase information returned from payment processing
3782
- */
3783
- interface OneTimePurchaseInfo {
3784
- reference: string;
3785
- customerRef: string;
3786
- productRef?: string;
3787
- amount: number;
3788
- currency: string;
3789
- creditsAdded?: number;
3790
- completedAt: string;
3791
- createdAt: string;
3792
- }
3751
+ type OneTimePurchaseInfo = components['schemas']['OneTimePurchaseInfo'];
3793
3752
  /**
3794
3753
  * Result from processing a payment intent.
3795
3754
  *
@@ -3874,71 +3833,21 @@ type ActivatePlanResult = components['schemas']['ActivatePlanResponseDto'];
3874
3833
  * `{ kind: 'card', ... } | { kind: 'none' }` discriminated union here.
3875
3834
  */
3876
3835
  type PaymentMethodInfo = operations['PaymentMethodSdkController_getPaymentMethod']['responses']['200']['content']['application/json'];
3877
- type AutoRechargeStatus = 'active' | 'disabled' | 'failed' | 'pending_setup';
3878
- type AutoRechargeConfig = {
3879
- enabled: boolean;
3880
- trigger: {
3881
- type: 'balance';
3882
- thresholdAmountMinor: number;
3883
- };
3884
- topup: {
3885
- mode: 'fixed';
3886
- amountMinor: number;
3887
- currency: string;
3888
- };
3889
- fundingSourceType?: 'saved_card' | 'tokenized_card';
3890
- paymentMethodId?: string;
3891
- status: AutoRechargeStatus;
3892
- failureCount: number;
3893
- maxMonthlySpendMinor?: number;
3894
- monthlySpendMinor: number;
3895
- monthlySpendPeriod?: string;
3896
- lastChargeAt?: string;
3897
- updatedAt?: string;
3898
- /** Backend-computed display values — render verbatim; do not derive from trigger fields. */
3899
- display?: AutoRechargeDisplayBlock;
3900
- };
3901
- type AutoRechargeDisplayBlock = {
3902
- thresholdAmountMajor: number;
3903
- topupAmountMajor: number;
3904
- currency: string;
3905
- formatted: {
3906
- threshold: string;
3907
- topup: string;
3908
- };
3909
- exchangeRate: number;
3910
- rateSource: 'parity' | 'db' | 'fallback';
3911
- };
3912
- type CreditDisplayBlock$1 = {
3913
- amountMajor: number;
3914
- currency: string;
3915
- formatted: string;
3916
- exchangeRate: number;
3917
- rateSource: 'parity' | 'db' | 'fallback';
3918
- };
3919
- type AutoRechargeInput = {
3920
- enabled: boolean;
3921
- triggerType: 'balance';
3922
- thresholdAmountMajor?: number;
3923
- topupAmountMajor?: number;
3924
- maxMonthlySpendMajor?: number;
3925
- currency: string;
3836
+ /**
3837
+ * Stored auto-recharge config. `display` is an SDK-side merge of the
3838
+ * sibling `AutoRechargeGetResponse.display` block so consumers can read
3839
+ * formatted amounts off the config object.
3840
+ */
3841
+ type AutoRechargeConfig = components['schemas']['AutoRechargeConfigDto'] & {
3842
+ display?: components['schemas']['AutoRechargeDisplayDto'];
3926
3843
  };
3844
+ type AutoRechargeDisplayBlock = components['schemas']['AutoRechargeDisplayDto'];
3845
+ type CreditDisplayBlock = components['schemas']['CustomerBalanceDisplayDto'];
3846
+ type AutoRechargeInput = Omit<components['schemas']['PutAutoRechargeSdkDto'], 'customerRef' | 'customerEmail' | 'customerName' | 'deferSetupIntent'>;
3927
3847
  /** PUT /sdk/auto-recharge — input plus request-only flags. */
3928
- type SaveAutoRechargeInput = AutoRechargeInput & {
3929
- deferSetupIntent?: boolean;
3930
- };
3931
- type AutoRechargeResponse = {
3932
- config: AutoRechargeConfig | null;
3933
- display?: AutoRechargeDisplayBlock;
3934
- };
3935
- type SaveAutoRechargeResponse = {
3936
- config: AutoRechargeConfig;
3937
- display?: AutoRechargeDisplayBlock;
3938
- setupClientSecret?: string;
3939
- publishableKey?: string;
3940
- stripeAccountId?: string;
3941
- };
3848
+ type SaveAutoRechargeInput = Omit<components['schemas']['PutAutoRechargeSdkDto'], 'customerRef' | 'customerEmail' | 'customerName'>;
3849
+ type AutoRechargeResponse = components['schemas']['AutoRechargeGetResponse'];
3850
+ type SaveAutoRechargeResponse = components['schemas']['SaveAutoRechargeResponse'];
3942
3851
 
3943
3852
  /**
3944
3853
  * Customer Helper (Core)
@@ -3947,14 +3856,7 @@ type SaveAutoRechargeResponse = {
3947
3856
  * Works with standard Web API Request (works everywhere).
3948
3857
  */
3949
3858
 
3950
- type CustomerBalanceResult = {
3951
- customerRef: string;
3952
- credits: number;
3953
- displayCurrency: string;
3954
- creditsPerMinorUnit: number;
3955
- displayExchangeRate: number;
3956
- display?: CreditDisplayBlock$1;
3957
- };
3859
+ type CustomerBalanceResult = components['schemas']['CustomerBalanceResponse'];
3958
3860
 
3959
3861
  interface PurchaseCheckResult {
3960
3862
  customerRef: string;
@@ -4363,13 +4265,6 @@ type PartialSolvaPayCopy = {
4363
4265
  [K in keyof SolvaPayCopy]?: Partial<SolvaPayCopy[K]>;
4364
4266
  };
4365
4267
 
4366
- type CreditDisplayBlock = {
4367
- amountMajor: number;
4368
- currency: string;
4369
- formatted: string;
4370
- exchangeRate: number;
4371
- rateSource: 'parity' | 'db' | 'fallback';
4372
- };
4373
4268
  interface TransportBalanceResult {
4374
4269
  credits: number;
4375
4270
  displayCurrency: string;
@@ -336,13 +336,6 @@ interface components {
336
336
  label?: string;
337
337
  /** @enum {string} */
338
338
  onEnd: 'convert' | 'cancel' | 'downgrade';
339
- requireCard?: boolean;
340
- } | {
341
- /** @enum {string} */
342
- kind: 'prepaid';
343
- label?: string;
344
- lowBalanceUnits?: number;
345
- minTopUpMinor?: number;
346
339
  } | {
347
340
  /** @enum {string} */
348
341
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -539,13 +532,6 @@ interface components {
539
532
  label?: string;
540
533
  /** @enum {string} */
541
534
  onEnd: 'convert' | 'cancel' | 'downgrade';
542
- requireCard?: boolean;
543
- } | {
544
- /** @enum {string} */
545
- kind: 'prepaid';
546
- label?: string;
547
- lowBalanceUnits?: number;
548
- minTopUpMinor?: number;
549
535
  } | {
550
536
  /** @enum {string} */
551
537
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -636,7 +622,7 @@ interface components {
636
622
  * @example duplicate
637
623
  * @enum {string}
638
624
  */
639
- reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based';
625
+ reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based' | 'plan_billed_at_period_end';
640
626
  };
641
627
  CreditDebitSuccessResponse: {
642
628
  /**
@@ -685,7 +671,7 @@ interface components {
685
671
  * @example parity
686
672
  * @enum {string}
687
673
  */
688
- rateSource: 'parity' | 'db' | 'fallback';
674
+ rateSource: 'parity' | 'db' | 'fallback' | 'funding';
689
675
  };
690
676
  CustomerBalanceResponse: {
691
677
  /**
@@ -742,11 +728,10 @@ interface components {
742
728
  };
743
729
  DisableAutoRechargeResponse: {
744
730
  /**
745
- * Always true on success
731
+ * Whether auto-recharge was disabled
746
732
  * @example true
747
- * @enum {number}
748
733
  */
749
- success: true;
734
+ success: boolean;
750
735
  };
751
736
  GetCustomerSessionResponse: {
752
737
  /**
@@ -971,13 +956,6 @@ interface components {
971
956
  label?: string;
972
957
  /** @enum {string} */
973
958
  onEnd: 'convert' | 'cancel' | 'downgrade';
974
- requireCard?: boolean;
975
- } | {
976
- /** @enum {string} */
977
- kind: 'prepaid';
978
- label?: string;
979
- lowBalanceUnits?: number;
980
- minTopUpMinor?: number;
981
959
  } | {
982
960
  /** @enum {string} */
983
961
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -1558,7 +1536,7 @@ interface components {
1558
1536
  [key: string]: unknown;
1559
1537
  } | null;
1560
1538
  /**
1561
- * Whether the frozen plan meters usage
1539
+ * Whether the frozen plan counts usage (prices per unit, or has a limit). Shipped clients read this to show an allowance.
1562
1540
  * @example true
1563
1541
  */
1564
1542
  isMetered?: boolean;
@@ -1879,13 +1857,6 @@ interface components {
1879
1857
  label?: string;
1880
1858
  /** @enum {string} */
1881
1859
  onEnd: 'convert' | 'cancel' | 'downgrade';
1882
- requireCard?: boolean;
1883
- } | {
1884
- /** @enum {string} */
1885
- kind: 'prepaid';
1886
- label?: string;
1887
- lowBalanceUnits?: number;
1888
- minTopUpMinor?: number;
1889
1860
  } | {
1890
1861
  /** @enum {string} */
1891
1862
  appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
@@ -3777,19 +3748,7 @@ interface operations {
3777
3748
 
3778
3749
  /** SDK purchase row. Generated from the OpenAPI `SdkPurchaseResponse` schema. */
3779
3750
  type PurchaseInfo = components['schemas']['SdkPurchaseResponse'];
3780
- /**
3781
- * One-time purchase information returned from payment processing
3782
- */
3783
- interface OneTimePurchaseInfo {
3784
- reference: string;
3785
- customerRef: string;
3786
- productRef?: string;
3787
- amount: number;
3788
- currency: string;
3789
- creditsAdded?: number;
3790
- completedAt: string;
3791
- createdAt: string;
3792
- }
3751
+ type OneTimePurchaseInfo = components['schemas']['OneTimePurchaseInfo'];
3793
3752
  /**
3794
3753
  * Result from processing a payment intent.
3795
3754
  *
@@ -3874,71 +3833,21 @@ type ActivatePlanResult = components['schemas']['ActivatePlanResponseDto'];
3874
3833
  * `{ kind: 'card', ... } | { kind: 'none' }` discriminated union here.
3875
3834
  */
3876
3835
  type PaymentMethodInfo = operations['PaymentMethodSdkController_getPaymentMethod']['responses']['200']['content']['application/json'];
3877
- type AutoRechargeStatus = 'active' | 'disabled' | 'failed' | 'pending_setup';
3878
- type AutoRechargeConfig = {
3879
- enabled: boolean;
3880
- trigger: {
3881
- type: 'balance';
3882
- thresholdAmountMinor: number;
3883
- };
3884
- topup: {
3885
- mode: 'fixed';
3886
- amountMinor: number;
3887
- currency: string;
3888
- };
3889
- fundingSourceType?: 'saved_card' | 'tokenized_card';
3890
- paymentMethodId?: string;
3891
- status: AutoRechargeStatus;
3892
- failureCount: number;
3893
- maxMonthlySpendMinor?: number;
3894
- monthlySpendMinor: number;
3895
- monthlySpendPeriod?: string;
3896
- lastChargeAt?: string;
3897
- updatedAt?: string;
3898
- /** Backend-computed display values — render verbatim; do not derive from trigger fields. */
3899
- display?: AutoRechargeDisplayBlock;
3900
- };
3901
- type AutoRechargeDisplayBlock = {
3902
- thresholdAmountMajor: number;
3903
- topupAmountMajor: number;
3904
- currency: string;
3905
- formatted: {
3906
- threshold: string;
3907
- topup: string;
3908
- };
3909
- exchangeRate: number;
3910
- rateSource: 'parity' | 'db' | 'fallback';
3911
- };
3912
- type CreditDisplayBlock$1 = {
3913
- amountMajor: number;
3914
- currency: string;
3915
- formatted: string;
3916
- exchangeRate: number;
3917
- rateSource: 'parity' | 'db' | 'fallback';
3918
- };
3919
- type AutoRechargeInput = {
3920
- enabled: boolean;
3921
- triggerType: 'balance';
3922
- thresholdAmountMajor?: number;
3923
- topupAmountMajor?: number;
3924
- maxMonthlySpendMajor?: number;
3925
- currency: string;
3836
+ /**
3837
+ * Stored auto-recharge config. `display` is an SDK-side merge of the
3838
+ * sibling `AutoRechargeGetResponse.display` block so consumers can read
3839
+ * formatted amounts off the config object.
3840
+ */
3841
+ type AutoRechargeConfig = components['schemas']['AutoRechargeConfigDto'] & {
3842
+ display?: components['schemas']['AutoRechargeDisplayDto'];
3926
3843
  };
3844
+ type AutoRechargeDisplayBlock = components['schemas']['AutoRechargeDisplayDto'];
3845
+ type CreditDisplayBlock = components['schemas']['CustomerBalanceDisplayDto'];
3846
+ type AutoRechargeInput = Omit<components['schemas']['PutAutoRechargeSdkDto'], 'customerRef' | 'customerEmail' | 'customerName' | 'deferSetupIntent'>;
3927
3847
  /** PUT /sdk/auto-recharge — input plus request-only flags. */
3928
- type SaveAutoRechargeInput = AutoRechargeInput & {
3929
- deferSetupIntent?: boolean;
3930
- };
3931
- type AutoRechargeResponse = {
3932
- config: AutoRechargeConfig | null;
3933
- display?: AutoRechargeDisplayBlock;
3934
- };
3935
- type SaveAutoRechargeResponse = {
3936
- config: AutoRechargeConfig;
3937
- display?: AutoRechargeDisplayBlock;
3938
- setupClientSecret?: string;
3939
- publishableKey?: string;
3940
- stripeAccountId?: string;
3941
- };
3848
+ type SaveAutoRechargeInput = Omit<components['schemas']['PutAutoRechargeSdkDto'], 'customerRef' | 'customerEmail' | 'customerName'>;
3849
+ type AutoRechargeResponse = components['schemas']['AutoRechargeGetResponse'];
3850
+ type SaveAutoRechargeResponse = components['schemas']['SaveAutoRechargeResponse'];
3942
3851
 
3943
3852
  /**
3944
3853
  * Customer Helper (Core)
@@ -3947,14 +3856,7 @@ type SaveAutoRechargeResponse = {
3947
3856
  * Works with standard Web API Request (works everywhere).
3948
3857
  */
3949
3858
 
3950
- type CustomerBalanceResult = {
3951
- customerRef: string;
3952
- credits: number;
3953
- displayCurrency: string;
3954
- creditsPerMinorUnit: number;
3955
- displayExchangeRate: number;
3956
- display?: CreditDisplayBlock$1;
3957
- };
3859
+ type CustomerBalanceResult = components['schemas']['CustomerBalanceResponse'];
3958
3860
 
3959
3861
  interface PurchaseCheckResult {
3960
3862
  customerRef: string;
@@ -4363,13 +4265,6 @@ type PartialSolvaPayCopy = {
4363
4265
  [K in keyof SolvaPayCopy]?: Partial<SolvaPayCopy[K]>;
4364
4266
  };
4365
4267
 
4366
- type CreditDisplayBlock = {
4367
- amountMajor: number;
4368
- currency: string;
4369
- formatted: string;
4370
- exchangeRate: number;
4371
- rateSource: 'parity' | 'db' | 'fallback';
4372
- };
4373
4268
  interface TransportBalanceResult {
4374
4269
  credits: number;
4375
4270
  displayCurrency: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-preview-e0daec2e600e51dda2adb4993d7d551508ead29c",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -86,7 +86,7 @@
86
86
  "typescript": "^5.9.3",
87
87
  "vitest": "^4.1.2",
88
88
  "@solvapay/mcp-core": "0.3.2",
89
- "@solvapay/server": "2.2.1",
89
+ "@solvapay/server": "2.2.2-preview-e0daec2e600e51dda2adb4993d7d551508ead29c",
90
90
  "@solvapay/test-utils": "0.0.0"
91
91
  },
92
92
  "scripts": {