@abdelrahman.rabie/payment-sdk-react-native
Version:
React Native SDK for payment processing with E_API and E_LINKS support
18 lines (17 loc) • 897 B
TypeScript
import { PaymentSDK } from '../core/PaymentSDK';
import { EPaymentProduct, IRequestPaymentPayload, IPaymentResult, IEAPIPaymentInfoResponse, IELINKSPaymentInfoResponse } from '../types/payment.types';
export interface UsePaymentProps {
sdk: PaymentSDK;
}
export interface UsePaymentReturn {
loading: boolean;
error: string | null;
paymentInfo: IEAPIPaymentInfoResponse | IELINKSPaymentInfoResponse | null;
paymentResult: IPaymentResult | null;
initializePayment: (product: EPaymentProduct, paymentToken: string) => Promise<void>;
executePayment: (product: EPaymentProduct, paymentToken: string, payload: IRequestPaymentPayload) => Promise<void>;
getPaymentStatus: (product: EPaymentProduct, paymentToken: string) => Promise<void>;
clearError: () => void;
reset: () => void;
}
export declare const usePayment: ({ sdk }: UsePaymentProps) => UsePaymentReturn;