UNPKG

@dhanyatra/checkout-js

Version:

Check Js Module For Instant Web Checkout

65 lines (64 loc) 1.47 kB
interface PaymentBlock { [key: string]: { name: string; instruments: PaymentInstrument[]; }; } interface PaymentInstrument { method: string; flows: string[]; apps: string[]; issuer: string[]; banks: string[]; wallets: string[]; } interface DhanyatraOptions { key: string; amount: string; currency: string; order_id: string; organization: string; prefill?: { email?: string; contact?: number; }; config?: { display: { blocks: PaymentBlock; hide: { method: string; }[]; sequence: string[]; preferences: { show_default_blocks: boolean; }; }; }; ark?: { user_id: number; org_id: number; }; modal: { onDismiss: (response: any) => void; onSuccess: (response: any) => void; onError: (error: any) => void; }; } export declare class Dhanyatra { options: DhanyatraOptions; private baseUrl; private eventListenerAttached; private onSuccessHandled; private onDismissHandled; private onErrorHandled; constructor(options: DhanyatraOptions); close(): void; open(): void; private attachEventListener; private removeEventListener; private handleMessage; private handleDismissModal; private handlePaymentResponse; private handleErrorResponse; } export {};