提交代码

dev-discount
胡锐 2 years ago
parent a2c34b5ee4
commit 95c04aebaa
  1. 22
      hai-order/src/main/resources/dev/logback.xml
  2. 9
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java

@ -125,6 +125,25 @@
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="wechatPayLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/wechatPay.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/wechatPayLog/wechatPayLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
@ -152,5 +171,8 @@
<logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO">
<appender-ref ref="RechargeLog" />
</logger>
<logger name="com.hai.config.WxOrderConfig" level="INFO">
<appender-ref ref="wechatPayLog" />
</logger>
</configuration>

@ -115,7 +115,14 @@ public class WxOrderConfig {
param.put("sign_type", "HMAC-SHA256");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign", signStr);
String resultXmL = doSSLRequest(param.get("mch_id"), "https://api.mch.weixin.qq.com/secapi/pay/refund", WxUtils.mapToXml(param));
String paramXml = WxUtils.mapToXml(param);
log.info("==========退款START=========");
log.info("订单号:" + paySerialNo);
log.info("请求参数:" + paramXml);
String resultXmL = doSSLRequest(param.get("mch_id"), "https://api.mch.weixin.qq.com/secapi/pay/refund", paramXml);
log.info("响应参数:" + resultXmL);
log.info("==========退款END=========");
return XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class);
}

Loading…
Cancel
Save