@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.
@@ -1,4 +1,4 @@
1
- import { Y as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, q as UseTopupAmountSelectorReturn, y as CheckoutStep, K as SuccessMeta } from './shared-DpS2yEah.cjs';
1
+ import { Y as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, q as UseTopupAmountSelectorReturn, y as CheckoutStep, K as SuccessMeta } from './shared-lIhc8DS3.js';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -534,11 +534,12 @@ interface UseCheckoutFlowReturn {
534
534
  /** Returns the active branch — `null` when no plan is selected. */
535
535
  branch: 'payg' | 'recurring' | null;
536
536
  /**
537
- * Currency for the PAYG topup branch, resolved from the
538
- * `topupCurrency` option (when set) or `merchant.defaultCurrency`.
537
+ * Currency for the PAYG topup branch, resolved in order:
538
+ * top-up step override plan-picker `preferredCurrency` (when
539
+ * supported) → `topupCurrency` option or `merchant.defaultCurrency`.
539
540
  * `null` while the merchant is still loading and no explicit
540
- * option was passed. **Plan currency is never consulted** — credit
541
- * topups are merchant-wide, not plan-specific.
541
+ * option was passed. Plan `currency` / `selectedCurrency` are never
542
+ * consulted — credit topups are merchant-wide, not plan-specific.
542
543
  */
543
544
  topupCurrency: string | null;
544
545
  /**
@@ -547,6 +548,20 @@ interface UseCheckoutFlowReturn {
547
548
  * misleading default while the merchant fetch is in flight.
548
549
  */
549
550
  topupCurrencyReady: boolean;
551
+ /**
552
+ * Full set of currencies the customer may pay topups in — the
553
+ * merchant's `supportedTopupCurrencies` (which already includes the
554
+ * default) or, for single-currency merchants, just the resolved
555
+ * `topupCurrency`. Always uppercased and deduped. The amount step
556
+ * renders a switcher only when this has more than one entry.
557
+ */
558
+ topupCurrencies: string[];
559
+ /**
560
+ * Override the topup currency from a picker. Accepts any code in
561
+ * `topupCurrencies`; ignored otherwise. Resets to the merchant default
562
+ * resolution on `reset()`.
563
+ */
564
+ setTopupCurrency: (code: string) => void;
550
565
  /**
551
566
  * Whether the current step has a meaningful previous step to return
552
567
  * to. `<CheckoutSteps.BackLink>` reads this to suppress itself when
@@ -1,4 +1,4 @@
1
- import { Y as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, q as UseTopupAmountSelectorReturn, y as CheckoutStep, K as SuccessMeta } from './shared-CXRbrNFw.js';
1
+ import { Y as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, q as UseTopupAmountSelectorReturn, y as CheckoutStep, K as SuccessMeta } from './shared-BNZAIWkU.cjs';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -534,11 +534,12 @@ interface UseCheckoutFlowReturn {
534
534
  /** Returns the active branch — `null` when no plan is selected. */
535
535
  branch: 'payg' | 'recurring' | null;
536
536
  /**
537
- * Currency for the PAYG topup branch, resolved from the
538
- * `topupCurrency` option (when set) or `merchant.defaultCurrency`.
537
+ * Currency for the PAYG topup branch, resolved in order:
538
+ * top-up step override plan-picker `preferredCurrency` (when
539
+ * supported) → `topupCurrency` option or `merchant.defaultCurrency`.
539
540
  * `null` while the merchant is still loading and no explicit
540
- * option was passed. **Plan currency is never consulted** — credit
541
- * topups are merchant-wide, not plan-specific.
541
+ * option was passed. Plan `currency` / `selectedCurrency` are never
542
+ * consulted — credit topups are merchant-wide, not plan-specific.
542
543
  */
543
544
  topupCurrency: string | null;
544
545
  /**
@@ -547,6 +548,20 @@ interface UseCheckoutFlowReturn {
547
548
  * misleading default while the merchant fetch is in flight.
548
549
  */
549
550
  topupCurrencyReady: boolean;
551
+ /**
552
+ * Full set of currencies the customer may pay topups in — the
553
+ * merchant's `supportedTopupCurrencies` (which already includes the
554
+ * default) or, for single-currency merchants, just the resolved
555
+ * `topupCurrency`. Always uppercased and deduped. The amount step
556
+ * renders a switcher only when this has more than one entry.
557
+ */
558
+ topupCurrencies: string[];
559
+ /**
560
+ * Override the topup currency from a picker. Accepts any code in
561
+ * `topupCurrencies`; ignored otherwise. Resets to the merchant default
562
+ * resolution on `reset()`.
563
+ */
564
+ setTopupCurrency: (code: string) => void;
550
565
  /**
551
566
  * Whether the current step has a meaningful previous step to return
552
567
  * to. `<CheckoutSteps.BackLink>` reads this to suppress itself when