@gray-adeyi/korapay-sdk
Version:
A korapay client SDK for the javascript runtime.
29 lines • 1.14 kB
TypeScript
import type { KorapayResponse } from "./types/global.js";
import { HTTPMethod } from "./enums.js";
export default class RestClient {
static BASE_URL: string;
static ENV_PUBLIC_KEY_NAME: string;
static ENV_SECRET_KEY_NAME: string;
static ENV_ENCRYPTION_KEY_NAME: string;
private publicKey;
private secretKey;
private encryptionKey;
private secureClient;
private openClient;
constructor(publicKey?: string, secretKey?: string, encryptionKey?: string);
call(endpoint: string, method: HTTPMethod, data?: any, noAuth?: boolean): Promise<KorapayResponse>;
encryptData(data: any): Promise<string>;
private get baseHeaders();
private get openHeaders();
private get secureHeaders();
private getMethodHandler;
private deserializeResponse;
private requestPayloadTransformerInterceptor;
private responsePayloadTransformerInterceptor;
static camelToSnakeCaseTransformer(data: any): any;
static snakeToCamelCaseTransformer(data: any): any;
private handleRequestError;
private handleResponseError;
private loadKey;
}
//# sourceMappingURL=restClient.d.ts.map