Skip to content

Commit

Permalink
Added Checkout Method
Browse files Browse the repository at this point in the history
  • Loading branch information
harmonizerblinks committed Apr 18, 2023
1 parent 3b4999b commit 5139c2f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion resources/bill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
},

/*
Expand Down
17 changes: 17 additions & 0 deletions resources/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5139c2f

Please sign in to comment.