Commit 1a7163d2 by 庄冰

icpclose

parent 56c7131b
......@@ -43,6 +43,9 @@ class TradetransferAPI extends APIBase {
case "icpOrderStatus"://接收方案反馈信息
opResult = await this.utilsNeedSve.icpOrderStatus(pobj);
break;
case "icpOrderClose"://关闭icp订单
opResult = await this.utilsNeedSve.icpOrderClose(pobj);
break;
// -------------提交Icp需求--------庄冰2020.10.21-------百度Icp接入使用--------end------------------
case "needClose"://关闭需求
opResult = await this.utilsNeedSve.reqcenterchannel(pobj);
......
......@@ -474,6 +474,58 @@ class UtilsNeedSve extends AppServiceBase {
"errorCode": "ok"
};
}
//百度icp 2.4 请求 关闭icp订单
async icpOrderClose(pobj) {
var self = this;
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){
return {
"requestId": self.getUUID(),
"success": false,
"errorMsg": "无效应用",
"errorCode": "ok"
};
}
// 获取app token
// var tokenInfo = await this.getCenterToken();
var tokenInfo = await this.getCenterTokenByApp(pobj.appInfo);
if (tokenInfo.status != 0) {
return {
"requestId": self.getUUID(),
"success": false,
"errorMsg": "",
"errorCode": "ok"
};
}
var token = tokenInfo.data.token;
// icpNotify
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
pobj.actionType = "icpOrderClose";
var rtn = await this.execlient.execPostTK(pobj, url, token);
if (!rtn || !rtn.stdout) {
return {
"requestId": self.getUUID(),
"success": false,
"errorMsg": "网络错误",
"errorCode": "ok"
};
}
var result = JSON.parse(rtn.stdout);
if (result.status != 0) {
return {
"requestId": result.requestId,
"success": false,
"errorMsg": result.msg,
"errorCode": "ok"
};
}
return {
"requestId": result.requestId,
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
}
// -------------提交Icp需求--------庄冰2020.10.21-------百度Icp接入使用--------end------------------
async paySuccess(pobj) {
var sobj = {
......
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