Commit 776c0e9c by 王栋源

wdy

parent 4de61993
......@@ -314,35 +314,6 @@ class utilsTlBankSve {
return result;
}
async getReqBeforeParam(jsonObj, pay_key) {//获取请求前的参数信息
jsonObj.key = pay_key;
var reqResult = { status: 0, msg: "ok", req_param: null };
var signArr = [];
var keys = Object.keys(jsonObj).sort();
if (keys.length == 0) {
reqResult.status = -230;
reqResult.msg = "请求参数信息为空";
return reqResult;
}
for (let k = 0; k < keys.length; k++) {
const tKey = keys[k];
if (tKey != "sign" && jsonObj[tKey]) {
signArr.push(tKey + "=" + jsonObj[tKey]);
}
}
if (signArr.length == 0) {
reqResult.status = -250;
reqResult.msg = "请求组装签名参数信息为空";
return reqResult;
}
var signStr = signArr.join("&");
var tmpSign = md5(signStr).toUpperCase();
jsonObj.sign = tmpSign;
delete jsonObj["key"];
reqResult.req_param = jsonObj;
return reqResult;
}
async receiveCallBackNotify(parmas, client_ip) {//收到通联回调通知---post请求
var result = "FAIL";
......@@ -389,9 +360,9 @@ class utilsTlBankSve {
parmas.out_trade_no = attachList[0].substr(3);
parmas.uappid = attachList.length == 2 ? attachList[1] : attachList[2];
//重写新签名
var newparmas = await this.getReqBeforeParam(parmas, appinfo.upp_secret);
console.log(newparmas);
var backResult = await this.execReqInfo(null,payParam.notify_url,newparmas);
var newparmas = await this.getReqBeforeParam(parmas, appinfo.uapp_secret);
var signResult = await this.resultSign(newparmas.req_param, appinfo.uapp_secret);
var backResult = await this.execReqInfo(null,payParam.notify_url,newparmas.req_param);
if (backResult.status != 0) {
result = backResult.msg;
return result;
......
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