-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (40 loc) · 1.09 KB
/
index.js
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
const Aps = require("./aps");
const zaincash = require("./zaincash");
const amwal = require("./paytabs");
const Switch = require("./switch");
const AsiaHawala = require("./asiaHawala");
// userName = "api_thestation";
// password = "8WifwVjaV71J432z8B5j";
// baseUrl = "https://uat-proxy.aps.iq:5443";
// cred = {
// Authorization: "SGJNZGZL9R-J2H6DJZRBM-WTKBLM96RH",
// profile_id: "79870",
// tran_type: "sale",
// tran_class: "ecom",
// callback: "https://yourdomain.com/ll",
// return: "https://yourdomain.com/yourpage",
// };
class Payment {
constructor(method, conf) {
switch (method) {
case "Aps":
this.inject = new Aps(conf[method]);
break;
case "ZainCash":
this.inject = new zaincash(conf[method]);
break;
case "PayTabs":
this.inject = new amwal(conf[method]);
break;
case "Switch":
this.inject = new Switch(conf[method]);
break;
case "AsiaHawala":
this.inject = new AsiaHawala(conf[method]);
break;
default:
this.inject = null;
}
}
}
module.exports = Payment;