UNPKG

wallets-africa

Version:
44 lines (43 loc) 1.54 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")); /** * @class Bank * All Bank functionality and methods based on api * {@link https://https://documenter.getpostman.com/view/10058163/SWLk4RPL?version=latest#90e5b45a-9ae1-4eaa-85ae-9aa569835bdb View Api Docs} */ class Bank { /* Returns bank */ static async bankDetails(transRef) { const body = { TransactionReference: transRef, SecretKey: this.secretKey, currency: 'NGN' }; const url = `${this.endpoint}/details`; return axios_1.default.post(url, body); } /* Transfer from wallet to bank account supplied */ static async bankAccountTransfer(options) { const body = Object.assign(Object.assign({}, options), { SecretKey: this.secretKey, currency: 'NGN' }); const url = `${this.endpoint}/account`; return axios_1.default.post(url, body); } /* Returns account details for the specified number */ static async accountEnquiry(options) { const body = Object.assign(Object.assign({}, options), { SecretKey: this.secretKey, currency: 'NGN' }); const url = `${this.endpoint}/account/enquire`; return axios_1.default.post(url, body); } } /* Api keys */ Bank.secretKey = ''; Bank.endpoint = '/bank'; exports.default = Bank;