Commit 31f2f411 by linboxuan

icp gateway

parent 6cee492f
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "启动程序",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/main.js"
}
]
}
\ No newline at end of file
...@@ -42,6 +42,9 @@ class TradetransferAPI extends APIBase { ...@@ -42,6 +42,9 @@ class TradetransferAPI extends APIBase {
case "paySuccess"://支付回调 case "paySuccess"://支付回调
opResult = await this.utilsNeedSve.paySuccess(pobj); opResult = await this.utilsNeedSve.paySuccess(pobj);
break; break;
case "queryOrderState":// 通知状态变更
opResult = await this.utilsNeedSve.queryOrderState(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -258,5 +258,55 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -258,5 +258,55 @@ class UtilsNeedSve extends AppServiceBase {
} }
} }
async queryOrderState(pobj) {
var self = this;
// 获取app token
var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) {
return {
"requestId": self.getUUID(),
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
}
var userpin = "";
var sobj = {
"actionType": "getItemByChannelSolutionNo",
"actionBody": pobj
}
//带userpin请求
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var token = tokenInfo.data.token;
var rtn = rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) {
// return { "message": "网络错误", "data": {}, "code": -102 }
return {
"requestId": self.getUUID(),
"success": false,
"errorMsg": "网络错误",
"errorCode": "ok"
};
}
var result = JSON.parse(rtn.stdout);
if (result.status == 0) {
// return { "message": "true", "data": {}, "code": 200 }
return {
"requestId": result.requestId,
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
} else {
// return { "message": result.msg, "data": {}, "code": -102 }
return {
"requestId": result.requestId,
"success": false,
"errorMsg": result.msg,
"errorCode": "ok"
};
}
}
} }
module.exports = UtilsNeedSve; module.exports = UtilsNeedSve;
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