ts-midtrans-client
Version:
This library is an UNOFFICIAL TypeScript version of the Midtrans Client - Node.js.
51 lines (50 loc) • 1.58 kB
TypeScript
/**
* Config Object that is used to store isProduction, serverKey, clientKey,
* and also API base URLs.
*/
export declare class ApiConfig {
private isProduction;
private serverKey;
private clientKey;
static readonly CORE_SANDBOX_BASE_URL = "https://api.sandbox.midtrans.com";
static readonly CORE_PRODUCTION_BASE_URL = "https://api.midtrans.com";
static readonly SNAP_SANDBOX_BASE_URL = "https://app.sandbox.midtrans.com/snap/v1";
static readonly SNAP_PRODUCTION_BASE_URL = "https://app.midtrans.com/snap/v1";
static readonly IRIS_SANDBOX_BASE_URL = "https://app.sandbox.midtrans.com/iris/api/v1";
static readonly IRIS_PRODUCTION_BASE_URL = "https://app.midtrans.com/iris/api/v1";
constructor(options?: {
isProduction?: boolean;
serverKey: string;
clientKey: string;
});
/**
* Return config stored
* @return {Object} object contains isProduction, serverKey, clientKey
*/
get(): {
isProduction: boolean;
serverKey: string;
clientKey: string;
};
/**
* Set config stored
* @param {Object} options - object contains isProduction, serverKey, clientKey
*/
set(options: {
isProduction?: boolean;
serverKey: string;
clientKey: string;
}): void;
/**
* @return {String} core api base url
*/
getCoreApiBaseUrl(): string;
/**
* @return {String} snap api base url
*/
getSnapApiBaseUrl(): string;
/**
* @return {String} Iris api base url
*/
getIrisApiBaseUrl(): string;
}