Skip to content

Commit 5139c2f

Browse files
Added Checkout Method
1 parent 3b4999b commit 5139c2f

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function Cross_Switch(app_id,app_key,live=false,url=null) {
3535

3636
Cross_Switch.prototype = {
3737

38-
extend: function(params) {
38+
extend: async function(params) {
3939
// This looks more sane.
4040
var self = this;
4141
// console.log(self);
@@ -63,7 +63,7 @@ Cross_Switch.prototype = {
6363

6464
// Pull body passed
6565
var body = args.length === 2 ? args[1] : args[0];
66-
paramList.filter((item, index, array)=> {
66+
await paramList.filter(async(item, index, array)=> {
6767
if(item.indexOf("*") === -1) {
6868
// Not required
6969
return;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cross-switch-gh",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Cross-Switch Ghana API wrapper",
55
"main": "index.js",
66
"scripts": {

resources/bill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
createBill: {
1111
method: 'post',
1212
endpoint: [root, '/CreateCustomerBill'].join(''),
13-
params: ['type*','number','name*','mobile*','currency*','email*','amount*','description*','frequency','expiry']
13+
params: ['type','number','name*','mobile*','currency*','email*','amount*','description*','frequency','expiry']
1414
},
1515

1616
/*

resources/payment.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ module.exports = {
3333
params: ['name*','email*','mobile*', 'mobile_network*', 'amount*', 'currency*', 'order_id*', 'order_desc', 'customerid', 'signature', 'callback']
3434
},
3535

36+
/*
37+
Create Checkout
38+
*/
39+
CreateCheckout: {
40+
method: 'post',
41+
endpoint: [root, '/CreateCheckout'].join(''),
42+
params: ['options','name*','email*','mobile*','amount*','currency*','order_id*','order_desc*','customerid','redirecturl','callbackurl']
43+
},
44+
45+
/*
46+
Get Trans Charge
47+
*/
48+
GetTransCharge: {
49+
method: 'post',
50+
endpoint: [root, '/GetTransCharge'].join(''),
51+
params: ['type*','amount*']
52+
},
3653

3754
/*
3855
Balance Enquiry

0 commit comments

Comments
 (0)