-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (33 loc) · 1.14 KB
/
index.js
File metadata and controls
37 lines (33 loc) · 1.14 KB
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
const Client = require('./lib/client');
const Checkout = require('./lib/checkout');
const Invoice = require('./lib/invoice');
const Vault = require('./lib/vault');
const Webhooks = require('./lib/webhooks');
const { ENVIRONMENTS } = require('./lib/constants');
/**
* PayMaya Main Class
*/
class Paymaya {
/**
* Initializes the PayMaya client
* @param {Object} options Configuration options
* @param {String} options.publicKey Public API Key
* @param {String} options.secretKey Secret API Key
* @param {String} options.environment Environment (SANDBOX or PRODUCTION)
*/
constructor(options = {}) {
this.publicKey = options.publicKey;
this.secretKey = options.secretKey;
this.environment = options.environment || ENVIRONMENTS.SANDBOX;
this.client = new Client({
publicKey: this.publicKey,
secretKey: this.secretKey,
environment: this.environment
});
this.checkout = new Checkout(this.client);
this.invoice = new Invoice(this.client);
this.vault = new Vault(this.client);
this.webhooks = new Webhooks(this.client);
}
}
module.exports = Paymaya;