Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b28f358

Browse files
committed
微信支付通知回调解析时的签名方式支持自定义
1 parent edea54b commit b28f358

File tree

1 file changed

+55
-16
lines changed

1 file changed

+55
-16
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,66 @@
11
package com.github.binarywang.wxpay.service.impl;
22

3+
import java.io.File;
4+
import java.io.IOException;
5+
import java.nio.charset.StandardCharsets;
6+
import java.nio.file.Files;
7+
import java.nio.file.Path;
8+
import java.nio.file.Paths;
9+
import java.util.Date;
10+
import java.util.HashMap;
11+
import java.util.LinkedList;
12+
import java.util.List;
13+
import java.util.Map;
14+
import java.util.zip.ZipException;
15+
16+
import org.apache.commons.lang3.StringUtils;
17+
import org.slf4j.Logger;
18+
import org.slf4j.LoggerFactory;
19+
320
import com.github.binarywang.utils.qrcode.QrcodeUtils;
421
import com.github.binarywang.wxpay.bean.WxPayApiData;
5-
import com.github.binarywang.wxpay.bean.coupon.*;
22+
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponInfoQueryRequest;
23+
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponInfoQueryResult;
24+
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendRequest;
25+
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendResult;
26+
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponStockQueryRequest;
27+
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponStockQueryResult;
628
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
729
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult;
830
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
931
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
1032
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
11-
import com.github.binarywang.wxpay.bean.request.*;
12-
import com.github.binarywang.wxpay.bean.result.*;
33+
import com.github.binarywang.wxpay.bean.request.WxPayAuthcode2OpenidRequest;
34+
import com.github.binarywang.wxpay.bean.request.WxPayDefaultRequest;
35+
import com.github.binarywang.wxpay.bean.request.WxPayDownloadBillRequest;
36+
import com.github.binarywang.wxpay.bean.request.WxPayMicropayRequest;
37+
import com.github.binarywang.wxpay.bean.request.WxPayOrderCloseRequest;
38+
import com.github.binarywang.wxpay.bean.request.WxPayOrderQueryRequest;
39+
import com.github.binarywang.wxpay.bean.request.WxPayOrderReverseRequest;
40+
import com.github.binarywang.wxpay.bean.request.WxPayQueryCommentRequest;
41+
import com.github.binarywang.wxpay.bean.request.WxPayRedpackQueryRequest;
42+
import com.github.binarywang.wxpay.bean.request.WxPayRefundQueryRequest;
43+
import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
44+
import com.github.binarywang.wxpay.bean.request.WxPayReportRequest;
45+
import com.github.binarywang.wxpay.bean.request.WxPaySendRedpackRequest;
46+
import com.github.binarywang.wxpay.bean.request.WxPayShorturlRequest;
47+
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
48+
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
49+
import com.github.binarywang.wxpay.bean.result.WxPayAuthcode2OpenidResult;
50+
import com.github.binarywang.wxpay.bean.result.WxPayBillBaseResult;
51+
import com.github.binarywang.wxpay.bean.result.WxPayBillResult;
52+
import com.github.binarywang.wxpay.bean.result.WxPayCommonResult;
53+
import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult;
54+
import com.github.binarywang.wxpay.bean.result.WxPayOrderCloseResult;
55+
import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult;
56+
import com.github.binarywang.wxpay.bean.result.WxPayOrderReverseResult;
57+
import com.github.binarywang.wxpay.bean.result.WxPayRedpackQueryResult;
58+
import com.github.binarywang.wxpay.bean.result.WxPayRefundQueryResult;
59+
import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
60+
import com.github.binarywang.wxpay.bean.result.WxPaySandboxSignKeyResult;
61+
import com.github.binarywang.wxpay.bean.result.WxPaySendRedpackResult;
62+
import com.github.binarywang.wxpay.bean.result.WxPayShorturlResult;
63+
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
1364
import com.github.binarywang.wxpay.config.WxPayConfig;
1465
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType;
1566
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
@@ -21,18 +72,6 @@
2172
import com.google.common.base.Joiner;
2273
import com.google.common.collect.Maps;
2374
import jodd.io.ZipUtil;
24-
import org.apache.commons.lang3.StringUtils;
25-
import org.slf4j.Logger;
26-
import org.slf4j.LoggerFactory;
27-
28-
import java.io.File;
29-
import java.io.IOException;
30-
import java.nio.charset.StandardCharsets;
31-
import java.nio.file.Files;
32-
import java.nio.file.Path;
33-
import java.nio.file.Paths;
34-
import java.util.*;
35-
import java.util.zip.ZipException;
3675

3776
import static com.github.binarywang.wxpay.constant.WxPayConstants.QUERY_COMMENT_DATE_FORMAT;
3877
import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType;
@@ -125,7 +164,7 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPa
125164
log.debug("微信支付异步通知请求参数:{}", xmlData);
126165
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
127166
log.debug("微信支付异步通知请求解析后的对象:{}", result);
128-
result.checkResult(this, null, false);
167+
result.checkResult(this, this.getConfig().getSignType(), false);
129168
return result;
130169
} catch (WxPayException e) {
131170
log.error(e.getMessage(), e);

0 commit comments

Comments
 (0)