import type { VenmoPresentationModeOptions, VenmoOneTimePaymentSessionOptions, VenmoOneTimePaymentSessionPromise, BasePaymentSessionReturn, WithOptionalPresentationMode } from "../types"; /** * `sandboxSupport` is a temporary Venmo sandbox-testing flag that the JS SDK will * remove once it is no longer needed. It is intentionally typed locally here * rather than in `@paypal/paypal-js`, so it can be dropped from react-paypal-js * without a breaking change to the published SDK types. */ type VenmoSandboxSupport = { sandboxSupport?: { enabled: boolean; }; }; export type UseVenmoOneTimePaymentSessionProps = ((Omit & { createOrder: () => VenmoOneTimePaymentSessionPromise; orderId?: never; }) | (VenmoOneTimePaymentSessionOptions & { createOrder?: never; orderId: string; })) & WithOptionalPresentationMode & VenmoSandboxSupport; /** * Hook for managing Venmo one-time payment sessions. * * This hook creates and manages a Venmo payment session. It handles session lifecycle * 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) * * `presentationMode` is optional and defaults to `"auto"`. * * @example * function VenmoCheckout() { * const { error, isPending, handleClick, handleCancel } = useVenmoOneTimePaymentSession({ * createOrder: async () => ({ orderId: 'ORDER-123' }), * onApprove: (data) => console.log('Approved:', data), * onCancel: () => console.log('Cancelled'), * }); * * if (isPending) return null; * if (error) return
Error: {error.message}
; * * return ( * * ); * } */ export declare function useVenmoOneTimePaymentSession({ presentationMode, fullPageOverlay, createOrder, orderId, sandboxSupport, ...callbacks }: UseVenmoOneTimePaymentSessionProps): BasePaymentSessionReturn; export {};