Commit 09ecbe89 by 王栋源

wdy

parent 9955490d
var APIBase = require("../../api.base");
var system = require("../../../system");
class PaymentAPI extends APIBase {
constructor() {
super();
this.execlient = system.getObject("util.execClient");
this.centerPaymentUrl = settings.centerPaymentUrl();
this.utilstlbankSve = system.getObject("service.utils.utilstlbankSve");
}
/**
* 接口跳转-POST请求
* actionProcess 执行的流程
* actionType 执行的类型
* actionBody 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
if (!pobj.action_type) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
return result;
}
async opActionProcess(action_process, action_type, action_body, req) {
var opResult = null;
var url = "";
switch (action_type) {
// sy
case "getQrCode"://pc端订单支付二维码生成
url = this.centerPaymentUrl + "api/payment/paymentApi/getQrCode";
break;
case "queryOrder"://通联支付查询
url = this.centerPaymentUrl + "api/payment/paymentApi/queryOrder";
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
if (url) {
opResult = system.getResultSuccess(null, "action_type参数错误");
}
var opResultstr = await this.execlient.execPost(action_body, url);
opResult = JSON.parse(opResultstr.stdout)
return opResult;
}
}
module.exports = PaymentAPI;
\ No newline at end of file
......@@ -34,6 +34,13 @@ var settings = {
return "https://centerapp/";
}
},
centerPaymentUrl: function () {
if (this.env == "dev") {
return "http://192.168.18.34:4005/";
} else {
return "http://center-payment";
}
},
reqTransferurl: function () {
if (this.env == "dev") {
return "http://192.168.18.61:3003/";
......
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