adp-sdk 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/pay/Device.js +18 -0
package/package.json
CHANGED
package/pay/Device.js
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
var Http = require('../adapay-core/Http');
|
2
|
+
var Logger = require('../adapay-core/Logger');
|
3
|
+
var Config = require('./Config');
|
4
|
+
function add(kwargs) {
|
5
|
+
return new Promise(function (resolve, reject) {
|
6
|
+
let url = Config.base_url + `/v1/payments/device/add`;
|
7
|
+
Http.post(url, kwargs, Config)
|
8
|
+
.then(function (result) {
|
9
|
+
Logger.info(result);
|
10
|
+
resolve(result);
|
11
|
+
})
|
12
|
+
.catch(function (error) {
|
13
|
+
Logger.error(error);
|
14
|
+
reject(error);
|
15
|
+
});
|
16
|
+
});
|
17
|
+
}
|
18
|
+
module.exports = { add };
|