Commit ed3afef2 by 王昆

Merge branch 'bpo-web' of gitlab.gongsibao.com:jiangyong/zhichan into bpo-web

parents 70173258 11560202
...@@ -555,12 +555,77 @@ class BpoSDPJApi { ...@@ -555,12 +555,77 @@ class BpoSDPJApi {
// 通过postman推送回调 // 通过postman推送回调
async notifyGuestById(obj, req) { async notifyGuestById(obj, req) {
this.notifyCash(obj.id); let res =await this.notifyCash(obj.no);
return this.getBaseResult(0, "调用成功", res);
} }
// 推送回调 // 推送回调
async notifyCash(id) { async notifyCash(id) {
// TODO 总统 try { // 签名验证
if(!id){
return this.getErrResult("ID不能为空");
}
let ccashinfo = await this.ccashinfoSve.findOne({
id:id
});
if(!ccashinfo.app_id){
return this.getErrResult("app_id不能为空");
}
if(!ccashinfo.ecid){
return this.getErrResult("ecid不能为空");
}
if(!ccashinfo.outTradeNo){
return this.getErrResult("outTradeNo不能为空");
}
if(!ccashinfo.amt){
return this.getErrResult("amt不能为空");
}
// if(!ccashinfo.id_name){
// return this.getErrResult("id_name不能为空");
// }
// if(!ccashinfo.id_no){
// return this.getErrResult("id_no不能为空");
// }
if(!ccashinfo.notify_url){
return this.getErrResult("notify_url不能为空");
}
// 获取api信息
let api = await this.ecompanybusiSve.findOne({
appId: ccashinfo.app_id,
etemplate_id: ccashinfo.ecid,
mchtId: ccashinfo.mchtId,
});
if (!api) {
return this.getBaseResult(1001003, "配置信息错误,请联系薪必果人员进行配置");
}
let param = {
appId: ccashinfo.app_id,
ecid: ccashinfo.ecid,
outTradeNo: ccashinfo.outTradeNo,
amt: ccashinfo.amt,
idName: ccashinfo.id_name,
idNo: ccashinfo.id_no,
tradeStatus:ccashinfo.trade_status,
nonceStr:await this.getUidStr(32, 36),
};
let sign=system.getSign(param, api.key, this.EXCEPT_KEYS)
param.sign=sign;
let rs = await axios({
method: 'post',
url:ccashinfo.notify_url,
data: param,
});
return rs.data;
} catch (e) {
console.log(e);
let result = {
code: 500,
msg: "接口异常"
};
console.log(e.stack);
return result;
}
} }
getSuccessResult(msg = "success", data = {}) { getSuccessResult(msg = "success", data = {}) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment