@solvapay/react 1.2.1 → 1.3.0-preview-cb8ad16e16ce8f8f357bd7f2e7068d85159df587

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/dist/index.d.cts CHANGED
@@ -1,10 +1,11 @@
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 PurchaseStatus, d as SolvaPayContextValue, U as UsePlansOptions, e as UsePlansReturn, f as UsePlanOptions, g as UsePlanReturn, h as UseProductReturn, i as UseMerchantReturn, j as SolvaPayCopy, k as PurchaseStatusReturn, l as CancelResult, R as ReactivateResult, m as ActivatePlanResult, n as UseTopupOptions, o as UseTopupReturn, B as BalanceStatus, p as UseTopupAmountSelectorOptions, q as UseTopupAmountSelectorReturn, r as UsePaymentMethodReturn, s as SolvaPayTransport, t as PartialSolvaPayCopy, u as PurchaseInfo, v as Product, w as SolvaPayConfig } from './shared-DpS2yEah.cjs';
3
- export { x as BootstrapPlanLike, y as CheckoutStep, z as CustomerPurchaseData, M as MandateContext, D as MandateTemplate, E as Merchant, F as PaymentError, G as PaymentIntentResult, H as PaymentMethodInfo, I as PaymentResult, J as PurchaseStatusValue, K as SuccessMeta, L as TopupPaymentResult, N as TransportBalanceResult, O as TransportCheckoutSessionResult, Q as TransportCustomerSessionResult, V as TransportLimitsResult, W as UnsupportedTransportMethodError } from './shared-DpS2yEah.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 PaywallStructuredContent, C as CheckoutVariant } from './index-DPoqku6R.cjs';
5
- export { A as ActivationFlowStep, B as BalanceBadge, k as CancelPlanButton, l as CheckoutErrorPhase, m as CheckoutStatus, n as CheckoutSteps, o as CheckoutSummary, p as CheckoutSummaryProps, M as MandateText, q as MandateTextProps, r as PlanBadge, s as ProductBadge, t as PurchaseGate, U as UsageSnapshot, u as UseCheckoutFlowOptions, v as UseCheckoutFlowReturn, w as UseUsageReturn, x as deriveVariant, y as useCheckoutFlow, z as useCheckoutStepsContext, D as useUsage } from './index-DPoqku6R.cjs';
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 PurchaseStatus, d as SolvaPayContextValue, U as UsePlansOptions, e as UsePlansReturn, f as UsePlanOptions, g as UsePlanReturn, h as UseProductReturn, i as UseMerchantReturn, j as SolvaPayCopy, k as PurchaseStatusReturn, l as CancelResult, R as ReactivateResult, m as ActivatePlanResult, n as UseTopupOptions, o as UseTopupReturn, B as BalanceStatus, p as UseTopupAmountSelectorOptions, q as UseTopupAmountSelectorReturn, r as UsePaymentMethodReturn, s as SolvaPayTransport, t as PartialSolvaPayCopy, u as PurchaseInfo, v as Product, w as SolvaPayConfig } from './shared-BNZAIWkU.cjs';
3
+ export { x as BootstrapPlanLike, y as CheckoutStep, z as CustomerPurchaseData, M as MandateContext, D as MandateTemplate, E as Merchant, F as PaymentError, G as PaymentIntentResult, H as PaymentMethodInfo, I as PaymentResult, J as PurchaseStatusValue, K as SuccessMeta, L as TopupPaymentResult, N as TransportBalanceResult, O as TransportCheckoutSessionResult, Q as TransportCustomerSessionResult, V as TransportLimitsResult, W as UnsupportedTransportMethodError } from './shared-BNZAIWkU.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 PaywallStructuredContent, C as CheckoutVariant } from './index-kXLvp7EU.cjs';
5
+ export { A as ActivationFlowStep, B as BalanceBadge, k as CancelPlanButton, l as CheckoutErrorPhase, m as CheckoutStatus, n as CheckoutSteps, o as CheckoutSummary, p as CheckoutSummaryProps, M as MandateText, q as MandateTextProps, r as PlanBadge, s as ProductBadge, t as PurchaseGate, U as UsageSnapshot, u as UseCheckoutFlowOptions, v as UseCheckoutFlowReturn, w as UseUsageReturn, x as deriveVariant, y as useCheckoutFlow, z as useCheckoutStepsContext, D as useUsage } from './index-kXLvp7EU.cjs';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.cjs';
8
+ export { SessionAuthAdapterOptions, createSessionAuthAdapter } from './adapters/session-auth.cjs';
8
9
  import '@stripe/react-stripe-js';
9
10
  import 'react/jsx-runtime';
10
11
 
@@ -603,6 +604,7 @@ interface UseCheckoutReturn {
603
604
  declare function useCheckout(options: {
604
605
  planRef?: string;
605
606
  productRef?: string;
607
+ currency?: string;
606
608
  customer?: PrefillCustomer;
607
609
  }): UseCheckoutReturn;
608
610
 
@@ -1069,6 +1071,8 @@ type FormatPriceOptions = {
1069
1071
  * Pass `''` to disable the zero-check and always render the numeric zero.
1070
1072
  */
1071
1073
  free?: string;
1074
+ /** `symbol` (default) or `code` (e.g. USD 10 instead of $10). */
1075
+ currencyDisplay?: 'symbol' | 'code';
1072
1076
  };
1073
1077
  /**
1074
1078
  * Number of minor units per one major unit of `currency`. 1 for zero-decimal
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
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 PurchaseStatus, d as SolvaPayContextValue, U as UsePlansOptions, e as UsePlansReturn, f as UsePlanOptions, g as UsePlanReturn, h as UseProductReturn, i as UseMerchantReturn, j as SolvaPayCopy, k as PurchaseStatusReturn, l as CancelResult, R as ReactivateResult, m as ActivatePlanResult, n as UseTopupOptions, o as UseTopupReturn, B as BalanceStatus, p as UseTopupAmountSelectorOptions, q as UseTopupAmountSelectorReturn, r as UsePaymentMethodReturn, s as SolvaPayTransport, t as PartialSolvaPayCopy, u as PurchaseInfo, v as Product, w as SolvaPayConfig } from './shared-CXRbrNFw.js';
3
- export { x as BootstrapPlanLike, y as CheckoutStep, z as CustomerPurchaseData, M as MandateContext, D as MandateTemplate, E as Merchant, F as PaymentError, G as PaymentIntentResult, H as PaymentMethodInfo, I as PaymentResult, J as PurchaseStatusValue, K as SuccessMeta, L as TopupPaymentResult, N as TransportBalanceResult, O as TransportCheckoutSessionResult, Q as TransportCustomerSessionResult, V as TransportLimitsResult, W as UnsupportedTransportMethodError } from './shared-CXRbrNFw.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 PaywallStructuredContent, C as CheckoutVariant } from './index-Cs-QqpkJ.js';
5
- export { A as ActivationFlowStep, B as BalanceBadge, k as CancelPlanButton, l as CheckoutErrorPhase, m as CheckoutStatus, n as CheckoutSteps, o as CheckoutSummary, p as CheckoutSummaryProps, M as MandateText, q as MandateTextProps, r as PlanBadge, s as ProductBadge, t as PurchaseGate, U as UsageSnapshot, u as UseCheckoutFlowOptions, v as UseCheckoutFlowReturn, w as UseUsageReturn, x as deriveVariant, y as useCheckoutFlow, z as useCheckoutStepsContext, D as useUsage } from './index-Cs-QqpkJ.js';
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 PurchaseStatus, d as SolvaPayContextValue, U as UsePlansOptions, e as UsePlansReturn, f as UsePlanOptions, g as UsePlanReturn, h as UseProductReturn, i as UseMerchantReturn, j as SolvaPayCopy, k as PurchaseStatusReturn, l as CancelResult, R as ReactivateResult, m as ActivatePlanResult, n as UseTopupOptions, o as UseTopupReturn, B as BalanceStatus, p as UseTopupAmountSelectorOptions, q as UseTopupAmountSelectorReturn, r as UsePaymentMethodReturn, s as SolvaPayTransport, t as PartialSolvaPayCopy, u as PurchaseInfo, v as Product, w as SolvaPayConfig } from './shared-lIhc8DS3.js';
3
+ export { x as BootstrapPlanLike, y as CheckoutStep, z as CustomerPurchaseData, M as MandateContext, D as MandateTemplate, E as Merchant, F as PaymentError, G as PaymentIntentResult, H as PaymentMethodInfo, I as PaymentResult, J as PurchaseStatusValue, K as SuccessMeta, L as TopupPaymentResult, N as TransportBalanceResult, O as TransportCheckoutSessionResult, Q as TransportCustomerSessionResult, V as TransportLimitsResult, W as UnsupportedTransportMethodError } from './shared-lIhc8DS3.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 PaywallStructuredContent, C as CheckoutVariant } from './index-BwwdMBdt.js';
5
+ export { A as ActivationFlowStep, B as BalanceBadge, k as CancelPlanButton, l as CheckoutErrorPhase, m as CheckoutStatus, n as CheckoutSteps, o as CheckoutSummary, p as CheckoutSummaryProps, M as MandateText, q as MandateTextProps, r as PlanBadge, s as ProductBadge, t as PurchaseGate, U as UsageSnapshot, u as UseCheckoutFlowOptions, v as UseCheckoutFlowReturn, w as UseUsageReturn, x as deriveVariant, y as useCheckoutFlow, z as useCheckoutStepsContext, D as useUsage } from './index-BwwdMBdt.js';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.js';
8
+ export { SessionAuthAdapterOptions, createSessionAuthAdapter } from './adapters/session-auth.js';
8
9
  import '@stripe/react-stripe-js';
9
10
  import 'react/jsx-runtime';
10
11
 
@@ -603,6 +604,7 @@ interface UseCheckoutReturn {
603
604
  declare function useCheckout(options: {
604
605
  planRef?: string;
605
606
  productRef?: string;
607
+ currency?: string;
606
608
  customer?: PrefillCustomer;
607
609
  }): UseCheckoutReturn;
608
610
 
@@ -1069,6 +1071,8 @@ type FormatPriceOptions = {
1069
1071
  * Pass `''` to disable the zero-check and always render the numeric zero.
1070
1072
  */
1071
1073
  free?: string;
1074
+ /** `symbol` (default) or `code` (e.g. USD 10 instead of $10). */
1075
+ currencyDisplay?: 'symbol' | 'code';
1072
1076
  };
1073
1077
  /**
1074
1078
  * Number of minor units per one major unit of `currency`. 1 for zero-decimal
package/dist/index.js CHANGED
@@ -1,10 +1,13 @@
1
+ import {
2
+ createSessionAuthAdapter
3
+ } from "./chunk-JTW665JR.js";
1
4
  import {
2
5
  CancelledPlanNotice,
3
6
  CurrentPlanCard,
4
7
  LaunchCustomerPortalButton,
5
8
  UpdatePaymentMethodButton,
6
9
  usePaymentMethod
7
- } from "./chunk-XRNCDI2T.js";
10
+ } from "./chunk-3UR4QQ5P.js";
8
11
  import {
9
12
  ActivationFlow,
10
13
  CheckoutSteps,
@@ -17,7 +20,7 @@ import {
17
20
  useCheckoutSteps,
18
21
  useCreditGate,
19
22
  usePaywallResolver
20
- } from "./chunk-MYD6KTR2.js";
23
+ } from "./chunk-WGDHMTDO.js";
21
24
  import {
22
25
  AmountPicker,
23
26
  BalanceBadge,
@@ -85,7 +88,7 @@ import {
85
88
  useTopupAmountSelector,
86
89
  useTransport,
87
90
  useUsage
88
- } from "./chunk-Y2UAJG67.js";
91
+ } from "./chunk-ORMHGGOU.js";
89
92
  import {
90
93
  createAnonymousAuthAdapter,
91
94
  defaultAuthAdapter,
@@ -290,6 +293,7 @@ import { useCallback, useContext, useEffect, useMemo, useRef, useState as useSta
290
293
  import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
291
294
  var DefaultTree2 = () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
292
295
  /* @__PURE__ */ jsx3(PlanSelector.Heading, { className: "solvapay-plan-selector-heading" }),
296
+ /* @__PURE__ */ jsx3(PlanSelector.CurrencySwitcher, { className: "solvapay-plan-selector-currency-switcher" }),
293
297
  /* @__PURE__ */ jsx3(PlanSelector.Grid, { className: "solvapay-plan-selector-grid", children: /* @__PURE__ */ jsxs3(PlanSelector.Card, { className: "solvapay-plan-selector-card", children: [
294
298
  /* @__PURE__ */ jsx3(PlanSelector.CardBadge, { className: "solvapay-plan-selector-card-badge" }),
295
299
  /* @__PURE__ */ jsx3(PlanSelector.CardName, { className: "solvapay-plan-selector-card-name" }),
@@ -948,6 +952,7 @@ export {
948
952
  confirmPayment,
949
953
  createAnonymousAuthAdapter,
950
954
  createHttpTransport,
955
+ createSessionAuthAdapter,
951
956
  defaultAuthAdapter,
952
957
  deriveVariant,
953
958
  enCopy,