neppayments
Version:
A simple and easy-to-use package for integrating Nepali payment gateways (Khalti and eSewa) into your applications
31 lines (30 loc) • 987 B
TypeScript
import { KhaltiConfig, KhaltiPaymentOptions, KhaltiPaymentResponse, KhaltiVerificationOptions, PaymentVerificationResponse } from '../types/payment.types';
/**
* Khalti payment gateway implementation
*/
export declare class KhaltiGateway {
private readonly config;
private readonly baseUrl;
/**
* Create a new Khalti gateway instance
* @param config Khalti configuration
*/
constructor(config: KhaltiConfig);
/**
* Validate payment options
* @private
*/
private validatePaymentOptions;
/**
* Create a new payment
* @param options Payment options
* @returns Payment response with payment URL and ID
*/
createPayment(options: KhaltiPaymentOptions): Promise<KhaltiPaymentResponse>;
/**
* Verify a payment
* @param options Verification options
* @returns Payment verification response
*/
verifyPayment(options: KhaltiVerificationOptions): Promise<PaymentVerificationResponse>;
}