installment.js
1.4 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* 分期付款
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/08/01
*/
'use strict';
const api = global.yoho.API;
const logger = global.yoho.logger;
//const camelCase = global.yoho.camelCase;
// 获取分期开通状态
const getStauts = (uid) => {
return api.get('', {
method: 'user.instalment.getStatus',
uid: uid
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
logger.error('get installment open status return is not 200');
return '';
}
});
};
// 获取用户可用额度信息
const getQueryCreditInfo = (uid) => {
return api.get('', {
method: 'order.queryCreditInfo',
uid: uid
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
logger.error('get user installment usable price info return is not 200');
return '';
}
});
};
// 获取用户待还款金额
const getQueryAmtInfo = (uid) => {
return api.get('', {
method: 'order.queryAmtInfo',
uid: uid
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
logger.error('get user installment repay info return is not 200');
return '';
}
});
}
module.exports = {
getStauts,
getQueryCreditInfo
};