UNPKG

quivio-transaction-processor

Version:

React Native hook for Card payment integration with DataCap

38 lines (37 loc) 1.5 kB
export declare const EVENT_NAMES: readonly ["onError", "onCardReadSuccessfully", "onSaleTransactionCompleted", "onRecurringSaleCompleted", "onReplaceCardCompleted", "onClientVersionCompleted", "onShowMessage", "onConfigError", "onConfigPingFailed", "onConfigPingSuccess", "onConfigCompleted"]; export type EMVEventName = typeof EVENT_NAMES[number]; export interface CallbackLog { type: string; payload: any; timestamp: number; } export interface EMVPaymentHook { logs: CallbackLog[]; isDeviceConnected: boolean; loading: boolean; isInitialized: boolean; handleCardPayment: (amount: string) => void; handleInHousePayment: () => void; runRecurringTransaction: (amount: string) => void; replaceCardInRecurring: () => void; getClientVersion: () => void; setupConfig: () => void; pingConfig: () => void; clearTransactionListener: () => void; clearAllTransactions: () => void; cancelOperation: () => void; initializeEMV: (config: EMVConfig) => void; EVENTS: Record<EMVEventName, EMVEventName>; subscribeToEvent: (eventName: EMVEventName, callback: (payload: any) => void) => void; unsubscribeFromEvent: (eventName: EMVEventName, callback: (payload: any) => void) => void; } export interface PaymentContextType extends EMVPaymentHook { } export interface EMVConfig { merchantID: string; onlineMerchantID: string; isSandBox: boolean; secureDeviceName: string; operatorID: string; posPackageID: string; }