UNPKG

react-isw-webpay

Version:

React integration for Interswitch WebPay payment gateway

39 lines (38 loc) 965 B
export type PaymentEnvironment = 'production' | 'staging' | 'development'; export interface PaymentRequest { merchant_code: string; pay_item_id: string; txn_ref: string; site_redirect_url?: string; amount: number; currency: number | string; mode: 'TEST' | 'LIVE'; cust_id?: string; split_accounts?: string; onComplete?: (response: PaymentResponse) => void; [key: string]: any; } export interface PaymentResponse { resp: string; desc: string; txnref: string; payRef: string; retRef: string; amount: number; apprAmt: number; cardNum?: string; mac?: string; bpResp?: string; bpTrxnRef?: string; rechPin?: string; } export interface WebPayHookOptions { onSuccess?: (response: PaymentResponse) => void; onError?: (error: PaymentResponse) => void; onCancel?: () => void; } declare global { interface Window { webpayCheckout?: (data: any) => void; } }