esewa-react
Version:
A React library for integrating eSewa payment gateway into your React applications. This library handles hash signatures, base64 URL encoding, and provides a simple interface for initiating and verifying eSewa payments.
24 lines (23 loc) • 623 B
TypeScript
export interface EsewaConfig {
merchantId: string;
secretKey: string;
successUrl: string;
failureUrl: string;
isTest?: boolean;
}
export interface EsewaPaymentData {
amount: string;
productId: string;
successUrl: string;
failureUrl: string;
}
export declare class EsewaPayment {
private baseUrl;
private merchantId;
private secretKey;
private readonly signedFieldNames;
constructor(config: EsewaConfig);
private createPaymentString;
generateSignature(data: EsewaPaymentData): Promise<string>;
createPaymentForm(data: EsewaPaymentData): Promise<string>;
}