-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
payment.js
47 lines (43 loc) · 1.2 KB
/
payment.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
42
43
44
45
46
47
var request = require('./base-request');
module.exports = {
getGoPayDetail: function (callback) {
var options = {
method: 'GET',
};
request._request(options, '/wallet/profile/detailed', callback);
},
// page start from 1
getGoPayHistory: function (page, limit, callback) {
var options = {
method: 'GET',
qs: {
page: page,
limit: limit
}
};
request._request(options, '/wallet/history', callback);
},
getGoPayQrId: function (phoneNumber, callback) {
var options = {
method: 'GET',
qs: {
phone_number: phoneNumber,
},
};
request._request(options, '/wallet/qr-code', callback);
},
transferGoPay: function (qrId, amount, description, pinCode, callback) {
var options = {
method: 'POST',
body: {
qr_id: qrId,
amount: amount,
description: description
},
headers: {
pin: pinCode
}
};
request._request(options, '/v2/fund/transfer', callback);
}
};