akua-sdk
Version:
TypeScript SDK for Akua Acquiring Processor
77 lines (76 loc) • 3.15 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AkuaTypes = exports.AkuaClient = void 0;
require("reflect-metadata");
const client_1 = require("./http/client");
const instrument_service_1 = require("./services/instrument.service");
const merchant_service_1 = require("./services/merchant.service");
const organization_service_1 = require("./services/organization.service");
const payment_service_1 = require("./services/payment.service");
const webhook_service_1 = require("./services/webhook.service");
/**
* AkuaClient is the main class for interacting with the Akua API.
* It provides services for managing merchants, instruments, organizations, payments, and webhooks.
* @module AkuaClient
*/
class AkuaClient {
httpClient;
merchants;
instruments;
organizations;
payments;
webhooks;
/**
* Creates a new AkuaClient instance.
* @param config - The configuration for the Akua client.
* @example
* const akuaClient = new AkuaClient({
* clientId: 'your_client_id',
* clientSecret: 'your_client_secret',
* environment: 'sandbox', // or 'production'
* });
*/
constructor(config) {
this.httpClient = new client_1.HttpClient(config);
this.merchants = new merchant_service_1.MerchantService(this.httpClient);
this.instruments = new instrument_service_1.InstrumentService(this.httpClient);
this.organizations = new organization_service_1.OrganizationService(this.httpClient);
this.payments = new payment_service_1.PaymentService(this.httpClient);
this.webhooks = new webhook_service_1.WebhookService(this.httpClient);
}
}
exports.AkuaClient = AkuaClient;
exports.AkuaTypes = __importStar(require("./types/exportable-types"));