import type { PayPalPresentationModeOptions, SavePaymentSessionOptions, BasePaymentSessionReturn } from "../types"; export type UsePayPalSavePaymentSessionProps = ((Omit & { createVaultToken: () => Promise<{ vaultSetupToken: string; }>; vaultSetupToken?: never; }) | (SavePaymentSessionOptions & { createVaultToken?: never; vaultSetupToken: string; })) & PayPalPresentationModeOptions; /** * Hook for managing a PayPal save payment session, vault without purchase. * * This hook creates and manages a PayPal save payment session for vaulting payment methods. * It supports multiple presentation modes and handles session lifecycle, resume flows for redirect-based * flows, and provides methods to start, cancel, and destroy the session. * * @returns Object with: `error` (any session error), `isPending` (SDK loading), `handleClick` (starts session), `handleCancel` (cancels session), `handleDestroy` (cleanup) * * @example * function SavePayPalButton() { * const { error, isPending, handleClick, handleCancel } = usePayPalSavePaymentSession({ * presentationMode: 'popup', * createVaultToken: async () => ({ vaultSetupToken: 'VAULT-TOKEN-123' }), * onApprove: (data) => console.log('Vaulted:', data), * onCancel: () => console.log('Cancelled'), * }); * * if (isPending) return null; * if (error) return
Error: {error.message}
; * * return ( * * ); * } */ export declare function usePayPalSavePaymentSession({ presentationMode, fullPageOverlay, autoRedirect, createVaultToken, vaultSetupToken, ...callbacks }: UsePayPalSavePaymentSessionProps): BasePaymentSessionReturn;