UNPKG

zips-typescript-sdk

Version:

TypeScript SDK for ZIPS Payment Gateway - Complete payment solution for server-side applications

30 lines 1.09 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const axios_1 = __importDefault(require("axios")); const utils_1 = require("../utils"); class BaseModule { constructor(apiKey) { // protected merchantApiURL = "http://zipsmerchant.zigtech.net/api/v1/"; // protected gatewayApiURL = "http://zipsgateway.zigtech.net/api/v1/"; this.merchantApiURL = "http://localhost:9005/api/v1/"; this.gatewayApiURL = "http://localhost:9008/api/v1/"; this.apiKey = apiKey; } getHeaders() { return { "x-api-key": this.apiKey, "Content-Type": "application/json" }; } async request(config) { try { const { data } = await (0, axios_1.default)(config); return data; } catch (error) { throw new Error((0, utils_1.getErrorMessage)(error)); } } } exports.default = BaseModule; //# sourceMappingURL=base.js.map