import { Stripe, StripeElements } from '@stripe/stripe-js'; /** * Configuration options for the Stripe payment hook */ interface UseStripePaymentOptions { /** Stripe publishable key */ stripePublishableKey: string; /** Client secret from payment intent */ clientSecret?: string; /** Appearance customization for Stripe Elements */ appearance?: { theme?: 'stripe' | 'night' | 'flat'; variables?: Record; }; /** Callback when payment succeeds */ onSuccess?: (paymentIntent: any) => void; /** Callback when payment fails */ onError?: (error: Error) => void; } /** * Payment method types supported by Stripe */ declare type PaymentMethodType = 'card' | 'ideal' | 'sepa_debit' | 'sofort' | 'bancontact'; /** * Return type for the Stripe payment hook */ interface UseStripePaymentReturn { stripe: Stripe | null; elements: StripeElements | null; isLoading: boolean; isProcessing: boolean; error: Error | null; paymentIntentStatus: string | null; initializeElements: (clientSecret: string) => Promise; confirmPayment: (options?: { return_url?: string; payment_method_data?: any; }) => Promise<{ paymentIntent: any; error?: any; }>; reset: () => void; getElementsOptions: () => any; } /** * Custom hook for managing Stripe payment processing */ export declare function useStripePayment(options: UseStripePaymentOptions): UseStripePaymentReturn; /** * Hook for handling specific payment method types */ export declare function usePaymentMethod(paymentMethodType: PaymentMethodType, stripeOptions: UseStripePaymentOptions): { paymentMethodType: PaymentMethodType; paymentMethodConfig: { layout: string; defaultValues: { billingDetails: { address: { country: string; }; }; }; } | { layout: string; } | { layout: string; } | { layout: string; } | { layout: string; }; stripe: Stripe | null; elements: StripeElements | null; isLoading: boolean; isProcessing: boolean; error: Error | null; paymentIntentStatus: string | null; initializeElements: (clientSecret: string) => Promise; confirmPayment: (options?: { return_url?: string | undefined; payment_method_data?: any; } | undefined) => Promise<{ paymentIntent: any; error?: any; }>; reset: () => void; getElementsOptions: () => any; }; /** * Utility function to validate Stripe public key format */ export declare function validateStripePublishableKey(key: string): boolean; /** * Utility function to format Stripe errors for user display */ export declare function formatStripeError(error: any): string; export default useStripePayment;