idpay-node
Version:
A NodeJS library for IDPay payment gateway
29 lines (28 loc) • 1.3 kB
TypeScript
import { CreatePayment, CreatePaymentResponse, IDPayPaymentVerifyResponse, IDPayTrasactionResult } from './interfaces';
export declare class IDPay {
private apiKey;
private sandBox;
/**
*
* @param apiKey API-KEY provided by IDPay
* @param sandbox Flag to enable sandbox mode for testing purposes
*/
constructor(apiKey: string, sandBox?: boolean);
/**
* @description
* @param payment Payment request object
* @returns Payment Response
*/
paymentRequest(payment: CreatePayment): Promise<CreatePaymentResponse>;
/**
* @description Callback is optional as the user can implement custom logic outside of
* the function and user can use this function to just verify the callback result.
*/
processPaymentRequest(cbResult: IDPayTrasactionResult, cb?: (res: IDPayTrasactionResult) => void): boolean | void;
/**
* @description Callback is optional as the user can implement custom logic outside of
* the function. User can use this send a the payment result to verify the payment.
* @returns Payment verification result if a callback is not provided
*/
verifyPayment(id: string, order_id: string, cb?: (res: IDPayPaymentVerifyResponse) => void): Promise<IDPayPaymentVerifyResponse | undefined>;
}