@doujins/payments-ui 0.0.12 → 0.0.14

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,9 +1,9 @@
1
1
  import React$1 from 'react';
2
- import { StoreApi } from 'zustand';
2
+ import * as _solana_wallet_adapter_base from '@solana/wallet-adapter-base';
3
+ import * as _tanstack_react_query from '@tanstack/react-query';
4
+ import { QueryClient } from '@tanstack/react-query';
3
5
  import { PublicKey } from '@solana/web3.js';
4
- import * as zustand_vanilla from 'zustand/vanilla';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import * as _tanstack_react_query from '@tanstack/react-query';
7
7
 
8
8
  type AuthTokenProvider = (() => string | null | undefined) | (() => Promise<string | null | undefined>) | null | undefined;
9
9
  interface PaymentUserDetails {
@@ -28,6 +28,12 @@ interface PaymentFeatureFlags {
28
28
  enableSolanaPay?: boolean;
29
29
  enableDirectWallet?: boolean;
30
30
  }
31
+ interface PaymentSolanaConfig {
32
+ endpoint?: string;
33
+ network?: _solana_wallet_adapter_base.WalletAdapterNetwork;
34
+ autoConnect?: boolean;
35
+ wallets?: _solana_wallet_adapter_base.WalletAdapter[];
36
+ }
31
37
  interface PaymentCallbacks {
32
38
  onStatusChange?: (payload: PaymentStatusPayload) => void;
33
39
  onSuccess?: (payload: PaymentSuccessPayload) => void;
@@ -54,6 +60,7 @@ interface PaymentConfig {
54
60
  callbacks?: PaymentCallbacks;
55
61
  collectJsKey?: string;
56
62
  solanaRpcUrl?: string;
63
+ solana?: PaymentSolanaConfig;
57
64
  }
58
65
  type NotificationStatus = 'default' | 'success' | 'info' | 'destructive';
59
66
  interface NotificationPayload {
@@ -492,46 +499,14 @@ declare class PaymentApp {
492
499
  resolveAuthToken: () => Promise<string | null>;
493
500
  }
494
501
 
495
- type AsyncStatus = 'idle' | 'processing' | 'success' | 'error';
496
- type SolanaFlowState = 'selecting' | 'processing' | 'confirming' | 'success' | 'error';
497
- interface PaymentStoreState {
498
- selectedMethodId: string | null;
499
- solanaModalOpen: boolean;
500
- savedPaymentStatus: AsyncStatus;
501
- savedPaymentError: string | null;
502
- newCardStatus: AsyncStatus;
503
- newCardError: string | null;
504
- solanaTab: 'wallet' | 'qr';
505
- solanaStatus: SolanaFlowState;
506
- solanaError: string | null;
507
- solanaTransactionId: string | null;
508
- solanaSelectedToken: string | null;
509
- solanaTokenAmount: number;
510
- setSelectedMethod: (methodId: string | null) => void;
511
- setSolanaModalOpen: (open: boolean) => void;
512
- setSolanaTab: (tab: 'wallet' | 'qr') => void;
513
- setSolanaSelectedToken: (symbol: string) => void;
514
- setSolanaTokenAmount: (amount: number) => void;
515
- setSolanaTransactionId: (txId: string | null) => void;
516
- startSavedPayment: () => void;
517
- completeSavedPayment: () => void;
518
- failSavedPayment: (error: string) => void;
519
- resetSavedPayment: () => void;
520
- startNewCardPayment: () => void;
521
- completeNewCardPayment: () => void;
522
- failNewCardPayment: (error: string) => void;
523
- resetNewCardPayment: () => void;
524
- startSolanaPayment: () => void;
525
- confirmSolanaPayment: () => void;
526
- completeSolanaPayment: (payload?: PaymentSuccessPayload) => void;
527
- failSolanaPayment: (error: string) => void;
528
- resetSolanaPayment: () => void;
529
- resetAll: () => void;
530
- }
531
- interface PaymentStoreOptions {
532
- callbacks?: PaymentCallbacks;
502
+ declare class PaymentsRuntime {
503
+ readonly config: PaymentConfig;
504
+ readonly app: PaymentApp;
505
+ readonly services: PaymentServices;
506
+ readonly queryClient: QueryClient;
507
+ constructor(config: PaymentConfig);
533
508
  }
534
- declare const createPaymentStore: (options?: PaymentStoreOptions) => zustand_vanilla.StoreApi<PaymentStoreState>;
509
+ declare const createPaymentsRuntime: (config: PaymentConfig) => PaymentsRuntime;
535
510
 
536
511
  interface PaymentContextValue {
537
512
  config: PaymentConfig;
@@ -539,15 +514,78 @@ interface PaymentContextValue {
539
514
  resolveAuthToken: () => Promise<string | null>;
540
515
  app: PaymentApp;
541
516
  services: PaymentServices;
542
- store: StoreApi<PaymentStoreState>;
517
+ queryClient: PaymentsRuntime['queryClient'];
543
518
  }
544
519
  interface PaymentProviderProps {
545
520
  config: PaymentConfig;
546
521
  children: React$1.ReactNode;
522
+ runtime?: PaymentsRuntime;
547
523
  }
548
524
  declare const PaymentProvider: React$1.FC<PaymentProviderProps>;
549
525
  declare const usePaymentContext: () => PaymentContextValue;
550
526
 
527
+ interface SubscriptionCheckoutModalProps {
528
+ open: boolean;
529
+ onOpenChange: (open: boolean) => void;
530
+ priceId?: string | null;
531
+ usdAmount?: number;
532
+ planName?: string;
533
+ amountLabel?: string;
534
+ billingPeriodLabel?: string;
535
+ userEmail?: string | null;
536
+ provider?: string;
537
+ onSuccess?: () => void;
538
+ enableSolanaPay?: boolean;
539
+ onSolanaSuccess?: (result: SubmitPaymentResponse | string) => void;
540
+ onSolanaError?: (error: string) => void;
541
+ initialMode?: 'cards' | 'solana';
542
+ }
543
+ declare const SubscriptionCheckoutModal: React$1.FC<SubscriptionCheckoutModalProps>;
544
+
545
+ interface SolanaPaymentViewProps {
546
+ priceId: string;
547
+ usdAmount: number;
548
+ onSuccess: (result: SubmitPaymentResponse | string) => void;
549
+ onError?: (error: string) => void;
550
+ onClose?: () => void;
551
+ }
552
+ declare const SolanaPaymentView: React$1.FC<SolanaPaymentViewProps>;
553
+
554
+ interface SolanaPaymentSelectorProps extends SolanaPaymentViewProps {
555
+ isOpen: boolean;
556
+ onClose: () => void;
557
+ }
558
+ declare const SolanaPaymentSelector: React$1.FC<SolanaPaymentSelectorProps>;
559
+
560
+ interface WalletModalProps {
561
+ open: boolean;
562
+ onOpenChange: (open: boolean) => void;
563
+ }
564
+ declare const WalletModal: React.FC<WalletModalProps>;
565
+
566
+ type CheckoutOptions = Omit<SubscriptionCheckoutModalProps, 'open' | 'onOpenChange'>;
567
+ type SolanaOptions = Omit<SolanaPaymentSelectorProps, 'isOpen' | 'onClose'>;
568
+ type WalletOptions = Omit<WalletModalProps, 'open' | 'onOpenChange'>;
569
+ interface PaymentsDialogContextValue {
570
+ checkout: {
571
+ open: (options: CheckoutOptions) => void;
572
+ close: () => void;
573
+ isOpen: boolean;
574
+ };
575
+ solana: {
576
+ open: (options: SolanaOptions) => void;
577
+ close: () => void;
578
+ isOpen: boolean;
579
+ };
580
+ wallet: {
581
+ open: (options?: WalletOptions) => void;
582
+ close: () => void;
583
+ isOpen: boolean;
584
+ };
585
+ }
586
+ declare const PaymentsDialogProvider: React$1.FC<React$1.PropsWithChildren>;
587
+ declare const usePaymentDialogs: () => PaymentsDialogContextValue;
588
+
551
589
  interface CardDetailsFormProps {
552
590
  visible: boolean;
553
591
  onTokenize: (token: string, billing: BillingDetails) => void;
@@ -585,22 +623,13 @@ interface PaymentExperienceProps {
585
623
  enableNewCard?: boolean;
586
624
  enableStoredMethods?: boolean;
587
625
  enableSolanaPay?: boolean;
588
- checkoutSummary?: React$1.ReactNode;
626
+ enableAlternativePayments?: boolean;
589
627
  onSolanaSuccess?: (result: SubmitPaymentResponse | string) => void;
590
628
  onSolanaError?: (error: string) => void;
629
+ initialMode?: 'cards' | 'solana';
591
630
  }
592
631
  declare const PaymentExperience: React$1.FC<PaymentExperienceProps>;
593
632
 
594
- interface SolanaPaymentSelectorProps {
595
- isOpen: boolean;
596
- priceId: string;
597
- usdAmount: number;
598
- onClose: () => void;
599
- onError?: (error: string) => void;
600
- onSuccess: (result: SubmitPaymentResponse | string) => void;
601
- }
602
- declare const SolanaPaymentSelector: React$1.FC<SolanaPaymentSelectorProps>;
603
-
604
633
  interface BillingHistoryProps {
605
634
  pageSize?: number;
606
635
  initialPage?: number;
@@ -650,33 +679,12 @@ declare const WalletCard: React.FC<WalletCardProps>;
650
679
 
651
680
  declare const EmptyWalletState: React.FC;
652
681
 
653
- interface WalletModalProps {
654
- open: boolean;
655
- onOpenChange: (open: boolean) => void;
656
- }
657
- declare const WalletModal: React.FC<WalletModalProps>;
658
-
659
682
  interface WalletDialogProps {
660
683
  open: boolean;
661
684
  onOpenChange: (open: boolean) => void;
662
685
  }
663
686
  declare const WalletDialog: React.FC<WalletDialogProps>;
664
687
 
665
- interface SubscriptionCheckoutModalProps {
666
- open: boolean;
667
- onOpenChange: (open: boolean) => void;
668
- priceId?: string | null;
669
- usdAmount?: number;
670
- planName?: string;
671
- amountLabel?: string;
672
- billingPeriodLabel?: string;
673
- userEmail?: string | null;
674
- provider?: string;
675
- onSuccess?: () => void;
676
- enableSolanaPay?: boolean;
677
- }
678
- declare const SubscriptionCheckoutModal: React$1.FC<SubscriptionCheckoutModalProps>;
679
-
680
688
  interface SubscriptionSuccessDialogProps {
681
689
  open: boolean;
682
690
  planName?: string;
@@ -785,10 +793,14 @@ declare const usePaymentStatus: (options?: PaymentStatusHookOptions) => {
785
793
  isPending: boolean;
786
794
  };
787
795
 
788
- declare const usePaymentStore: <T>(selector: (state: PaymentStoreState) => T) => T;
789
-
790
796
  declare const useSolanaService: () => SolanaPaymentService;
791
797
 
798
+ declare const usePaymentNotifications: () => {
799
+ notifyStatus: (status: PaymentStatusPayload["status"], context?: Record<string, unknown>) => void;
800
+ notifySuccess: (payload?: PaymentSuccessPayload) => void;
801
+ notifyError: (error: string | Error) => void;
802
+ };
803
+
792
804
  interface UseSolanaDirectPaymentOptions {
793
805
  priceId: string;
794
806
  tokenAmount: number;
@@ -918,4 +930,4 @@ interface WalletConnectionResult extends WalletConnectionState {
918
930
  }
919
931
  declare const useWalletConnection: () => WalletConnectionResult;
920
932
 
921
- export { type AsyncStatus, type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingStatus, type CCBillSubscribePayload, CancelMembershipDialog, type CancelMembershipDialogProps, CardDetailsForm, type CardDetailsFormProps, CardPaymentService, type CardTokenizeResult, type CreatePaymentMethodPayload, EmptyWalletState, type FlexFormResponse, type GenerateFlexFormParams, type GenerateFlexFormURLBodyParams, type GeneratePaymentRequest, type GeneratePaymentResponse, type ListParams, type NmiSubscribePayload, type NotificationHandler, type NotificationPayload, type NotificationStatus, type PaginatedPaymentMethods, type PaginatedPayments, type Payment, PaymentApp, type PaymentAppOptions, type PaymentCallbacks, type PaymentConfig, type PaymentContextValue, type PaymentEndpoints, type PaymentError, PaymentExperience, type PaymentExperienceProps, type PaymentFeatureFlags, type PaymentFetcher, type PaymentMethod, type PaymentMethodOption, PaymentMethodService, PaymentMethodsSection, type PaymentMethodsSectionProps, type PaymentPlatform, PaymentProvider, type PaymentProviderProps, type PaymentServices, type PaymentState, type PaymentStatusPayload, type PaymentStatusResponse, type PaymentStep, type PaymentStoreOptions, type PaymentStoreState, type PaymentSuccessPayload, type PaymentUserDetails, type SolanaFlowConfig, type SolanaFlowState, type SolanaPayQRCodeIntent, type SolanaPayStatusResponse, type SolanaPayTransaction, type SolanaPaymentMethod, SolanaPaymentSelector, SolanaPaymentService, type SolanaWallet, SolanaWalletSection, type SolanaWalletSectionProps, SolanaWalletService, StoredPaymentMethods, type StoredPaymentMethodsProps, type SubmitPaymentRequest, type SubmitPaymentResponse, type SubscribeWithCCBillParams, type SubscribeWithCardParams, type SubscribeWithSavedMethodParams, SubscriptionCheckoutModal, type SubscriptionCheckoutPayload, type SubscriptionResponse, SubscriptionService, SubscriptionSuccessDialog, type SupportedTokensResponse, type TokenBalance, TokenCatalog, type TokenCatalogOptions, type TokenInfo, type TransactionStatus, type VerifyWalletResponse, type WalletAccount, type WalletAdapterLike, WalletCard, type WalletChallengeResponse, type WalletConnectionState, WalletDialog, type WalletDialogProps, WalletGateway, type WalletListResponse, WalletManagement, WalletModal, type WalletModalProps, createPaymentStore, useAlternativePaymentProvider, useDirectWalletPayment, usePaymentContext, usePaymentMethodService, usePaymentMethods, usePaymentStatus, usePaymentStore, useSolanaDirectPayment, useSolanaQrPayment, useSolanaService, useSubscriptionActions, useSupportedTokens, useTokenBalance, useWalletConnection, useWalletList, useWalletVerification };
933
+ export { type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingStatus, type CCBillSubscribePayload, CancelMembershipDialog, type CancelMembershipDialogProps, CardDetailsForm, type CardDetailsFormProps, CardPaymentService, type CardTokenizeResult, type CreatePaymentMethodPayload, EmptyWalletState, type FlexFormResponse, type GenerateFlexFormParams, type GenerateFlexFormURLBodyParams, type GeneratePaymentRequest, type GeneratePaymentResponse, type ListParams, type NmiSubscribePayload, type NotificationHandler, type NotificationPayload, type NotificationStatus, type PaginatedPaymentMethods, type PaginatedPayments, type Payment, PaymentApp, type PaymentAppOptions, type PaymentCallbacks, type PaymentConfig, type PaymentContextValue, type PaymentEndpoints, type PaymentError, PaymentExperience, type PaymentExperienceProps, type PaymentFeatureFlags, type PaymentFetcher, type PaymentMethod, type PaymentMethodOption, PaymentMethodService, PaymentMethodsSection, type PaymentMethodsSectionProps, type PaymentPlatform, PaymentProvider, type PaymentProviderProps, type PaymentServices, type PaymentSolanaConfig, type PaymentState, type PaymentStatusPayload, type PaymentStatusResponse, type PaymentStep, type PaymentSuccessPayload, type PaymentUserDetails, PaymentsDialogProvider, PaymentsRuntime, type SolanaFlowConfig, type SolanaPayQRCodeIntent, type SolanaPayStatusResponse, type SolanaPayTransaction, type SolanaPaymentMethod, SolanaPaymentSelector, type SolanaPaymentSelectorProps, SolanaPaymentService, SolanaPaymentView, type SolanaPaymentViewProps, type SolanaWallet, SolanaWalletSection, type SolanaWalletSectionProps, SolanaWalletService, StoredPaymentMethods, type StoredPaymentMethodsProps, type SubmitPaymentRequest, type SubmitPaymentResponse, type SubscribeWithCCBillParams, type SubscribeWithCardParams, type SubscribeWithSavedMethodParams, SubscriptionCheckoutModal, type SubscriptionCheckoutModalProps, type SubscriptionCheckoutPayload, type SubscriptionResponse, SubscriptionService, SubscriptionSuccessDialog, type SupportedTokensResponse, type TokenBalance, TokenCatalog, type TokenCatalogOptions, type TokenInfo, type TransactionStatus, type VerifyWalletResponse, type WalletAccount, type WalletAdapterLike, WalletCard, type WalletChallengeResponse, type WalletConnectionState, WalletDialog, type WalletDialogProps, WalletGateway, type WalletListResponse, WalletManagement, WalletModal, type WalletModalProps, createPaymentsRuntime, useAlternativePaymentProvider, useDirectWalletPayment, usePaymentContext, usePaymentDialogs, usePaymentMethodService, usePaymentMethods, usePaymentNotifications, usePaymentStatus, useSolanaDirectPayment, useSolanaQrPayment, useSolanaService, useSubscriptionActions, useSupportedTokens, useTokenBalance, useWalletConnection, useWalletList, useWalletVerification };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React$1 from 'react';
2
- import { StoreApi } from 'zustand';
2
+ import * as _solana_wallet_adapter_base from '@solana/wallet-adapter-base';
3
+ import * as _tanstack_react_query from '@tanstack/react-query';
4
+ import { QueryClient } from '@tanstack/react-query';
3
5
  import { PublicKey } from '@solana/web3.js';
4
- import * as zustand_vanilla from 'zustand/vanilla';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import * as _tanstack_react_query from '@tanstack/react-query';
7
7
 
8
8
  type AuthTokenProvider = (() => string | null | undefined) | (() => Promise<string | null | undefined>) | null | undefined;
9
9
  interface PaymentUserDetails {
@@ -28,6 +28,12 @@ interface PaymentFeatureFlags {
28
28
  enableSolanaPay?: boolean;
29
29
  enableDirectWallet?: boolean;
30
30
  }
31
+ interface PaymentSolanaConfig {
32
+ endpoint?: string;
33
+ network?: _solana_wallet_adapter_base.WalletAdapterNetwork;
34
+ autoConnect?: boolean;
35
+ wallets?: _solana_wallet_adapter_base.WalletAdapter[];
36
+ }
31
37
  interface PaymentCallbacks {
32
38
  onStatusChange?: (payload: PaymentStatusPayload) => void;
33
39
  onSuccess?: (payload: PaymentSuccessPayload) => void;
@@ -54,6 +60,7 @@ interface PaymentConfig {
54
60
  callbacks?: PaymentCallbacks;
55
61
  collectJsKey?: string;
56
62
  solanaRpcUrl?: string;
63
+ solana?: PaymentSolanaConfig;
57
64
  }
58
65
  type NotificationStatus = 'default' | 'success' | 'info' | 'destructive';
59
66
  interface NotificationPayload {
@@ -492,46 +499,14 @@ declare class PaymentApp {
492
499
  resolveAuthToken: () => Promise<string | null>;
493
500
  }
494
501
 
495
- type AsyncStatus = 'idle' | 'processing' | 'success' | 'error';
496
- type SolanaFlowState = 'selecting' | 'processing' | 'confirming' | 'success' | 'error';
497
- interface PaymentStoreState {
498
- selectedMethodId: string | null;
499
- solanaModalOpen: boolean;
500
- savedPaymentStatus: AsyncStatus;
501
- savedPaymentError: string | null;
502
- newCardStatus: AsyncStatus;
503
- newCardError: string | null;
504
- solanaTab: 'wallet' | 'qr';
505
- solanaStatus: SolanaFlowState;
506
- solanaError: string | null;
507
- solanaTransactionId: string | null;
508
- solanaSelectedToken: string | null;
509
- solanaTokenAmount: number;
510
- setSelectedMethod: (methodId: string | null) => void;
511
- setSolanaModalOpen: (open: boolean) => void;
512
- setSolanaTab: (tab: 'wallet' | 'qr') => void;
513
- setSolanaSelectedToken: (symbol: string) => void;
514
- setSolanaTokenAmount: (amount: number) => void;
515
- setSolanaTransactionId: (txId: string | null) => void;
516
- startSavedPayment: () => void;
517
- completeSavedPayment: () => void;
518
- failSavedPayment: (error: string) => void;
519
- resetSavedPayment: () => void;
520
- startNewCardPayment: () => void;
521
- completeNewCardPayment: () => void;
522
- failNewCardPayment: (error: string) => void;
523
- resetNewCardPayment: () => void;
524
- startSolanaPayment: () => void;
525
- confirmSolanaPayment: () => void;
526
- completeSolanaPayment: (payload?: PaymentSuccessPayload) => void;
527
- failSolanaPayment: (error: string) => void;
528
- resetSolanaPayment: () => void;
529
- resetAll: () => void;
530
- }
531
- interface PaymentStoreOptions {
532
- callbacks?: PaymentCallbacks;
502
+ declare class PaymentsRuntime {
503
+ readonly config: PaymentConfig;
504
+ readonly app: PaymentApp;
505
+ readonly services: PaymentServices;
506
+ readonly queryClient: QueryClient;
507
+ constructor(config: PaymentConfig);
533
508
  }
534
- declare const createPaymentStore: (options?: PaymentStoreOptions) => zustand_vanilla.StoreApi<PaymentStoreState>;
509
+ declare const createPaymentsRuntime: (config: PaymentConfig) => PaymentsRuntime;
535
510
 
536
511
  interface PaymentContextValue {
537
512
  config: PaymentConfig;
@@ -539,15 +514,78 @@ interface PaymentContextValue {
539
514
  resolveAuthToken: () => Promise<string | null>;
540
515
  app: PaymentApp;
541
516
  services: PaymentServices;
542
- store: StoreApi<PaymentStoreState>;
517
+ queryClient: PaymentsRuntime['queryClient'];
543
518
  }
544
519
  interface PaymentProviderProps {
545
520
  config: PaymentConfig;
546
521
  children: React$1.ReactNode;
522
+ runtime?: PaymentsRuntime;
547
523
  }
548
524
  declare const PaymentProvider: React$1.FC<PaymentProviderProps>;
549
525
  declare const usePaymentContext: () => PaymentContextValue;
550
526
 
527
+ interface SubscriptionCheckoutModalProps {
528
+ open: boolean;
529
+ onOpenChange: (open: boolean) => void;
530
+ priceId?: string | null;
531
+ usdAmount?: number;
532
+ planName?: string;
533
+ amountLabel?: string;
534
+ billingPeriodLabel?: string;
535
+ userEmail?: string | null;
536
+ provider?: string;
537
+ onSuccess?: () => void;
538
+ enableSolanaPay?: boolean;
539
+ onSolanaSuccess?: (result: SubmitPaymentResponse | string) => void;
540
+ onSolanaError?: (error: string) => void;
541
+ initialMode?: 'cards' | 'solana';
542
+ }
543
+ declare const SubscriptionCheckoutModal: React$1.FC<SubscriptionCheckoutModalProps>;
544
+
545
+ interface SolanaPaymentViewProps {
546
+ priceId: string;
547
+ usdAmount: number;
548
+ onSuccess: (result: SubmitPaymentResponse | string) => void;
549
+ onError?: (error: string) => void;
550
+ onClose?: () => void;
551
+ }
552
+ declare const SolanaPaymentView: React$1.FC<SolanaPaymentViewProps>;
553
+
554
+ interface SolanaPaymentSelectorProps extends SolanaPaymentViewProps {
555
+ isOpen: boolean;
556
+ onClose: () => void;
557
+ }
558
+ declare const SolanaPaymentSelector: React$1.FC<SolanaPaymentSelectorProps>;
559
+
560
+ interface WalletModalProps {
561
+ open: boolean;
562
+ onOpenChange: (open: boolean) => void;
563
+ }
564
+ declare const WalletModal: React.FC<WalletModalProps>;
565
+
566
+ type CheckoutOptions = Omit<SubscriptionCheckoutModalProps, 'open' | 'onOpenChange'>;
567
+ type SolanaOptions = Omit<SolanaPaymentSelectorProps, 'isOpen' | 'onClose'>;
568
+ type WalletOptions = Omit<WalletModalProps, 'open' | 'onOpenChange'>;
569
+ interface PaymentsDialogContextValue {
570
+ checkout: {
571
+ open: (options: CheckoutOptions) => void;
572
+ close: () => void;
573
+ isOpen: boolean;
574
+ };
575
+ solana: {
576
+ open: (options: SolanaOptions) => void;
577
+ close: () => void;
578
+ isOpen: boolean;
579
+ };
580
+ wallet: {
581
+ open: (options?: WalletOptions) => void;
582
+ close: () => void;
583
+ isOpen: boolean;
584
+ };
585
+ }
586
+ declare const PaymentsDialogProvider: React$1.FC<React$1.PropsWithChildren>;
587
+ declare const usePaymentDialogs: () => PaymentsDialogContextValue;
588
+
551
589
  interface CardDetailsFormProps {
552
590
  visible: boolean;
553
591
  onTokenize: (token: string, billing: BillingDetails) => void;
@@ -585,22 +623,13 @@ interface PaymentExperienceProps {
585
623
  enableNewCard?: boolean;
586
624
  enableStoredMethods?: boolean;
587
625
  enableSolanaPay?: boolean;
588
- checkoutSummary?: React$1.ReactNode;
626
+ enableAlternativePayments?: boolean;
589
627
  onSolanaSuccess?: (result: SubmitPaymentResponse | string) => void;
590
628
  onSolanaError?: (error: string) => void;
629
+ initialMode?: 'cards' | 'solana';
591
630
  }
592
631
  declare const PaymentExperience: React$1.FC<PaymentExperienceProps>;
593
632
 
594
- interface SolanaPaymentSelectorProps {
595
- isOpen: boolean;
596
- priceId: string;
597
- usdAmount: number;
598
- onClose: () => void;
599
- onError?: (error: string) => void;
600
- onSuccess: (result: SubmitPaymentResponse | string) => void;
601
- }
602
- declare const SolanaPaymentSelector: React$1.FC<SolanaPaymentSelectorProps>;
603
-
604
633
  interface BillingHistoryProps {
605
634
  pageSize?: number;
606
635
  initialPage?: number;
@@ -650,33 +679,12 @@ declare const WalletCard: React.FC<WalletCardProps>;
650
679
 
651
680
  declare const EmptyWalletState: React.FC;
652
681
 
653
- interface WalletModalProps {
654
- open: boolean;
655
- onOpenChange: (open: boolean) => void;
656
- }
657
- declare const WalletModal: React.FC<WalletModalProps>;
658
-
659
682
  interface WalletDialogProps {
660
683
  open: boolean;
661
684
  onOpenChange: (open: boolean) => void;
662
685
  }
663
686
  declare const WalletDialog: React.FC<WalletDialogProps>;
664
687
 
665
- interface SubscriptionCheckoutModalProps {
666
- open: boolean;
667
- onOpenChange: (open: boolean) => void;
668
- priceId?: string | null;
669
- usdAmount?: number;
670
- planName?: string;
671
- amountLabel?: string;
672
- billingPeriodLabel?: string;
673
- userEmail?: string | null;
674
- provider?: string;
675
- onSuccess?: () => void;
676
- enableSolanaPay?: boolean;
677
- }
678
- declare const SubscriptionCheckoutModal: React$1.FC<SubscriptionCheckoutModalProps>;
679
-
680
688
  interface SubscriptionSuccessDialogProps {
681
689
  open: boolean;
682
690
  planName?: string;
@@ -785,10 +793,14 @@ declare const usePaymentStatus: (options?: PaymentStatusHookOptions) => {
785
793
  isPending: boolean;
786
794
  };
787
795
 
788
- declare const usePaymentStore: <T>(selector: (state: PaymentStoreState) => T) => T;
789
-
790
796
  declare const useSolanaService: () => SolanaPaymentService;
791
797
 
798
+ declare const usePaymentNotifications: () => {
799
+ notifyStatus: (status: PaymentStatusPayload["status"], context?: Record<string, unknown>) => void;
800
+ notifySuccess: (payload?: PaymentSuccessPayload) => void;
801
+ notifyError: (error: string | Error) => void;
802
+ };
803
+
792
804
  interface UseSolanaDirectPaymentOptions {
793
805
  priceId: string;
794
806
  tokenAmount: number;
@@ -918,4 +930,4 @@ interface WalletConnectionResult extends WalletConnectionState {
918
930
  }
919
931
  declare const useWalletConnection: () => WalletConnectionResult;
920
932
 
921
- export { type AsyncStatus, type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingStatus, type CCBillSubscribePayload, CancelMembershipDialog, type CancelMembershipDialogProps, CardDetailsForm, type CardDetailsFormProps, CardPaymentService, type CardTokenizeResult, type CreatePaymentMethodPayload, EmptyWalletState, type FlexFormResponse, type GenerateFlexFormParams, type GenerateFlexFormURLBodyParams, type GeneratePaymentRequest, type GeneratePaymentResponse, type ListParams, type NmiSubscribePayload, type NotificationHandler, type NotificationPayload, type NotificationStatus, type PaginatedPaymentMethods, type PaginatedPayments, type Payment, PaymentApp, type PaymentAppOptions, type PaymentCallbacks, type PaymentConfig, type PaymentContextValue, type PaymentEndpoints, type PaymentError, PaymentExperience, type PaymentExperienceProps, type PaymentFeatureFlags, type PaymentFetcher, type PaymentMethod, type PaymentMethodOption, PaymentMethodService, PaymentMethodsSection, type PaymentMethodsSectionProps, type PaymentPlatform, PaymentProvider, type PaymentProviderProps, type PaymentServices, type PaymentState, type PaymentStatusPayload, type PaymentStatusResponse, type PaymentStep, type PaymentStoreOptions, type PaymentStoreState, type PaymentSuccessPayload, type PaymentUserDetails, type SolanaFlowConfig, type SolanaFlowState, type SolanaPayQRCodeIntent, type SolanaPayStatusResponse, type SolanaPayTransaction, type SolanaPaymentMethod, SolanaPaymentSelector, SolanaPaymentService, type SolanaWallet, SolanaWalletSection, type SolanaWalletSectionProps, SolanaWalletService, StoredPaymentMethods, type StoredPaymentMethodsProps, type SubmitPaymentRequest, type SubmitPaymentResponse, type SubscribeWithCCBillParams, type SubscribeWithCardParams, type SubscribeWithSavedMethodParams, SubscriptionCheckoutModal, type SubscriptionCheckoutPayload, type SubscriptionResponse, SubscriptionService, SubscriptionSuccessDialog, type SupportedTokensResponse, type TokenBalance, TokenCatalog, type TokenCatalogOptions, type TokenInfo, type TransactionStatus, type VerifyWalletResponse, type WalletAccount, type WalletAdapterLike, WalletCard, type WalletChallengeResponse, type WalletConnectionState, WalletDialog, type WalletDialogProps, WalletGateway, type WalletListResponse, WalletManagement, WalletModal, type WalletModalProps, createPaymentStore, useAlternativePaymentProvider, useDirectWalletPayment, usePaymentContext, usePaymentMethodService, usePaymentMethods, usePaymentStatus, usePaymentStore, useSolanaDirectPayment, useSolanaQrPayment, useSolanaService, useSubscriptionActions, useSupportedTokens, useTokenBalance, useWalletConnection, useWalletList, useWalletVerification };
933
+ export { type AuthTokenProvider, type BillingAccessGrant, type BillingDetails, BillingHistory, type BillingHistoryProps, type BillingStatus, type CCBillSubscribePayload, CancelMembershipDialog, type CancelMembershipDialogProps, CardDetailsForm, type CardDetailsFormProps, CardPaymentService, type CardTokenizeResult, type CreatePaymentMethodPayload, EmptyWalletState, type FlexFormResponse, type GenerateFlexFormParams, type GenerateFlexFormURLBodyParams, type GeneratePaymentRequest, type GeneratePaymentResponse, type ListParams, type NmiSubscribePayload, type NotificationHandler, type NotificationPayload, type NotificationStatus, type PaginatedPaymentMethods, type PaginatedPayments, type Payment, PaymentApp, type PaymentAppOptions, type PaymentCallbacks, type PaymentConfig, type PaymentContextValue, type PaymentEndpoints, type PaymentError, PaymentExperience, type PaymentExperienceProps, type PaymentFeatureFlags, type PaymentFetcher, type PaymentMethod, type PaymentMethodOption, PaymentMethodService, PaymentMethodsSection, type PaymentMethodsSectionProps, type PaymentPlatform, PaymentProvider, type PaymentProviderProps, type PaymentServices, type PaymentSolanaConfig, type PaymentState, type PaymentStatusPayload, type PaymentStatusResponse, type PaymentStep, type PaymentSuccessPayload, type PaymentUserDetails, PaymentsDialogProvider, PaymentsRuntime, type SolanaFlowConfig, type SolanaPayQRCodeIntent, type SolanaPayStatusResponse, type SolanaPayTransaction, type SolanaPaymentMethod, SolanaPaymentSelector, type SolanaPaymentSelectorProps, SolanaPaymentService, SolanaPaymentView, type SolanaPaymentViewProps, type SolanaWallet, SolanaWalletSection, type SolanaWalletSectionProps, SolanaWalletService, StoredPaymentMethods, type StoredPaymentMethodsProps, type SubmitPaymentRequest, type SubmitPaymentResponse, type SubscribeWithCCBillParams, type SubscribeWithCardParams, type SubscribeWithSavedMethodParams, SubscriptionCheckoutModal, type SubscriptionCheckoutModalProps, type SubscriptionCheckoutPayload, type SubscriptionResponse, SubscriptionService, SubscriptionSuccessDialog, type SupportedTokensResponse, type TokenBalance, TokenCatalog, type TokenCatalogOptions, type TokenInfo, type TransactionStatus, type VerifyWalletResponse, type WalletAccount, type WalletAdapterLike, WalletCard, type WalletChallengeResponse, type WalletConnectionState, WalletDialog, type WalletDialogProps, WalletGateway, type WalletListResponse, WalletManagement, WalletModal, type WalletModalProps, createPaymentsRuntime, useAlternativePaymentProvider, useDirectWalletPayment, usePaymentContext, usePaymentDialogs, usePaymentMethodService, usePaymentMethods, usePaymentNotifications, usePaymentStatus, useSolanaDirectPayment, useSolanaQrPayment, useSolanaService, useSubscriptionActions, useSupportedTokens, useTokenBalance, useWalletConnection, useWalletList, useWalletVerification };