Commit f37d1da1 by 王栋源

wdy

parent 64a95b0a
...@@ -8,7 +8,7 @@ class TradetransferAPI extends APIBase { ...@@ -8,7 +8,7 @@ class TradetransferAPI extends APIBase {
this.execlient = system.getObject("util.execClient"); this.execlient = system.getObject("util.execClient");
this.channelApiUrl = settings.channelApiUrl(); this.channelApiUrl = settings.channelApiUrl();
this.appInfo = { this.appInfo = {
aliyuntmtransfer: { appkey: "201911131657", secret: "eeb18393aade40149287b024d8ba0850" } aliyuntmtransfer: { appkey: "201912031344", secret: "7cbb846246874167b5c7e01cd0016c88" }
}; };
} }
...@@ -31,16 +31,73 @@ class TradetransferAPI extends APIBase { ...@@ -31,16 +31,73 @@ class TradetransferAPI extends APIBase {
} }
//订单创建 //订单创建
async acceptOrder(p,obj) { async acceptOrder(pobj,qobj,req) {
if (!pobj.BizId) {
return {
"errorCode": "error",
"errorMsg": "订单号不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
}
}
if (!pobj.UserName) {
return {
"errorCode": "error",
"errorMsg": "用户不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
}
}
if (!pobj.Mobile) {
return {
"errorCode": "error",
"errorMsg": "用户手机号不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
}
}
if (!pobj.Price) {
return {
"errorCode": "error",
"errorMsg": "价格不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
}
}
var sobj = { var sobj = {
"actionProcess": "aliyuntmtransfer", "actionProcess": "aliyuntmtransfer",
"actionType": "aliclient", "actionType": "aliclient",
"sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI", "sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI",
"isUser": "yes", "isUser": "yes",
"actionBody": obj "actionBody": {
"itemCode": "alitmtt",
"channelParams": pobj,
"channelUser": {
"channelUserId": pobj.Mobile,
"channelUserName": pobj.UserName,
"channelUserMoblie": pobj.Mobile,
"nickname": "",
"orgName": "",
"orgPath": ""
},
"channelOrder": {
"channelServiceNo": pobj.BizId,
"channelOrderNo": "",
"needNo": pobj.BizId,
"quantity": 1,
"totalSum": parseInt(pobj.Price),
"payTotalSum": parseInt(pobj.Price) * 0.2,
"payStatus": "bfyfk",
"payTime": (new Date()).Format("yyyy-MM-dd hh:mm:ss")
}
}
} }
var tokenInfo = await this.getToken(); var tokenInfo = await this.getToken();
var url = this.channelApiUrl + "/api/action/tradetransfer/createtransfer"; var url = this.channelApiUrl + "/action/tradetransfer/createtransfer";
var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token); var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
//var rtn = await this.execlient.execPostTK(sobj, url,"token"); //var rtn = await this.execlient.execPostTK(sobj, url,"token");
return rtn; return rtn;
...@@ -51,10 +108,10 @@ class TradetransferAPI extends APIBase { ...@@ -51,10 +108,10 @@ class TradetransferAPI extends APIBase {
"actionProcess": "aliyuntmtransfer", "actionProcess": "aliyuntmtransfer",
"actionType": "aliclient", "actionType": "aliclient",
"sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI", "sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI",
"actionBody": obj "actionBody": p
} }
var tokenInfo = await this.getToken(); var tokenInfo = await this.getToken();
var url = this.channelApiUrl + "/api/action/tradetransfer/ordersel"; var url = this.channelApiUrl + "/action/tradetransfer/ordersel";
var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token); var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
// var rtn = await this.execlient.execPostTK(sobj, url,"token"); // var rtn = await this.execlient.execPostTK(sobj, url,"token");
return rtn; return rtn;
...@@ -66,10 +123,10 @@ class TradetransferAPI extends APIBase { ...@@ -66,10 +123,10 @@ class TradetransferAPI extends APIBase {
"actionProcess": "aliyuntmtransfer", "actionProcess": "aliyuntmtransfer",
"actionType": "aliclient", "actionType": "aliclient",
"sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI", "sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI",
"actionBody": obj "actionBody": p
} }
var tokenInfo = await this.getToken(); var tokenInfo = await this.getToken();
var url = this.channelApiUrl + "/api/transfer/tradeApi/orderclose"; var url = this.channelApiUrl + "/transfer/tradeApi/orderclose";
var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token); var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
// var rtn = await this.execlient.execPostTK(sobj, url,"token"); // var rtn = await this.execlient.execPostTK(sobj, url,"token");
return rtn; return rtn;
......
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