@solvapay/react 1.3.0 → 1.4.0-preview-ecd61384a4e849717e13d47ab2daa086cdcd91c5
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 +28 -0
- package/dist/adapters/auth.js +1 -0
- package/dist/adapters/auth0.js +1 -0
- package/dist/adapters/session-auth.js +1 -0
- package/dist/{chunk-DW5FJUUG.js → chunk-6RR4J74H.js} +214 -24
- package/dist/chunk-GFWMLRR3.js +3224 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-4ISNB3JU.js → chunk-SUHDOG7Q.js} +1 -1
- package/dist/{index-BwwdMBdt.d.ts → index-CDvQcobx.d.cts} +21 -2
- package/dist/{index-kXLvp7EU.d.cts → index-w_VMlKm5.d.ts} +21 -2
- package/dist/index.cjs +2216 -363
- package/dist/index.d.cts +34 -5
- package/dist/index.d.ts +34 -5
- package/dist/index.js +66 -3
- package/dist/mcp/index.cjs +216 -29
- package/dist/mcp/index.d.cts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +3 -2
- package/dist/primitives/index.cjs +2101 -362
- package/dist/primitives/index.d.cts +180 -5
- package/dist/primitives/index.d.ts +180 -5
- package/dist/primitives/index.js +73 -2
- package/dist/{shared-lIhc8DS3.d.ts → shared-D8raw1Nv.d.ts} +143 -12
- package/dist/{shared-BNZAIWkU.d.cts → shared-LcjvX4fD.d.cts} +143 -12
- package/dist/styles.css +513 -0
- package/dist/webapi-K5XBCEO6.js +3775 -0
- package/package.json +5 -5
- package/dist/chunk-K7ZUJI26.js +0 -1527
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as
|
|
3
|
-
export {
|
|
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 PaywallStructuredContent, C as CheckoutVariant } from './index-
|
|
5
|
-
export {
|
|
2
|
+
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-LcjvX4fD.cjs';
|
|
3
|
+
export { D as BootstrapPlanLike, E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError } from './shared-LcjvX4fD.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, A as AutoRechargeInputPayload, j as PaywallStructuredContent, C as CheckoutVariant } from './index-CDvQcobx.cjs';
|
|
5
|
+
export { k as ActivationFlowStep, B as BalanceBadge, l as CancelPlanButton, m as CheckoutErrorPhase, n as CheckoutStatus, o as CheckoutSteps, p as CheckoutSummary, q as CheckoutSummaryProps, M as MandateText, r as MandateTextProps, s as PlanBadge, t as ProductBadge, u as PurchaseGate, U as UsageSnapshot, v as UseCheckoutFlowOptions, w as UseCheckoutFlowReturn, x as UseUsageReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext, F as useUsage } from './index-CDvQcobx.cjs';
|
|
6
6
|
import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
|
|
7
7
|
export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.cjs';
|
|
8
8
|
export { SessionAuthAdapterOptions, createSessionAuthAdapter } from './adapters/session-auth.cjs';
|
|
@@ -378,6 +378,19 @@ interface CurrentPlanCardProps {
|
|
|
378
378
|
}
|
|
379
379
|
declare const CurrentPlanCard: React.FC<CurrentPlanCardProps>;
|
|
380
380
|
|
|
381
|
+
type AutoRechargeProps = {
|
|
382
|
+
currency?: string;
|
|
383
|
+
defaultThresholdAmountMajor?: number;
|
|
384
|
+
defaultTopupAmountMajor?: number;
|
|
385
|
+
onSetupRequired?: (result: SaveAutoRechargeResponse) => void | Promise<void>;
|
|
386
|
+
onSaved?: (result: SaveAutoRechargeResponse) => void | Promise<void>;
|
|
387
|
+
onDisabled?: () => void | Promise<void>;
|
|
388
|
+
deferCardSetup?: boolean;
|
|
389
|
+
onPendingConfig?: (payload: AutoRechargeInputPayload) => void | Promise<void>;
|
|
390
|
+
className?: string;
|
|
391
|
+
};
|
|
392
|
+
declare function AutoRecharge({ currency, defaultThresholdAmountMajor, defaultTopupAmountMajor, onSetupRequired, onSaved, onDisabled, deferCardSetup, onPendingConfig, className, }: AutoRechargeProps): React.ReactElement;
|
|
393
|
+
|
|
381
394
|
/**
|
|
382
395
|
* `<LaunchCustomerPortalButton>` — opens the SolvaPay hosted customer
|
|
383
396
|
* portal in a new browser tab.
|
|
@@ -849,6 +862,21 @@ declare function useTopupAmountSelector(options: UseTopupAmountSelectorOptions):
|
|
|
849
862
|
*/
|
|
850
863
|
declare function usePaymentMethod(): UsePaymentMethodReturn;
|
|
851
864
|
|
|
865
|
+
type UseAutoRechargeReturn = {
|
|
866
|
+
config: AutoRechargeConfig | null;
|
|
867
|
+
loading: boolean;
|
|
868
|
+
saving: boolean;
|
|
869
|
+
disabling: boolean;
|
|
870
|
+
error: Error | null;
|
|
871
|
+
refresh: (force?: boolean) => Promise<void>;
|
|
872
|
+
save: (input: SaveAutoRechargeInput) => Promise<SaveAutoRechargeResponse>;
|
|
873
|
+
disable: () => Promise<{
|
|
874
|
+
success: true;
|
|
875
|
+
}>;
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
declare function useAutoRecharge(): UseAutoRechargeReturn;
|
|
879
|
+
|
|
852
880
|
/**
|
|
853
881
|
* Returns the effective data-access transport for the current provider.
|
|
854
882
|
*
|
|
@@ -1168,9 +1196,10 @@ declare const DEFAULT_ROUTES: {
|
|
|
1168
1196
|
readonly getProduct: "/api/get-product";
|
|
1169
1197
|
readonly listPlans: "/api/list-plans";
|
|
1170
1198
|
readonly getPaymentMethod: "/api/payment-method";
|
|
1199
|
+
readonly autoRecharge: "/api/auto-recharge";
|
|
1171
1200
|
readonly getUsage: "/api/usage";
|
|
1172
1201
|
readonly getLimits: "/api/limits";
|
|
1173
1202
|
};
|
|
1174
1203
|
declare function createHttpTransport(config: SolvaPayConfig | undefined): SolvaPayTransport;
|
|
1175
1204
|
|
|
1176
|
-
export { ActivatePlanResult, ActivationFlow, type ActivationFlowProps, ActivationResult, type ActivationState, AmountPicker, type AmountPickerProps, BalanceStatus, CancelResult, CancelledPlanNotice, type CancelledPlanNoticeProps, CheckoutLayout, type CheckoutLayoutPlanSelectorOptions, type CheckoutLayoutProps, type CheckoutLayoutSize, CheckoutResult, CheckoutVariant, type ConfirmPaymentInput, type ConfirmPaymentMode, type ConfirmPaymentResult, CopyContext, CopyProvider, CreditGate, type CreditGateProps, CurrentPlanCard, type CurrentPlanCardClassNames, type CurrentPlanCardProps, type CustomerInfo, DEFAULT_ROUTES, type FormatPriceOptions, LaunchCustomerPortalButton, type LaunchCustomerPortalButtonProps, PartialSolvaPayCopy, type PaymentElementKind, PaymentForm, PaymentFormContext, type PaymentFormContextValue, PaymentFormProps, PaymentFormProvider, Plan, PlanSelector, type PlanSelectorProps, PrefillCustomer, Product, type PurchaseActions, PurchaseInfo, PurchaseStatus, PurchaseStatusReturn, ReactivateResult, SolvaPayConfig, SolvaPayContextValue, SolvaPayCopy, SolvaPayProvider, SolvaPayProviderProps, SolvaPayTransport, Spinner, StripePaymentFormWrapper, TopupForm, TopupFormProps, UpdatePaymentMethodButton, type UpdatePaymentMethodButtonMode, type UpdatePaymentMethodButtonProps, type UseActivationReturn, type UseAutoActivateFreePlanOptions, type UseAutoActivateFreePlanReturn, type UseLimitsOptions, type UseLimitsReturn, UseMerchantReturn, UsePaymentMethodReturn, type UsePaywallResolverReturn, UsePlanOptions, UsePlanReturn, UsePlansOptions, UsePlansReturn, UseProductReturn, UseTopupAmountSelectorOptions, UseTopupAmountSelectorReturn, UseTopupOptions, UseTopupReturn, confirmPayment, createHttpTransport, enCopy, filterPurchases, formatPrice, getActivePurchases, getCancelledPurchasesWithEndDate, getMinorUnitsPerMajor, getMostRecentPurchase, getPrimaryPurchase, interpolate, isPaidPurchase, isPlanPurchase, isTopupPurchase, mergeCopy, resolveCta, toMajorUnits, useActivation, useAutoActivateFreePlan, useBalance, useCheckout, useCopy, useCustomer, useLimits, useLocale, useMerchant, usePaymentForm, usePaymentMethod, usePaywallResolver, usePlan, usePlans, useProduct, usePurchase, usePurchaseActions, usePurchaseStatus, useSolvaPay, useTopup, useTopupAmountSelector, useTransport };
|
|
1205
|
+
export { ActivatePlanResult, ActivationFlow, type ActivationFlowProps, ActivationResult, type ActivationState, AmountPicker, type AmountPickerProps, AutoRecharge, type AutoRechargeProps, BalanceStatus, CancelResult, CancelledPlanNotice, type CancelledPlanNoticeProps, CheckoutLayout, type CheckoutLayoutPlanSelectorOptions, type CheckoutLayoutProps, type CheckoutLayoutSize, CheckoutResult, CheckoutVariant, type ConfirmPaymentInput, type ConfirmPaymentMode, type ConfirmPaymentResult, CopyContext, CopyProvider, CreditGate, type CreditGateProps, CurrentPlanCard, type CurrentPlanCardClassNames, type CurrentPlanCardProps, type CustomerInfo, DEFAULT_ROUTES, type FormatPriceOptions, LaunchCustomerPortalButton, type LaunchCustomerPortalButtonProps, PartialSolvaPayCopy, type PaymentElementKind, PaymentForm, PaymentFormContext, type PaymentFormContextValue, PaymentFormProps, PaymentFormProvider, Plan, PlanSelector, type PlanSelectorProps, PrefillCustomer, Product, type PurchaseActions, PurchaseInfo, PurchaseStatus, PurchaseStatusReturn, ReactivateResult, SolvaPayConfig, SolvaPayContextValue, SolvaPayCopy, SolvaPayProvider, SolvaPayProviderProps, SolvaPayTransport, Spinner, StripePaymentFormWrapper, TopupForm, TopupFormProps, UpdatePaymentMethodButton, type UpdatePaymentMethodButtonMode, type UpdatePaymentMethodButtonProps, type UseActivationReturn, type UseAutoActivateFreePlanOptions, type UseAutoActivateFreePlanReturn, type UseLimitsOptions, type UseLimitsReturn, UseMerchantReturn, UsePaymentMethodReturn, type UsePaywallResolverReturn, UsePlanOptions, UsePlanReturn, UsePlansOptions, UsePlansReturn, UseProductReturn, UseTopupAmountSelectorOptions, UseTopupAmountSelectorReturn, UseTopupOptions, UseTopupReturn, confirmPayment, createHttpTransport, enCopy, filterPurchases, formatPrice, getActivePurchases, getCancelledPurchasesWithEndDate, getMinorUnitsPerMajor, getMostRecentPurchase, getPrimaryPurchase, interpolate, isPaidPurchase, isPlanPurchase, isTopupPurchase, mergeCopy, resolveCta, toMajorUnits, useActivation, useAutoActivateFreePlan, useAutoRecharge, useBalance, useCheckout, useCopy, useCustomer, useLimits, useLocale, useMerchant, usePaymentForm, usePaymentMethod, usePaywallResolver, usePlan, usePlans, useProduct, usePurchase, usePurchaseActions, usePurchaseStatus, useSolvaPay, useTopup, useTopupAmountSelector, useTransport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as
|
|
3
|
-
export {
|
|
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 PaywallStructuredContent, C as CheckoutVariant } from './index-
|
|
5
|
-
export {
|
|
2
|
+
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-D8raw1Nv.js';
|
|
3
|
+
export { D as BootstrapPlanLike, E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError } from './shared-D8raw1Nv.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, A as AutoRechargeInputPayload, j as PaywallStructuredContent, C as CheckoutVariant } from './index-w_VMlKm5.js';
|
|
5
|
+
export { k as ActivationFlowStep, B as BalanceBadge, l as CancelPlanButton, m as CheckoutErrorPhase, n as CheckoutStatus, o as CheckoutSteps, p as CheckoutSummary, q as CheckoutSummaryProps, M as MandateText, r as MandateTextProps, s as PlanBadge, t as ProductBadge, u as PurchaseGate, U as UsageSnapshot, v as UseCheckoutFlowOptions, w as UseCheckoutFlowReturn, x as UseUsageReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext, F as useUsage } from './index-w_VMlKm5.js';
|
|
6
6
|
import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
|
|
7
7
|
export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.js';
|
|
8
8
|
export { SessionAuthAdapterOptions, createSessionAuthAdapter } from './adapters/session-auth.js';
|
|
@@ -378,6 +378,19 @@ interface CurrentPlanCardProps {
|
|
|
378
378
|
}
|
|
379
379
|
declare const CurrentPlanCard: React.FC<CurrentPlanCardProps>;
|
|
380
380
|
|
|
381
|
+
type AutoRechargeProps = {
|
|
382
|
+
currency?: string;
|
|
383
|
+
defaultThresholdAmountMajor?: number;
|
|
384
|
+
defaultTopupAmountMajor?: number;
|
|
385
|
+
onSetupRequired?: (result: SaveAutoRechargeResponse) => void | Promise<void>;
|
|
386
|
+
onSaved?: (result: SaveAutoRechargeResponse) => void | Promise<void>;
|
|
387
|
+
onDisabled?: () => void | Promise<void>;
|
|
388
|
+
deferCardSetup?: boolean;
|
|
389
|
+
onPendingConfig?: (payload: AutoRechargeInputPayload) => void | Promise<void>;
|
|
390
|
+
className?: string;
|
|
391
|
+
};
|
|
392
|
+
declare function AutoRecharge({ currency, defaultThresholdAmountMajor, defaultTopupAmountMajor, onSetupRequired, onSaved, onDisabled, deferCardSetup, onPendingConfig, className, }: AutoRechargeProps): React.ReactElement;
|
|
393
|
+
|
|
381
394
|
/**
|
|
382
395
|
* `<LaunchCustomerPortalButton>` — opens the SolvaPay hosted customer
|
|
383
396
|
* portal in a new browser tab.
|
|
@@ -849,6 +862,21 @@ declare function useTopupAmountSelector(options: UseTopupAmountSelectorOptions):
|
|
|
849
862
|
*/
|
|
850
863
|
declare function usePaymentMethod(): UsePaymentMethodReturn;
|
|
851
864
|
|
|
865
|
+
type UseAutoRechargeReturn = {
|
|
866
|
+
config: AutoRechargeConfig | null;
|
|
867
|
+
loading: boolean;
|
|
868
|
+
saving: boolean;
|
|
869
|
+
disabling: boolean;
|
|
870
|
+
error: Error | null;
|
|
871
|
+
refresh: (force?: boolean) => Promise<void>;
|
|
872
|
+
save: (input: SaveAutoRechargeInput) => Promise<SaveAutoRechargeResponse>;
|
|
873
|
+
disable: () => Promise<{
|
|
874
|
+
success: true;
|
|
875
|
+
}>;
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
declare function useAutoRecharge(): UseAutoRechargeReturn;
|
|
879
|
+
|
|
852
880
|
/**
|
|
853
881
|
* Returns the effective data-access transport for the current provider.
|
|
854
882
|
*
|
|
@@ -1168,9 +1196,10 @@ declare const DEFAULT_ROUTES: {
|
|
|
1168
1196
|
readonly getProduct: "/api/get-product";
|
|
1169
1197
|
readonly listPlans: "/api/list-plans";
|
|
1170
1198
|
readonly getPaymentMethod: "/api/payment-method";
|
|
1199
|
+
readonly autoRecharge: "/api/auto-recharge";
|
|
1171
1200
|
readonly getUsage: "/api/usage";
|
|
1172
1201
|
readonly getLimits: "/api/limits";
|
|
1173
1202
|
};
|
|
1174
1203
|
declare function createHttpTransport(config: SolvaPayConfig | undefined): SolvaPayTransport;
|
|
1175
1204
|
|
|
1176
|
-
export { ActivatePlanResult, ActivationFlow, type ActivationFlowProps, ActivationResult, type ActivationState, AmountPicker, type AmountPickerProps, BalanceStatus, CancelResult, CancelledPlanNotice, type CancelledPlanNoticeProps, CheckoutLayout, type CheckoutLayoutPlanSelectorOptions, type CheckoutLayoutProps, type CheckoutLayoutSize, CheckoutResult, CheckoutVariant, type ConfirmPaymentInput, type ConfirmPaymentMode, type ConfirmPaymentResult, CopyContext, CopyProvider, CreditGate, type CreditGateProps, CurrentPlanCard, type CurrentPlanCardClassNames, type CurrentPlanCardProps, type CustomerInfo, DEFAULT_ROUTES, type FormatPriceOptions, LaunchCustomerPortalButton, type LaunchCustomerPortalButtonProps, PartialSolvaPayCopy, type PaymentElementKind, PaymentForm, PaymentFormContext, type PaymentFormContextValue, PaymentFormProps, PaymentFormProvider, Plan, PlanSelector, type PlanSelectorProps, PrefillCustomer, Product, type PurchaseActions, PurchaseInfo, PurchaseStatus, PurchaseStatusReturn, ReactivateResult, SolvaPayConfig, SolvaPayContextValue, SolvaPayCopy, SolvaPayProvider, SolvaPayProviderProps, SolvaPayTransport, Spinner, StripePaymentFormWrapper, TopupForm, TopupFormProps, UpdatePaymentMethodButton, type UpdatePaymentMethodButtonMode, type UpdatePaymentMethodButtonProps, type UseActivationReturn, type UseAutoActivateFreePlanOptions, type UseAutoActivateFreePlanReturn, type UseLimitsOptions, type UseLimitsReturn, UseMerchantReturn, UsePaymentMethodReturn, type UsePaywallResolverReturn, UsePlanOptions, UsePlanReturn, UsePlansOptions, UsePlansReturn, UseProductReturn, UseTopupAmountSelectorOptions, UseTopupAmountSelectorReturn, UseTopupOptions, UseTopupReturn, confirmPayment, createHttpTransport, enCopy, filterPurchases, formatPrice, getActivePurchases, getCancelledPurchasesWithEndDate, getMinorUnitsPerMajor, getMostRecentPurchase, getPrimaryPurchase, interpolate, isPaidPurchase, isPlanPurchase, isTopupPurchase, mergeCopy, resolveCta, toMajorUnits, useActivation, useAutoActivateFreePlan, useBalance, useCheckout, useCopy, useCustomer, useLimits, useLocale, useMerchant, usePaymentForm, usePaymentMethod, usePaywallResolver, usePlan, usePlans, useProduct, usePurchase, usePurchaseActions, usePurchaseStatus, useSolvaPay, useTopup, useTopupAmountSelector, useTransport };
|
|
1205
|
+
export { ActivatePlanResult, ActivationFlow, type ActivationFlowProps, ActivationResult, type ActivationState, AmountPicker, type AmountPickerProps, AutoRecharge, type AutoRechargeProps, BalanceStatus, CancelResult, CancelledPlanNotice, type CancelledPlanNoticeProps, CheckoutLayout, type CheckoutLayoutPlanSelectorOptions, type CheckoutLayoutProps, type CheckoutLayoutSize, CheckoutResult, CheckoutVariant, type ConfirmPaymentInput, type ConfirmPaymentMode, type ConfirmPaymentResult, CopyContext, CopyProvider, CreditGate, type CreditGateProps, CurrentPlanCard, type CurrentPlanCardClassNames, type CurrentPlanCardProps, type CustomerInfo, DEFAULT_ROUTES, type FormatPriceOptions, LaunchCustomerPortalButton, type LaunchCustomerPortalButtonProps, PartialSolvaPayCopy, type PaymentElementKind, PaymentForm, PaymentFormContext, type PaymentFormContextValue, PaymentFormProps, PaymentFormProvider, Plan, PlanSelector, type PlanSelectorProps, PrefillCustomer, Product, type PurchaseActions, PurchaseInfo, PurchaseStatus, PurchaseStatusReturn, ReactivateResult, SolvaPayConfig, SolvaPayContextValue, SolvaPayCopy, SolvaPayProvider, SolvaPayProviderProps, SolvaPayTransport, Spinner, StripePaymentFormWrapper, TopupForm, TopupFormProps, UpdatePaymentMethodButton, type UpdatePaymentMethodButtonMode, type UpdatePaymentMethodButtonProps, type UseActivationReturn, type UseAutoActivateFreePlanOptions, type UseAutoActivateFreePlanReturn, type UseLimitsOptions, type UseLimitsReturn, UseMerchantReturn, UsePaymentMethodReturn, type UsePaywallResolverReturn, UsePlanOptions, UsePlanReturn, UsePlansOptions, UsePlansReturn, UseProductReturn, UseTopupAmountSelectorOptions, UseTopupAmountSelectorReturn, UseTopupOptions, UseTopupReturn, confirmPayment, createHttpTransport, enCopy, filterPurchases, formatPrice, getActivePurchases, getCancelledPurchasesWithEndDate, getMinorUnitsPerMajor, getMostRecentPurchase, getPrimaryPurchase, interpolate, isPaidPurchase, isPlanPurchase, isTopupPurchase, mergeCopy, resolveCta, toMajorUnits, useActivation, useAutoActivateFreePlan, useAutoRecharge, useBalance, useCheckout, useCopy, useCustomer, useLimits, useLocale, useMerchant, usePaymentForm, usePaymentMethod, usePaywallResolver, usePlan, usePlans, useProduct, usePurchase, usePurchaseActions, usePurchaseStatus, useSolvaPay, useTopup, useTopupAmountSelector, useTransport };
|
package/dist/index.js
CHANGED
|
@@ -7,20 +7,23 @@ import {
|
|
|
7
7
|
LaunchCustomerPortalButton,
|
|
8
8
|
UpdatePaymentMethodButton,
|
|
9
9
|
usePaymentMethod
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SUHDOG7Q.js";
|
|
11
11
|
import {
|
|
12
12
|
ActivationFlow,
|
|
13
|
+
AutoRecharge,
|
|
13
14
|
CheckoutSteps,
|
|
14
15
|
CreditGate,
|
|
15
16
|
PlanBadge,
|
|
16
17
|
ProductBadge,
|
|
17
18
|
PurchaseGate,
|
|
18
19
|
TopupForm,
|
|
20
|
+
configToAutoRechargeInput,
|
|
19
21
|
useActivationFlow,
|
|
22
|
+
useAutoRecharge,
|
|
20
23
|
useCheckoutSteps,
|
|
21
24
|
useCreditGate,
|
|
22
25
|
usePaywallResolver
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GFWMLRR3.js";
|
|
24
27
|
import {
|
|
25
28
|
AmountPicker,
|
|
26
29
|
BalanceBadge,
|
|
@@ -88,13 +91,14 @@ import {
|
|
|
88
91
|
useTopupAmountSelector,
|
|
89
92
|
useTransport,
|
|
90
93
|
useUsage
|
|
91
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-6RR4J74H.js";
|
|
92
95
|
import {
|
|
93
96
|
createAnonymousAuthAdapter,
|
|
94
97
|
defaultAuthAdapter,
|
|
95
98
|
getOrCreateAnonymousCustomerRef,
|
|
96
99
|
resetAnonymousCustomerRef
|
|
97
100
|
} from "./chunk-UMXOAUW7.js";
|
|
101
|
+
import "./chunk-MLKGABMK.js";
|
|
98
102
|
|
|
99
103
|
// src/PaymentForm.tsx
|
|
100
104
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -717,6 +721,62 @@ var CreditGate2 = ({
|
|
|
717
721
|
);
|
|
718
722
|
};
|
|
719
723
|
|
|
724
|
+
// src/components/AutoRecharge.tsx
|
|
725
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
726
|
+
function AutoRecharge2({
|
|
727
|
+
currency = "USD",
|
|
728
|
+
defaultThresholdAmountMajor,
|
|
729
|
+
defaultTopupAmountMajor,
|
|
730
|
+
onSetupRequired,
|
|
731
|
+
onSaved,
|
|
732
|
+
onDisabled,
|
|
733
|
+
deferCardSetup,
|
|
734
|
+
onPendingConfig,
|
|
735
|
+
className
|
|
736
|
+
}) {
|
|
737
|
+
const rootClass = ["solvapay-auto-recharge", className].filter(Boolean).join(" ");
|
|
738
|
+
return /* @__PURE__ */ jsxs8(
|
|
739
|
+
AutoRecharge.Root,
|
|
740
|
+
{
|
|
741
|
+
currency,
|
|
742
|
+
defaultThresholdAmountMajor,
|
|
743
|
+
defaultTopupAmountMajor,
|
|
744
|
+
onSetupRequired,
|
|
745
|
+
onSaved,
|
|
746
|
+
onDisabled,
|
|
747
|
+
deferCardSetup,
|
|
748
|
+
onPendingConfig,
|
|
749
|
+
className: rootClass,
|
|
750
|
+
children: [
|
|
751
|
+
/* @__PURE__ */ jsx8(AutoRecharge.Loading, { className: "solvapay-auto-recharge-loading" }),
|
|
752
|
+
/* @__PURE__ */ jsxs8(AutoRecharge.Card, { className: "solvapay-auto-recharge-card", children: [
|
|
753
|
+
/* @__PURE__ */ jsx8(AutoRecharge.CardHeading, { className: "solvapay-auto-recharge-card-heading" }),
|
|
754
|
+
/* @__PURE__ */ jsx8(AutoRecharge.CardSummary, { className: "solvapay-auto-recharge-card-summary" }),
|
|
755
|
+
/* @__PURE__ */ jsx8(AutoRecharge.StatusMessage, { className: "solvapay-auto-recharge-status-message" }),
|
|
756
|
+
/* @__PURE__ */ jsx8(AutoRecharge.Status, { className: "solvapay-auto-recharge-status" }),
|
|
757
|
+
/* @__PURE__ */ jsx8(AutoRecharge.Trigger, { className: "solvapay-auto-recharge-trigger" })
|
|
758
|
+
] }),
|
|
759
|
+
/* @__PURE__ */ jsx8(AutoRecharge.Error, { className: "solvapay-auto-recharge-error" }),
|
|
760
|
+
/* @__PURE__ */ jsxs8(AutoRecharge.Content, { className: "solvapay-auto-recharge-content", children: [
|
|
761
|
+
/* @__PURE__ */ jsx8(AutoRecharge.Title, { className: "solvapay-auto-recharge-title" }),
|
|
762
|
+
/* @__PURE__ */ jsx8(AutoRecharge.EnableQuestion, { className: "solvapay-auto-recharge-question" }),
|
|
763
|
+
/* @__PURE__ */ jsx8(AutoRecharge.EnableRow, { className: "solvapay-auto-recharge-enable-row" }),
|
|
764
|
+
/* @__PURE__ */ jsxs8(AutoRecharge.Fields, { className: "solvapay-auto-recharge-fields", children: [
|
|
765
|
+
/* @__PURE__ */ jsx8(AutoRecharge.ThresholdField, {}),
|
|
766
|
+
/* @__PURE__ */ jsx8(AutoRecharge.TopupField, { className: "solvapay-auto-recharge-topup-field" }),
|
|
767
|
+
/* @__PURE__ */ jsx8(AutoRecharge.ValidationError, { className: "solvapay-auto-recharge-validation-error" })
|
|
768
|
+
] }),
|
|
769
|
+
/* @__PURE__ */ jsx8(AutoRecharge.Setup, {}),
|
|
770
|
+
/* @__PURE__ */ jsxs8(AutoRecharge.Actions, { className: "solvapay-auto-recharge-actions", children: [
|
|
771
|
+
/* @__PURE__ */ jsx8(AutoRecharge.CancelButton, { className: "solvapay-auto-recharge-cancel" }),
|
|
772
|
+
/* @__PURE__ */ jsx8(AutoRecharge.SaveButton, { className: "solvapay-auto-recharge-save" })
|
|
773
|
+
] })
|
|
774
|
+
] })
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
|
|
720
780
|
// src/hooks/useLimits.ts
|
|
721
781
|
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState3 } from "react";
|
|
722
782
|
var CACHE_TTL_MS = 1e4;
|
|
@@ -923,6 +983,7 @@ var UnsupportedTransportMethodError = class extends Error {
|
|
|
923
983
|
export {
|
|
924
984
|
ActivationFlow2 as ActivationFlow,
|
|
925
985
|
AmountPicker2 as AmountPicker,
|
|
986
|
+
AutoRecharge2 as AutoRecharge,
|
|
926
987
|
BalanceBadge,
|
|
927
988
|
CancelPlanButton,
|
|
928
989
|
CancelledPlanNotice,
|
|
@@ -949,6 +1010,7 @@ export {
|
|
|
949
1010
|
TopupForm,
|
|
950
1011
|
UnsupportedTransportMethodError,
|
|
951
1012
|
UpdatePaymentMethodButton,
|
|
1013
|
+
configToAutoRechargeInput,
|
|
952
1014
|
confirmPayment,
|
|
953
1015
|
createAnonymousAuthAdapter,
|
|
954
1016
|
createHttpTransport,
|
|
@@ -974,6 +1036,7 @@ export {
|
|
|
974
1036
|
toMajorUnits,
|
|
975
1037
|
useActivation,
|
|
976
1038
|
useAutoActivateFreePlan,
|
|
1039
|
+
useAutoRecharge,
|
|
977
1040
|
useBalance,
|
|
978
1041
|
useCheckout,
|
|
979
1042
|
useCheckoutFlow,
|