Commit 38921f67 by linboxuan

alipay test

parent 6b379eb5
...@@ -45,6 +45,8 @@ class UtilsOrderService extends AppServiceBase { ...@@ -45,6 +45,8 @@ class UtilsOrderService extends AppServiceBase {
if (buyPayTotalSum == 0) { if (buyPayTotalSum == 0) {
actionBody.payTotalSum = totalSum; actionBody.payTotalSum = totalSum;
} }
console.log("buyTotalSum",buyTotalSum)
console.log("totalSum",totalSum)
if (buyTotalSum < totalSum) { if (buyTotalSum < totalSum) {
return system.getResult(null, "订单金额有误,100060"); return system.getResult(null, "订单金额有误,100060");
} }
......
...@@ -14,6 +14,7 @@ class UtilsUcommuneService extends AppServiceBase { ...@@ -14,6 +14,7 @@ class UtilsUcommuneService extends AppServiceBase {
this.centerChannelUrl = settings.centerChannelUrl(); this.centerChannelUrl = settings.centerChannelUrl();
this.redisClient = system.getObject("util.redisClient"); this.redisClient = system.getObject("util.redisClient");
this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve"); this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
this.paySecret = settings.paySecret()
} }
//--------------------------------优客工厂相关接口-start----------------------------------------------------- //--------------------------------优客工厂相关接口-start-----------------------------------------------------
...@@ -100,7 +101,8 @@ class UtilsUcommuneService extends AppServiceBase { ...@@ -100,7 +101,8 @@ class UtilsUcommuneService extends AppServiceBase {
"totalAmount" : orderResult.data.receiptVoucher.totalSum, "totalAmount" : orderResult.data.receiptVoucher.totalSum,
} }
var sign = JSON.stringify(params); var sign = JSON.stringify(params);
sign += "ab53dfb909e4c32a" // sign += "ab53dfb909e4c32a"
signstr += this.paySecret
sign = md5(sign).toUpperCase() sign = md5(sign).toUpperCase()
params.sign = sign params.sign = sign
let res = await axios.post(creatPayRequrl, params) let res = await axios.post(creatPayRequrl, params)
...@@ -274,7 +276,8 @@ class UtilsUcommuneService extends AppServiceBase { ...@@ -274,7 +276,8 @@ class UtilsUcommuneService extends AppServiceBase {
// "tradeType":"JSAPI" // "tradeType":"JSAPI"
// } // }
var sign = JSON.stringify(params); var sign = JSON.stringify(params);
sign += "ab53dfb909e4c32a" // sign += "ab53dfb909e4c32a"
signstr += this.paySecret
sign = md5(sign).toUpperCase() sign = md5(sign).toUpperCase()
params.sign = sign params.sign = sign
console.log(params) console.log(params)
......
...@@ -201,7 +201,7 @@ var settings = { ...@@ -201,7 +201,7 @@ var settings = {
}; };
} }
}, },
alipay: function() { alipay: function() {// 没有在使用 确定不需要后会去掉
return new AlipaySdk({ return new AlipaySdk({
// appId: payConfig.ali.appId, // appId: payConfig.ali.appId,
...@@ -212,7 +212,7 @@ var settings = { ...@@ -212,7 +212,7 @@ var settings = {
}); });
}, },
wxpay: function() { wxpay: function() {// 没有在使用 确定不需要后会去掉
return WXPay({ return WXPay({
appid: 'wx6f3ebe44defe336a', appid: 'wx6f3ebe44defe336a',
mch_id: '1232813602', mch_id: '1232813602',
...@@ -226,6 +226,13 @@ var settings = { ...@@ -226,6 +226,13 @@ var settings = {
// partnerKey: 'sinotone2014sinotone2014sinotone', // partnerKey: 'sinotone2014sinotone2014sinotone',
// }; // };
// return new tenpay(config); // return new tenpay(config);
},
paySecret: function() {
if (this.env == "dev") {
return "ab53dfb909e4c32a";
} else {
return "";
}
} }
}; };
module.exports = settings; module.exports = settings;
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