|
|
@@ -1,6 +1,7 @@
|
|
|
package com.sqx.modules.pay.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.wxpay.sdk.WXPay;
|
|
|
import com.github.wxpay.sdk.WXPayConstants;
|
|
|
@@ -274,9 +275,6 @@ public class WxServiceImpl implements WxService {
|
|
|
url = oneu.getValue() + "/sqx_fast/app/wxPay/notify";//app支付
|
|
|
}
|
|
|
String currentTimeMillis=(System.currentTimeMillis() / 1000)+"";
|
|
|
- //后台服务名称
|
|
|
- CommonInfo one = commonInfoService.findOne(12);
|
|
|
- log.info("回调地址:" + url);
|
|
|
Double mul = AmountCalUtils.mul(moneys, 100);
|
|
|
String money = String.valueOf(mul.intValue());
|
|
|
String generateNonceStr = WXPayUtil.generateNonceStr();
|
|
|
@@ -289,10 +287,10 @@ public class WxServiceImpl implements WxService {
|
|
|
}else if(type==3){
|
|
|
config.setAppId(commonInfoService.findOne(45).getValue());
|
|
|
}
|
|
|
- //微信商户key
|
|
|
- config.setKey(commonInfoService.findOne(75).getValue());
|
|
|
//微信商户号mchId
|
|
|
config.setMchId(commonInfoService.findOne(76).getValue());
|
|
|
+ //微信商户key
|
|
|
+ config.setKey(commonInfoService.findOne(75).getValue());
|
|
|
WXPay wxpay = new WXPay(config);
|
|
|
Map<String, String> data = new HashMap<>();
|
|
|
//微信对应appid 小程序 公众号 app id
|
|
|
@@ -335,10 +333,7 @@ public class WxServiceImpl implements WxService {
|
|
|
}
|
|
|
//使用官方API请求预付订单
|
|
|
Map<String, String> response = wxpay.unifiedOrder(data);
|
|
|
- for (String key : response.keySet()) {
|
|
|
- log.info("微信支付订单微信返回参数:keys:" + key + " value:" + response.get(key).toString());
|
|
|
- }
|
|
|
- if ("SUCCESS".equals(response.get("return_code"))) {//主要返回以下5个参数
|
|
|
+ if ("SUCCESS".equals(response.get("return_code"))) {
|
|
|
PayDetails payDetails = payDetailsDao.selectByOrderId(outTradeNo);
|
|
|
if(payDetails==null){
|
|
|
payDetails = new PayDetails();
|
|
|
@@ -384,6 +379,8 @@ public class WxServiceImpl implements WxService {
|
|
|
param.put("signType", "MD5");
|
|
|
return Result.success().put("data", param);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ log.error("获取微信支付参数异常,异常信息:{}", JSONUtil.toJsonStr(response));
|
|
|
}
|
|
|
return Result.error("获取订单失败");
|
|
|
}
|
|
|
@@ -523,7 +520,6 @@ public class WxServiceImpl implements WxService {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- log.error("进入回调了!!!");
|
|
|
if(type==1){
|
|
|
config.setAppId(commonInfoService.findOne(74).getValue());
|
|
|
}else if(type==2){
|