neppayments
Version:
A simple and easy-to-use package for integrating Nepali payment gateways (Khalti and eSewa) into your applications
32 lines (31 loc) • 1.03 kB
TypeScript
import { EsewaConfig, EsewaPaymentOptions, EsewaPaymentResponse, EsewaVerificationOptions, PaymentVerificationResponse } from '../types/payment.types';
/**
* eSewa payment gateway implementation
*/
export declare class EsewaGateway {
private readonly config;
private readonly baseUrl;
private readonly statusCheckUrl;
/**
* Create a new eSewa gateway instance
* @param config eSewa configuration
*/
constructor(config: EsewaConfig);
/**
* Generate HMAC signature for the payment
* @private
*/
private generateSignature;
/**
* Create a new payment
* @param options Payment options
* @returns Payment response with form HTML and transaction UUID
*/
createPayment(options: EsewaPaymentOptions): Promise<EsewaPaymentResponse>;
/**
* Verify a payment
* @param options Verification options
* @returns Payment verification response
*/
verifyPayment(options: EsewaVerificationOptions): Promise<PaymentVerificationResponse>;
}