ebarimt
Version:
Node.js + Ebarimt integration
28 lines (27 loc) • 1.1 kB
TypeScript
import { InitError, CheckAPIResult, PosInformation, APIResponse, PutResponse, PutBillRequest, BatchBillRequest, ReturnBillRequest, MerchantInfo } from './types';
export declare class EbarimtClient {
private url;
private headers;
constructor(url: string, headers?: Record<string, string>);
init(): Promise<({
success: true;
} & CheckAPIResult) | {
success: false;
error: InitError;
}>;
getInformation(): Promise<PosInformation>;
put(bill: PutBillRequest | BatchBillRequest): Promise<APIResponse<PutResponse>>;
returnBill(data: ReturnBillRequest): Promise<APIResponse<Record<string, never>, {
errorCode: number;
}>>;
sendData(): Promise<APIResponse<Record<string, never>, {
errorCode: string;
}>>;
/**
* Convert citizen register number to numeric string
* @param regNo Citizen's reg number
* @returns Converted reg number converted to the numeric value
*/
convertCitizenRegNo(regNo: string): Promise<string>;
static getOrganizationInfo(regNo: string): Promise<MerchantInfo | null>;
}