he2802 2 лет назад
Родитель
Сommit
a9ae7ad328

+ 7 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -82,6 +83,8 @@ import com.zhongzheng.modules.user.vo.UserVo;
 import com.zhongzheng.modules.wx.service.IWxPayService;
 import com.zhongzheng.modules.wx.vo.WxPayVo;
 import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -107,6 +110,8 @@ import static com.squareup.okhttp.internal.Util.md5Hex;
 @Service
 public class WxPayServiceImpl implements IWxPayService {
 
+    private static Logger log = LoggerFactory.getLogger(WxPayServiceImpl.class);
+
   //  @Value("${wx.small.appid}")
     private String appid;
 
@@ -234,6 +239,8 @@ public class WxPayServiceImpl implements IWxPayService {
             String TenantId = ServletUtils.getRequest().getHeader("TenantId");
             data.put("attach", TenantId);
             Map<String, String> resp = wxpay.unifiedOrder(data);
+            log.info("支付参数:{}", JSON.toJSONString(data));
+            log.info("支付结果:{}", JSON.toJSONString(resp));
             Map<String, String> result = new HashMap<>();
             //         result.put("provider","wxpay");
             result.put("appId", appid);
@@ -254,10 +261,6 @@ public class WxPayServiceImpl implements IWxPayService {
     public Map<String, String> paymentPc(String out_trade_no, String openid, String body, BigDecimal price) {
         initData();
         WxSmallConfig config = new WxSmallConfig(appid, mchid, key);
-        System.out.println(55678);
-        System.out.println(appid);
-        System.out.println(mchid);
-        System.out.println(key);
         BigDecimal unit = new BigDecimal(100);
         price = price.multiply(unit);
         try {