diff --git a/index.js b/index.js index ba433c8..24c9f57 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,7 @@ function Cross_Switch(app_id,app_key,live=false,url=null) { Cross_Switch.prototype = { - extend: function(params) { + extend: async function(params) { // This looks more sane. var self = this; // console.log(self); @@ -63,7 +63,7 @@ Cross_Switch.prototype = { // Pull body passed var body = args.length === 2 ? args[1] : args[0]; - paramList.filter((item, index, array)=> { + await paramList.filter(async(item, index, array)=> { if(item.indexOf("*") === -1) { // Not required return; diff --git a/package.json b/package.json index 5dc1218..7a017d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cross-switch-gh", - "version": "0.0.3", + "version": "0.0.4", "description": "Cross-Switch Ghana API wrapper", "main": "index.js", "scripts": { diff --git a/resources/bill.js b/resources/bill.js index 134e6e8..7c1bbc9 100644 --- a/resources/bill.js +++ b/resources/bill.js @@ -10,7 +10,7 @@ module.exports = { createBill: { method: 'post', endpoint: [root, '/CreateCustomerBill'].join(''), - params: ['type*','number','name*','mobile*','currency*','email*','amount*','description*','frequency','expiry'] + params: ['type','number','name*','mobile*','currency*','email*','amount*','description*','frequency','expiry'] }, /* diff --git a/resources/payment.js b/resources/payment.js index 65cde0c..3182186 100644 --- a/resources/payment.js +++ b/resources/payment.js @@ -33,6 +33,23 @@ module.exports = { params: ['name*','email*','mobile*', 'mobile_network*', 'amount*', 'currency*', 'order_id*', 'order_desc', 'customerid', 'signature', 'callback'] }, + /* + Create Checkout + */ + CreateCheckout: { + method: 'post', + endpoint: [root, '/CreateCheckout'].join(''), + params: ['options','name*','email*','mobile*','amount*','currency*','order_id*','order_desc*','customerid','redirecturl','callbackurl'] + }, + + /* + Get Trans Charge + */ + GetTransCharge: { + method: 'post', + endpoint: [root, '/GetTransCharge'].join(''), + params: ['type*','amount*'] + }, /* Balance Enquiry