UNPKG

gohl

Version:

Go Highlevel Node Js ease of use library implementation to their API

76 lines 3.64 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PaymentCustomProviders = void 0; const axios_1 = require("axios"); class PaymentCustomProviders { constructor(authData) { this.authData = authData; } /** * Create Custom Provider * Documentation - https://highlevel.stoplight.io/docs/integrations/e5d4c3b2a1f90-create-custom-provider * @param data * @returns */ create(data) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers; const response = yield axios_1.default.post(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/payments/custom-providers`, data, { headers }); return response.data; }); } /** * Get Custom Provider by ID * Documentation - https://highlevel.stoplight.io/docs/integrations/c4b3a2d1e0f89-get-custom-provider-by-id * @param providerId * @returns */ get(providerId) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers; const response = yield axios_1.default.get(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/payments/custom-providers/${providerId}`, { headers }); return response.data; }); } /** * Create Custom Provider Config * Documentation - https://highlevel.stoplight.io/docs/integrations/b3a2c1d0e9f78-create-custom-provider-config * @param data * @returns */ createConfig(data) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers; const response = yield axios_1.default.post(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/payments/custom-providers/${data.providerId}/config`, data, { headers }); return response.data; }); } /** * Get Custom Provider Config * Documentation - https://highlevel.stoplight.io/docs/integrations/a2b1c0d9e8f67-get-custom-provider-config * @param providerId * @returns */ getConfig(providerId) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers; const response = yield axios_1.default.get(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/payments/custom-providers/${providerId}/config`, { headers }); return response.data; }); } } exports.PaymentCustomProviders = PaymentCustomProviders; //# sourceMappingURL=payments.customproviders.js.map