Commit 051e9b00 by 宋毅

tj

parent 35473eec
...@@ -9,6 +9,7 @@ var moment = require('moment'); ...@@ -9,6 +9,7 @@ var moment = require('moment');
const md5 = require("MD5"); const md5 = require("MD5");
class TestApi { class TestApi {
constructor() { constructor() {
this.utilstlbankSve = System.getObject("service.utilstlbankSve");
this.bytmmonitSve = System.getObject("service.bytmmonitSve"); this.bytmmonitSve = System.getObject("service.bytmmonitSve");
this.utilscloudSve = System.getObject("service.utilscloudSve"); this.utilscloudSve = System.getObject("service.utilscloudSve");
this.trademarkSve = System.getObject("service.trademarkSve"); this.trademarkSve = System.getObject("service.trademarkSve");
...@@ -40,15 +41,17 @@ class TestApi { ...@@ -40,15 +41,17 @@ class TestApi {
return y + "-" + m.substring(m.length - 2, m.length) + "-" + d.substring(d.length - 2, d.length); return y + "-" + m.substring(m.length - 2, m.length) + "-" + d.substring(d.length - 2, d.length);
} }
async test(obj) { async test(obj) {
// try { try {
// var result = await this.businesscompanySve.recycleBusiness();
// // var result = await this.businesscompanySve.freeClaimOperation({ id: 41, company_id: 4 }, "xz", [1095, 1113]); var result= await this.utilstlbankSve.getH5Url();
// // var result = await this.businesscompanySve.protectBus({ id: 41, company_id: 4 }, "xz", ["RL20190429114493kNw4", "RL2019042911449mftfK"]); // var result = await this.businesscompanySve.recycleBusiness();
// console.log(result, "result.................."); // var result = await this.businesscompanySve.freeClaimOperation({ id: 41, company_id: 4 }, "xz", [1095, 1113]);
// return result; // var result = await this.businesscompanySve.protectBus({ id: 41, company_id: 4 }, "xz", ["RL20190429114493kNw4", "RL2019042911449mftfK"]);
// } catch (e) { console.log(result, "result..................");
// console.log(e.stack, "e......................."); return result;
// } } catch (e) {
console.log(e.stack, "e.......................");
}
} }
async callSign() { async callSign() {
var tmpSignObj = { var tmpSignObj = {
......
...@@ -28,6 +28,39 @@ class utilsTlBankSve { ...@@ -28,6 +28,39 @@ class utilsTlBankSve {
this.tlorderDao = System.getObject("db.tlorderDao"); this.tlorderDao = System.getObject("db.tlorderDao");
} }
//-------------------------------------------h5支付-----------------开始
async getH5Url() {
// appid:00000003,商户号(mch_id):990440148166000,md5key(pay_key):a0ea3fa20dbd7bb4d5abf1d59d63bae8
var timestamp = Date.now();
var jsonObj = {
appid: "0017ww22t86ddd",
cusid: "56059508873992Z6G",
version: 12,
trxamt: 1,//单位为分
reqsn: "990440148166000_004",//order_num + "_" + company_id.toString(),
charset: "UTF-8",
returl: "http://zhichan.gongsibao.com/",
notify_url: this.notifyUrl,
body: "测试支付1",
randomstr: timestamp.toString()//随机字符串,不长于32位
}
var param_result = await this.getReqBeforeParam(jsonObj, "1352105537612345789");
if (param_result.code != 1) {
return param_result;
}
var paramStr = Object.keys(jsonObj).sort().map(key => {
return `${encodeURIComponent(key)}=${encodeURIComponent(jsonObj[key])}`
}).join('&');
return paramStr;
}
//-------------------------------------------h5支付-----------------结束
//----------------------------------------------------------------------------------------请求银行接口开始--------------------------------------------------- //----------------------------------------------------------------------------------------请求银行接口开始---------------------------------------------------
/* /*
......
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