UNPKG

wallets-africa

Version:
34 lines (33 loc) 1.06 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")); /** * All Airtime functionality and methods * @class Airtime */ class Airtime { /* Returns a list of all airtime providers */ static async airtimeProviders(options) { const body = Object.assign(Object.assign({}, options), { SecretKey: this.secretKey }); const url = `${this.endpoint}/providers`; return axios_1.default.post(url, body); } /* Purchase airtime against the phone number supplied */ static async airtimePurchase(options) { const body = Object.assign(Object.assign({}, options), { SecretKey: this.secretKey }); const url = `${this.endpoint}/purchase`; return axios_1.default.post(url, body); } } /* Api key */ Airtime.secretKey = ''; Airtime.endpoint = '/bills/airtime';