diff --git a/.DS_Store b/.DS_Store index 74fffae..5008ddf 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 570c7ea..9091f5c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ node_modules .vscode .env .prettierrc.json -.eslintrc.json \ No newline at end of file +.eslintrc.json +.nyc_output +coverage \ No newline at end of file diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 0000000..f418035 --- /dev/null +++ b/coverage/lcov-report/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/lcov-report/block-navigation.js b/coverage/lcov-report/block-navigation.js new file mode 100644 index 0000000..cc12130 --- /dev/null +++ b/coverage/lcov-report/block-navigation.js @@ -0,0 +1,87 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + if ( + document.getElementById('fileSearch') === document.activeElement && + document.activeElement != null + ) { + // if we're currently focused on the search input, we don't want to navigate + return; + } + + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/coverage/lcov-report/favicon.png b/coverage/lcov-report/favicon.png new file mode 100644 index 0000000..c1525b8 Binary files /dev/null and b/coverage/lcov-report/favicon.png differ diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 0000000..5a487b5 --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,356 @@ + + + + +
++ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
|---|---|---|---|---|---|---|---|---|---|
| lib | +
+
+ |
+ 77.08% | +259/336 | +6.25% | +2/32 | +78.76% | +89/113 | +77.31% | +259/335 | +
| services/banks | +
+
+ |
+ 100% | +16/16 | +100% | +0/0 | +100% | +2/2 | +100% | +16/16 | +
| services/beneficiaries | +
+
+ |
+ 100% | +23/23 | +100% | +0/0 | +100% | +4/4 | +100% | +23/23 | +
| services/bills | +
+
+ |
+ 100% | +68/68 | +100% | +0/0 | +100% | +11/11 | +100% | +68/68 | +
| services/charge | +
+
+ |
+ 100% | +79/79 | +100% | +0/0 | +100% | +12/12 | +100% | +79/79 | +
| services/ebills | +
+
+ |
+ 100% | +13/13 | +100% | +0/0 | +100% | +2/2 | +100% | +13/13 | +
| services/misc | +
+
+ |
+ 100% | +32/32 | +100% | +0/0 | +100% | +5/5 | +100% | +32/32 | +
| services/mobile-money | +
+
+ |
+ 100% | +42/42 | +100% | +0/0 | +100% | +7/7 | +100% | +42/42 | +
| services/otps | +
+
+ |
+ 100% | +12/12 | +100% | +0/0 | +100% | +2/2 | +100% | +12/12 | +
| services/payment-plans | +
+
+ |
+ 100% | +30/30 | +100% | +0/0 | +100% | +5/5 | +100% | +30/30 | +
| services/schema | +
+
+ |
+ 100% | +127/127 | +100% | +61/61 | +100% | +19/19 | +100% | +127/127 | +
| services/settlements | +
+
+ |
+ 100% | +10/10 | +100% | +0/0 | +100% | +2/2 | +100% | +10/10 | +
| services/subscriptions | +
+
+ |
+ 100% | +24/24 | +100% | +0/0 | +100% | +4/4 | +100% | +24/24 | +
| services/tokenized-charges | +
+
+ |
+ 100% | +33/33 | +100% | +0/0 | +100% | +5/5 | +100% | +33/33 | +
| services/transactions | +
+
+ |
+ 100% | +49/49 | +100% | +0/0 | +100% | +7/7 | +100% | +49/49 | +
| services/transfers | +
+
+ |
+ 100% | +37/37 | +100% | +0/0 | +100% | +6/6 | +100% | +37/37 | +
| utils | +
+
+ |
+ 81.13% | +43/53 | +58.33% | +14/24 | +55.55% | +5/9 | +80.76% | +42/52 | +
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
|---|---|---|---|---|---|---|---|---|---|
| rave.banks.js | +
+
+ |
+ 100% | +7/7 | +100% | +0/0 | +100% | +3/3 | +100% | +7/7 | +
| rave.base.js | +
+
+ |
+ 29.33% | +22/75 | +6.66% | +2/30 | +9.52% | +2/21 | +29.33% | +22/75 | +
| rave.beneficiaries.js | +
+
+ |
+ 100% | +13/13 | +100% | +0/0 | +100% | +5/5 | +100% | +13/13 | +
| rave.bills.js | +
+
+ |
+ 100% | +34/34 | +100% | +0/0 | +100% | +12/12 | +100% | +34/34 | +
| rave.charge.js | +
+
+ |
+ 97.29% | +36/37 | +100% | +0/0 | +92.3% | +12/13 | +97.29% | +36/37 | +
| rave.ebills.js | +
+
+ |
+ 100% | +7/7 | +100% | +0/0 | +100% | +3/3 | +100% | +7/7 | +
| rave.misc.js | +
+
+ |
+ 100% | +16/16 | +100% | +0/0 | +100% | +6/6 | +100% | +16/16 | +
| rave.mobile_money.js | +
+
+ |
+ 100% | +22/22 | +100% | +0/0 | +100% | +8/8 | +100% | +22/22 | +
| rave.otps.js | +
+
+ |
+ 100% | +7/7 | +100% | +0/0 | +100% | +3/3 | +100% | +7/7 | +
| rave.payment_plan.js | +
+
+ |
+ 100% | +16/16 | +100% | +0/0 | +100% | +6/6 | +100% | +16/16 | +
| rave.settlements.js | +
+
+ |
+ 100% | +7/7 | +100% | +0/0 | +100% | +3/3 | +100% | +7/7 | +
| rave.subscriptions.js | +
+
+ |
+ 100% | +13/13 | +100% | +0/0 | +100% | +5/5 | +100% | +13/13 | +
| rave.tokenized.js | +
+
+ |
+ 100% | +16/16 | +100% | +0/0 | +100% | +6/6 | +100% | +16/16 | +
| rave.transactions.js | +
+
+ |
+ 100% | +22/22 | +100% | +0/0 | +100% | +8/8 | +100% | +22/22 | +
| rave.transfers.js | +
+
+ |
+ 100% | +19/19 | +100% | +0/0 | +100% | +7/7 | +100% | +19/19 | +
| security.js | +
+
+ |
+ 8% | +2/25 | +0% | +0/2 | +0% | +0/4 | +8.33% | +2/24 | +
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 | 1x +1x + + + +2x + +1x + + +2x + +1x + + + +1x | const banks_branches = require('../services/banks/rave.banks-branches')
+const banks_country = require('../services/banks/rave.banks-country')
+
+function Bank(RaveBase) {
+
+ this.branches = function (data) {
+
+ return banks_branches(data, RaveBase);
+ }
+
+ this.country = function (data) {
+
+ return banks_country(data, RaveBase);
+
+ }
+}
+module.exports = Bank; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 | 1x +1x +1x +1x + +1x +38x +38x + +38x +38x +38x + + +38x + + + +38x +2x + + +38x + + + +38x + + + +38x + + + + + +38x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1x + + + + +1x + + + + + + + +1x + + + + + + + + + + + + + + + + + + + + + + + +1x + + + + + + + + + + + + + + + + + + + + + + + + + +1x + | var q = require('q');
+const querystring = require('querystring');
+var RaveUtils = require('../utils/rave.utils');
+var Security = require('./security');
+
+var RaveBase = function (public_key, secret_key, _base_url) {
+ RaveUtils.emptyCheck(public_key, 'Public Key required');
+ RaveUtils.emptyCheck(secret_key, 'Secret Key required');
+
+ var public_key = public_key;
+ var secret_key = secret_key;
+ var base_url = 'https://api.flutterwave.com/';
+
+ // Override BaseURL
+ Iif (_base_url && typeof _base_url === 'string') {
+ base_url = _base_url;
+ }
+
+ this.getPublicKey = function () {
+ return public_key;
+ };
+
+ this.getSecretKey = function () {
+ return secret_key;
+ };
+
+ this.getBaseUrl = function () {
+ return base_url;
+ };
+
+ this.setBaseUrl = function (new_base_url) {
+ if (new_base_url) {
+ base_url = new_base_url;
+ }
+ };
+
+ this.request = function (path, payload, callback) {
+ var requestOptions = {};
+ var requestMethod = RaveUtils.initDefaultValue(
+ payload.method,
+ 'POST' || 'PUT',
+ );
+ var datakey = requestMethod == 'POST' || 'PUT' ? 'body' : 'qs';
+ var requestJSON = datakey == 'body' ? true : false;
+ var includeQueryParams = RaveUtils.initDefaultValue(
+ payload.excludeQuery,
+ false,
+ );
+
+ // Build URL
+ let fullUrl = this.getBaseUrl() + path;
+
+ // Prepare request options for fetch
+ const fetchOptions = {
+ method: requestMethod,
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Bearer ${this.getSecretKey()}`,
+ },
+ };
+
+ // Handle query parameters for GET requests
+ if (requestMethod === 'GET') {
+ delete payload.method;
+ if (!includeQueryParams) {
+ delete payload.excludeQuery;
+ const queryParams = querystring.stringify(payload);
+ if (queryParams) {
+ fullUrl += fullUrl.includes('?') ? '&' : '?';
+ fullUrl += queryParams;
+ }
+ }
+ } else {
+ // Handle request body for non-GET requests
+ if (Object.keys(payload).length > 0) {
+ // Remove method and excludeQuery properties before sending
+ const payloadCopy = { ...payload };
+ delete payloadCopy.method;
+ delete payloadCopy.excludeQuery;
+ fetchOptions.body = JSON.stringify(payloadCopy);
+ }
+ }
+
+ // Store original options for legacy compatibility
+ requestOptions.uri = path;
+ requestOptions.baseUrl = this.getBaseUrl();
+ requestOptions.method = requestMethod;
+ requestOptions[datakey] = RaveUtils.initDefaultValue(payload, {});
+ requestOptions.json = requestJSON;
+ requestOptions.headers = fetchOptions.headers;
+
+ if (callback) {
+ this._makeRequest(fullUrl, fetchOptions, callback);
+ return requestOptions;
+ } else {
+ return this._makePromiseRequest(fullUrl, fetchOptions);
+ }
+ };
+};
+
+RaveBase.prototype.encrypt = function (data) {
+ var encryption_key = Security.getEncryptionKey(this.getSecretKey());
+ return Security.encrypt(encryption_key, JSON.stringify(data));
+};
+
+RaveBase.prototype.getIntegrityHash = function (data) {
+ return Security.getIntegrityHash(
+ data,
+ this.getPublicKey(),
+ this.getSecretKey(),
+ );
+};
+
+RaveBase.prototype._makeRequest = function (url, fetchOptions, callback) {
+ fetch(url, fetchOptions)
+ .then((response) => {
+ const res = {
+ statusCode: response.status,
+ headers: Object.fromEntries(response.headers.entries()),
+ };
+
+ return response
+ .json()
+ .then((body) => {
+ callback(null, res, body);
+ })
+ .catch((err) => {
+ return response.text().then((textBody) => {
+ callback(null, res, textBody || {});
+ });
+ });
+ })
+ .catch((err) => {
+ callback(err, {}, {});
+ });
+};
+
+RaveBase.prototype._makePromiseRequest = function (url, fetchOptions) {
+ return new Promise((resolve, reject) => {
+ fetch(url, fetchOptions)
+ .then((response) => {
+ const res = {
+ statusCode: response.status,
+ headers: Object.fromEntries(response.headers.entries()),
+ };
+
+ return response
+ .json()
+ .then((body) => {
+ resolve({ res, body });
+ })
+ .catch((err) => {
+ return response.text().then((textBody) => {
+ resolve({ res, body: textBody || {} });
+ });
+ });
+ })
+ .catch((err) => {
+ reject(err);
+ });
+ });
+};
+
+module.exports = RaveBase;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 | 1x +1x +1x +1x + + +4x +1x + + +4x +1x + +4x +1x + +4x +1x + + +1x + | const create_beneficiary = require('../services/beneficiaries/rave.create');
+const del_beneficiary = require('../services/beneficiaries/rave.delete');
+const retrieve_all = require('../services/beneficiaries/rave.retrieve');
+const retrieve = require('../services/beneficiaries/rave.single.retrieve');
+
+function Beneficiaries(RaveBase) {
+ this.create = function (data) {
+ return create_beneficiary(data, RaveBase);
+ };
+
+ this.delete = function (data) {
+ return del_beneficiary(data, RaveBase);
+ };
+ this.fetch_all = function (data) {
+ return retrieve_all(data, RaveBase);
+ };
+ this.fetch = function (data) {
+ return retrieve(data, RaveBase);
+ };
+}
+module.exports = Beneficiaries;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 | 1x +1x +1x +1x + +1x +1x +1x + +1x +1x +1x +1x + + +12x +1x + + +12x +1x + + +12x +1x + + +12x +2x + + +12x +1x + + +12x +1x + +12x +1x + +12x +1x + +12x +1x + + +12x +1x + + +12x +1x + + +1x + | const amount_to_be_paid = require('../services/bills/rave.amount.to-be-paid');
+const createbill = require('../services/bills/rave.create-bill.payment');
+const create_bulk = require('../services/bills/rave.create-bulk.bills');
+const create_order_billing = require('../services/bills/rave.create-order-billing-code');
+// const get_a_recurring = require('../services/bills/rave.get-a-recurring-bill')
+const bills = require('../services/bills/rave.get-bill-payments');
+const bill_cat = require('../services/bills/rave.get.bill-categories');
+const bill_agencies = require('../services/bills/rave.get.bill-payment-agencies');
+// const get_recurring_bills = require ('../services/bills/rave.get.recurrings-bills')
+const status = require('../services/bills/rave.get.status');
+const products_under_agency = require('../services/bills/rave.products-under-an-agency');
+const update_bills_order = require('../services/bills/rave.update-bills.order');
+const validate_bill = require('../services/bills/rave.validate-bill');
+
+function Bills(RaveBase) {
+ this.create_bill = function (data) {
+ return createbill(data, RaveBase);
+ };
+
+ this.amt_to_be_paid = function (data) {
+ return amount_to_be_paid(data, RaveBase);
+ };
+
+ this.create_bulk = function (data) {
+ return create_bulk(data, RaveBase);
+ };
+
+ this.create_ord_billing = function (data) {
+ return create_order_billing(data, RaveBase);
+ };
+
+ this.fetch_bills = function (data) {
+ return bills(data, RaveBase);
+ };
+
+ this.fetch_bills_Cat = function (data) {
+ return bill_cat(data, RaveBase);
+ };
+ this.fetch_bills_agencies = function (data) {
+ return bill_agencies(data, RaveBase);
+ };
+ this.fetch_status = function (data) {
+ return status(data, RaveBase);
+ };
+ this.fetch_products_under_agency = function (data) {
+ return products_under_agency(data, RaveBase);
+ };
+
+ this.update_bills = function (data) {
+ return update_bills_order(data, RaveBase);
+ };
+
+ this.validate = function (data) {
+ return validate_bill(data, RaveBase);
+ };
+}
+module.exports = Bills;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + + +29x +4x + + +29x +2x + + +29x +2x + + +29x +1x + + +29x +2x + + +29x +1x + + +29x + + +29x +2x + +29x +4x + +29x +4x + +29x +4x + +29x +3x + + +1x + | const card_charge = require('../services/charge/rave.card.charge');
+const ng_banks = require('../services/charge/rave.ng-banks');
+const uk_bank = require('../services/charge/rave.uk-banks');
+const ussd_Charge = require('../services/charge/rave.ussd');
+const validate_charge = require('../services/charge/rave.validate');
+const voucher_charge = require('../services/charge/rave.voucher');
+const ach_payment = require('../services/charge/rave.ach');
+const bank_trans = require('../services/charge/rave.bank.transfer');
+const applepay = require('../services/charge/rave.applepay');
+const googlepay = require('../services/charge/rave.googlepay');
+const enaira = require('../services/charge/rave.enaira');
+const fawrypay = require('../services/charge/rave.fawrypay');
+
+function Charge(RaveBase) {
+ this.card = function (data) {
+ return card_charge(data, RaveBase);
+ };
+
+ this.ng = function (data) {
+ return ng_banks(data, RaveBase);
+ };
+
+ this.ach = function (data) {
+ return ach_payment(data, RaveBase);
+ };
+
+ this.uk = function (data) {
+ return uk_bank(data, RaveBase);
+ };
+
+ this.ussd = function (data) {
+ return ussd_Charge(data, RaveBase);
+ };
+
+ this.validate = function (data) {
+ return validate_charge(data, RaveBase);
+ };
+
+ this.voucher = function (data) {
+ return voucher_charge(data, RaveBase);
+ };
+ this.bank_transfer = function (data) {
+ return bank_trans(data, RaveBase);
+ };
+ this.applepay = function (data) {
+ return applepay(data, RaveBase);
+ };
+ this.googlepay = function (data) {
+ return googlepay(data, RaveBase);
+ };
+ this.enaira = function (data) {
+ return enaira(data, RaveBase);
+ };
+ this.fawrypay = function (data) {
+ return fawrypay(data, RaveBase);
+ };
+}
+module.exports = Charge;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 | 1x +1x + + + +4x + +3x + + + +4x + +1x + + + +1x | const order_ebills = require('../services/ebills/rave.order')
+const update_ebills = require('../services/ebills/rave.update')
+
+function Ebills(RaveBase) {
+
+ this.order = function (data) {
+
+ return order_ebills(data, RaveBase);
+
+ }
+
+ this.update = function (data) {
+
+ return update_ebills(data, RaveBase);
+ }
+
+}
+module.exports = Ebills; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 | 1x +1x +1x +1x +1x + + +5x +1x + + +5x +1x + + +5x +1x + + +5x +1x + + +5x +1x + + +1x + | const balances_currency = require('../services/misc/rave.balances-currency');
+const get_bal = require('../services/misc/rave.balances');
+const initBVN = require('../services/misc/rave.initiate.bvn');
+const verifBVN = require('../services/misc/rave.verify.bvn')
+const resolve_act = require('../services/misc/rave.resolve.account');
+
+function Misc(RaveBase) {
+ this.bal_currency = function (data) {
+ return balances_currency(data, RaveBase);
+ };
+
+ this.bal = function (data) {
+ return get_bal(data, RaveBase);
+ };
+
+ this.bvn = function (data) {
+ return initBVN(data, RaveBase);
+ };
+
+ this.verifybvn = function (data) {
+ return verifBVN(data, RaveBase);
+ }
+
+ this.verify_Account = function (data) {
+ return resolve_act(data, RaveBase);
+ };
+}
+module.exports = Misc;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 | 1x +1x +1x +1x +1x +1x +1x + + +19x +3x + + +19x +3x + + +19x +2x + + +19x +2x + +19x +5x + + +19x +2x + + +19x +2x + + +1x + | const gh = require('../services/mobile-money/rave.ghana');
+const mpesa_money = require('../services/mobile-money/rave.mpesa');
+const rw = require('../services/mobile-money/rave.rwanda');
+const ug = require('../services/mobile-money/rave.uganda');
+const zm = require('../services/mobile-money/rave.zambia');
+const franc = require('../services/mobile-money/rave.francophone');
+const tz = require('../services/mobile-money/rave.tanzania')
+
+function Mobile_money(RaveBase) {
+ this.ghana = function (data) {
+ return gh(data, RaveBase);
+ };
+
+ this.mpesa = function (data) {
+ return mpesa_money(data, RaveBase);
+ };
+
+ this.rwanda = function (data) {
+ return rw(data, RaveBase);
+ };
+
+ this.uganda = function (data) {
+ return ug(data, RaveBase);
+ };
+ this.franco_phone = function (data) {
+ return franc(data, RaveBase);
+ };
+
+ this.zambia = function (data) {
+ return zm(data, RaveBase);
+ };
+
+ this.tanzania = function (data) {
+ return tz(data, RaveBase);
+ }
+}
+module.exports = Mobile_money;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 | 1x +1x + + + + +2x + +1x + + + +2x + +1x + + + + + + +1x | const create_otp = require('../services/otps/rave.create')
+const validate_otp = require('../services/otps/rave.validate')
+
+
+function Otp(RaveBase) {
+
+ this.create = function (data) {
+
+ return create_otp(data, RaveBase);
+
+ }
+
+ this.validate = function (data) {
+
+ return validate_otp(data, RaveBase);
+
+ }
+
+
+
+}
+module.exports = Otp; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 | 1x +1x +1x +1x +1x + + + + + + +5x + +1x + + + +5x + +1x + + +5x + +1x + + +5x + +1x + + +5x + +1x + + + + +1x | const create_plan = require('../services/payment-plans/rave.create')
+const cancel_plan = require('../services/payment-plans/rave.cancel')
+const retrieve_all = require('../services/payment-plans/rave.retrieve.all')
+const retrieve_single = require('../services/payment-plans/rave.retrieve.single')
+const update_plan = require('../services/payment-plans/rave.update')
+
+
+
+function Payment_plan(RaveBase) {
+
+
+ this.create = function (data) {
+
+ return create_plan(data, RaveBase);
+
+ }
+
+ this.cancel = function (data) {
+
+ return cancel_plan(data, RaveBase);
+
+ }
+ this.get_all = function (data) {
+
+ return retrieve_all(data, RaveBase);
+
+ }
+ this.get_plan = function (data) {
+
+ return retrieve_single(data, RaveBase);
+
+ }
+ this.update = function (data) {
+
+ return update_plan(data, RaveBase);
+
+ }
+
+}
+module.exports = Payment_plan; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 | 1x +1x + + + + + +2x + +1x + + + +2x + +1x + + + + + +1x | const retrieve_all = require('../services/settlements/rave.retrieve-all')
+const retrieve = require('../services/settlements/rave.retrieve')
+
+
+function Settlements(RaveBase) {
+
+
+ this.fetch_all = function (data) {
+
+ return retrieve_all(data, RaveBase);
+
+ }
+
+ this.fetch = function (data) {
+
+ return retrieve(data, RaveBase);
+
+ }
+
+
+}
+module.exports = Settlements; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 | 1x +1x +1x +1x + + + + + +4x + +1x + + + +4x + +1x + + + +4x + +1x + + + +4x + +1x + + + + +1x | const activate_sub = require('../services/subscriptions/rave.activate')
+const cancel_sub = require('../services/subscriptions/rave.cancel')
+const retrieve_all = require('../services/subscriptions/rave.retrieve.all')
+const fetch_one = require('../services/subscriptions/rave.retrieve.single')
+
+
+function Subscriptions(RaveBase) {
+
+
+ this.activate = function (data) {
+
+ return activate_sub(data, RaveBase);
+
+ }
+
+ this.cancel = function (data) {
+
+ return cancel_sub(data, RaveBase);
+
+ }
+
+ this.fetch_all = function (data) {
+
+ return retrieve_all(data, RaveBase);
+
+ }
+
+ this.get = function (data) {
+
+ return fetch_one(data, RaveBase);
+
+ }
+
+}
+module.exports = Subscriptions; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 | 1x +1x +1x +1x +1x + + + + + + + +6x + +1x + + +6x + +1x + + + +6x + +1x + + + +6x + +1x + + + + +6x + +2x + + + + + + +1x | const bulk_charge = require('../services/tokenized-charges/rave.bulk.charge')
+const charge_token = require('../services/tokenized-charges/rave.charge')
+const retrieve_a_bulk = require('../services/tokenized-charges/rave.retrieve.a.bulk')
+const retrieve_charge_trans = require('../services/tokenized-charges/rave.retrieve.charge.transactions')
+const update_a_token = require('../services/tokenized-charges/rave.update.tokens')
+
+
+
+
+function Tokenized(RaveBase) {
+
+
+ this.charge = function (data) {
+
+ return charge_token(data, RaveBase);
+
+ }
+ this.fetch_bulk = function (data) {
+
+ return retrieve_a_bulk(data, RaveBase);
+
+ }
+
+ this.bulk = function (data) {
+
+ return bulk_charge(data, RaveBase);
+
+ }
+
+ this.fetch_charge_transactions = function (data) {
+
+ return retrieve_charge_trans(data, RaveBase);
+
+ }
+
+
+ this.update_token = function (data) {
+
+ return update_a_token(data, RaveBase);
+
+ }
+
+
+
+}
+module.exports = Tokenized; |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 | 1x +1x +1x +1x +1x +1x +1x + + +7x +1x + + +7x +1x + + +7x +1x + + +7x +1x + + +7x +1x + + +7x +1x + + +7x +1x + + +1x + | const event_trans = require('../services/transactions/rave.events');
+const fee_trans = require('../services/transactions/rave.fee');
+const refund_trans = require('../services/transactions/rave.refund');
+const resend_hooks_trans = require('../services/transactions/rave.resend-hooks');
+const retrieve_trans = require('../services/transactions/rave.retrieve');
+const verify_trans = require('../services/transactions/rave.verify');
+const verify_trans_tx = require('../services/transactions/rave.verify-by-txref');
+
+function Transactions(RaveBase) {
+ this.event = function (data) {
+ return event_trans(data, RaveBase);
+ };
+
+ this.fee = function (data) {
+ return fee_trans(data, RaveBase);
+ };
+
+ this.refund = function (data) {
+ return refund_trans(data, RaveBase);
+ };
+
+ this.resend_hooks = function (data) {
+ return resend_hooks_trans(data, RaveBase);
+ };
+
+ this.fetch = function (data) {
+ return retrieve_trans(data, RaveBase);
+ };
+
+ this.verify = function (data) {
+ return verify_trans(data, RaveBase);
+ };
+
+ this.verify_by_tx = function (data) {
+ return verify_trans_tx(data, RaveBase);
+ }
+}
+module.exports = Transactions;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 | 1x +1x +1x +1x +1x +1x + + +8x +1x + + +8x +1x + +8x +3x + +8x +1x + +8x +1x + +8x +1x + + +1x + | const bulk_transfer = require('../services/transfers/rave.bulk');
+const fee_transfer = require('../services/transfers/rave.fee');
+const initiate_transfer = require('../services/transfers/rave.initiate');
+const fetch_transfers = require('../services/transfers/rave.retrieve.transfers');
+const getATransfer = require('../services/transfers/rave.fetch');
+const wallet = require('../services/transfers/rave.wallet');
+
+function Transfers(RaveBase) {
+ this.bulk = function (data) {
+ return bulk_transfer(data, RaveBase);
+ };
+
+ this.fee = function (data) {
+ return fee_transfer(data, RaveBase);
+ };
+ this.initiate = function (data) {
+ return initiate_transfer(data, RaveBase);
+ };
+ this.fetch = function (data) {
+ return fetch_transfers(data, RaveBase);
+ };
+ this.get_a_transfer = function (data) {
+ return getATransfer(data, RaveBase);
+ };
+ this.wallet_to_wallet = function (data) {
+ return wallet(data, RaveBase);
+ };
+}
+module.exports = Transfers;
+ |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +| 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 | +1x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1x + + + + | // var createHash = require('sha.js');
+var crypto = require('crypto');//crypto is faster and managed by NodeJs
+
+// this is the getKey function that generates an encryption Key
+// for you by passing your Secret Key as a parameter.
+function getKey(seckey) {
+ var md5 = require('md5');
+ var keymd5 = md5(seckey);
+ var keymd5last12 = keymd5.substr(-12);
+
+ var seckeyadjusted = seckey.replace('FLWSECK-', '');
+ var seckeyadjustedfirst12 = seckeyadjusted.substr(0, 12);
+
+ return seckeyadjustedfirst12 + keymd5last12;
+}
+
+// This is the encryption function that encrypts your payload
+// by passing the stringified format and your encryption Key.
+// function encrypt(key, text)
+// {
+// console.log("Key: "+key)
+
+// console.log("Txt: "+text)
+// var forge = require('node-forge');
+// var cipher = forge.cipher.createCipher('3DES-ECB', forge.util.createBuffer(key));
+// cipher.start({iv:''});
+// cipher.update(forge.util.createBuffer(text, 'utf-8'));
+// cipher.finish();
+// var encrypted = cipher.output;
+// return ( forge.util.encode64(encrypted.getBytes()) );
+// }
+
+function encrypt(key, text) {
+ var forge = require("node-forge");
+ var cipher = forge.cipher.createCipher(
+ "3DES-ECB",
+ forge.util.createBuffer(key)
+ );
+ cipher.start({
+ iv: ""
+ });
+ cipher.update(forge.util.createBuffer(text, "utf-8"));
+ cipher.finish();
+ var encrypted = cipher.output;
+ return forge.util.encode64(encrypted.getBytes());
+}
+
+function getIntegrityHash(data, pubkey, seckey) {
+
+ var objectKeys = Object.keys(data);
+ objectKeys.sort();
+ var hashString = "";
+ objectKeys
+ .forEach(function (ok) {
+
+ if (ok == 'integrity_hash') return; // don't include int hash
+ hashString += data[ok];
+
+ });
+ hashString += seckey;
+ var hash = crypto.createHash('sha256').update(hashString, 'utf8').digest('hex');
+ return hash;
+}
+
+
+module.exports = {
+ getEncryptionKey: getKey,
+ encrypt: encrypt,
+ getIntegrityHash: getIntegrityHash
+} |