11package com .github .binarywang .wxpay .service .impl ;
22
3+ import java .io .File ;
4+ import java .nio .charset .StandardCharsets ;
5+ import java .nio .file .Files ;
6+ import java .nio .file .Path ;
7+ import java .nio .file .Paths ;
8+ import java .util .Date ;
9+ import java .util .HashMap ;
10+ import java .util .LinkedList ;
11+ import java .util .List ;
12+ import java .util .Map ;
13+ import java .util .zip .ZipException ;
14+
15+ import org .apache .commons .lang3 .StringUtils ;
16+ import org .slf4j .Logger ;
17+ import org .slf4j .LoggerFactory ;
18+
319import com .github .binarywang .utils .qrcode .QrcodeUtils ;
420import com .github .binarywang .wxpay .bean .WxPayApiData ;
5- import com .github .binarywang .wxpay .bean .coupon .*;
21+ import com .github .binarywang .wxpay .bean .coupon .WxPayCouponInfoQueryRequest ;
22+ import com .github .binarywang .wxpay .bean .coupon .WxPayCouponInfoQueryResult ;
23+ import com .github .binarywang .wxpay .bean .coupon .WxPayCouponSendRequest ;
24+ import com .github .binarywang .wxpay .bean .coupon .WxPayCouponSendResult ;
25+ import com .github .binarywang .wxpay .bean .coupon .WxPayCouponStockQueryRequest ;
26+ import com .github .binarywang .wxpay .bean .coupon .WxPayCouponStockQueryResult ;
627import com .github .binarywang .wxpay .bean .notify .WxPayOrderNotifyResult ;
728import com .github .binarywang .wxpay .bean .notify .WxPayRefundNotifyResult ;
829import com .github .binarywang .wxpay .bean .notify .WxScanPayNotifyResult ;
930import com .github .binarywang .wxpay .bean .order .WxPayAppOrderResult ;
1031import com .github .binarywang .wxpay .bean .order .WxPayMpOrderResult ;
1132import com .github .binarywang .wxpay .bean .order .WxPayMwebOrderResult ;
1233import com .github .binarywang .wxpay .bean .order .WxPayNativeOrderResult ;
13- import com .github .binarywang .wxpay .bean .request .*;
14- import com .github .binarywang .wxpay .bean .result .*;
34+ import com .github .binarywang .wxpay .bean .request .WxPayAuthcode2OpenidRequest ;
35+ import com .github .binarywang .wxpay .bean .request .WxPayDefaultRequest ;
36+ import com .github .binarywang .wxpay .bean .request .WxPayDownloadBillRequest ;
37+ import com .github .binarywang .wxpay .bean .request .WxPayDownloadFundFlowRequest ;
38+ import com .github .binarywang .wxpay .bean .request .WxPayMicropayRequest ;
39+ import com .github .binarywang .wxpay .bean .request .WxPayOrderCloseRequest ;
40+ import com .github .binarywang .wxpay .bean .request .WxPayOrderQueryRequest ;
41+ import com .github .binarywang .wxpay .bean .request .WxPayOrderReverseRequest ;
42+ import com .github .binarywang .wxpay .bean .request .WxPayQueryCommentRequest ;
43+ import com .github .binarywang .wxpay .bean .request .WxPayRedpackQueryRequest ;
44+ import com .github .binarywang .wxpay .bean .request .WxPayRefundQueryRequest ;
45+ import com .github .binarywang .wxpay .bean .request .WxPayRefundRequest ;
46+ import com .github .binarywang .wxpay .bean .request .WxPayReportRequest ;
47+ import com .github .binarywang .wxpay .bean .request .WxPaySendRedpackRequest ;
48+ import com .github .binarywang .wxpay .bean .request .WxPayShorturlRequest ;
49+ import com .github .binarywang .wxpay .bean .request .WxPayUnifiedOrderRequest ;
50+ import com .github .binarywang .wxpay .bean .result .BaseWxPayResult ;
51+ import com .github .binarywang .wxpay .bean .result .WxPayAuthcode2OpenidResult ;
52+ import com .github .binarywang .wxpay .bean .result .WxPayBillBaseResult ;
53+ import com .github .binarywang .wxpay .bean .result .WxPayBillResult ;
54+ import com .github .binarywang .wxpay .bean .result .WxPayCommonResult ;
55+ import com .github .binarywang .wxpay .bean .result .WxPayFundFlowBaseResult ;
56+ import com .github .binarywang .wxpay .bean .result .WxPayFundFlowResult ;
57+ import com .github .binarywang .wxpay .bean .result .WxPayMicropayResult ;
58+ import com .github .binarywang .wxpay .bean .result .WxPayOrderCloseResult ;
59+ import com .github .binarywang .wxpay .bean .result .WxPayOrderQueryResult ;
60+ import com .github .binarywang .wxpay .bean .result .WxPayOrderReverseResult ;
61+ import com .github .binarywang .wxpay .bean .result .WxPayRedpackQueryResult ;
62+ import com .github .binarywang .wxpay .bean .result .WxPayRefundQueryResult ;
63+ import com .github .binarywang .wxpay .bean .result .WxPayRefundResult ;
64+ import com .github .binarywang .wxpay .bean .result .WxPaySandboxSignKeyResult ;
65+ import com .github .binarywang .wxpay .bean .result .WxPaySendRedpackResult ;
66+ import com .github .binarywang .wxpay .bean .result .WxPayShorturlResult ;
67+ import com .github .binarywang .wxpay .bean .result .WxPayUnifiedOrderResult ;
1568import com .github .binarywang .wxpay .config .WxPayConfig ;
1669import com .github .binarywang .wxpay .constant .WxPayConstants .BillType ;
1770import com .github .binarywang .wxpay .constant .WxPayConstants .SignType ;
2376import com .google .common .base .Joiner ;
2477import com .google .common .collect .Maps ;
2578import jodd .io .ZipUtil ;
26- import org .apache .commons .lang3 .StringUtils ;
27- import org .slf4j .Logger ;
28- import org .slf4j .LoggerFactory ;
29-
30- import java .io .File ;
31- import java .nio .charset .StandardCharsets ;
32- import java .nio .file .Files ;
33- import java .nio .file .Path ;
34- import java .nio .file .Paths ;
35- import java .util .*;
36- import java .util .zip .ZipException ;
3779
3880import static com .github .binarywang .wxpay .constant .WxPayConstants .QUERY_COMMENT_DATE_FORMAT ;
3981import static com .github .binarywang .wxpay .constant .WxPayConstants .TarType ;
@@ -291,7 +333,7 @@ public <T> T createOrder(WxPayUnifiedOrderRequest request) throws WxPayException
291333 configMap .put ("appid" , appId );
292334
293335 final WxPayAppOrderResult result = WxPayAppOrderResult .builder ()
294- .sign (SignUtils .createSign (configMap , null , this .getConfig ().getMchKey (), false ))
336+ .sign (SignUtils .createSign (configMap , null , this .getConfig ().getMchKey (), null ))
295337 .prepayId (prepayId )
296338 .partnerId (partnerId )
297339 .appId (appId )
@@ -317,7 +359,7 @@ public <T> T createOrder(WxPayUnifiedOrderRequest request) throws WxPayException
317359 .signType (signType )
318360 .build ();
319361
320- payResult .setPaySign (SignUtils .createSign (payResult , signType , this .getConfig ().getMchKey (), false ));
362+ payResult .setPaySign (SignUtils .createSign (payResult , signType , this .getConfig ().getMchKey (), null ));
321363 return (T ) payResult ;
322364 }
323365
@@ -368,7 +410,7 @@ public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws W
368410 configMap .put ("noncestr" , nonceStr );
369411 configMap .put ("appid" , appId );
370412 // 此map用于客户端与微信服务器交互
371- payInfo .put ("sign" , SignUtils .createSign (configMap , null , this .getConfig ().getMchKey (), false ));
413+ payInfo .put ("sign" , SignUtils .createSign (configMap , null , this .getConfig ().getMchKey (), null ));
372414 payInfo .put ("prepayId" , prepayId );
373415 payInfo .put ("partnerId" , partnerId );
374416 payInfo .put ("appId" , appId );
@@ -382,7 +424,7 @@ public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws W
382424 payInfo .put ("nonceStr" , nonceStr );
383425 payInfo .put ("package" , "prepay_id=" + prepayId );
384426 payInfo .put ("signType" , SignType .MD5 );
385- payInfo .put ("paySign" , SignUtils .createSign (payInfo , null , this .getConfig ().getMchKey (), false ));
427+ payInfo .put ("paySign" , SignUtils .createSign (payInfo , null , this .getConfig ().getMchKey (), null ));
386428 }
387429
388430 return payInfo ;
@@ -406,7 +448,7 @@ public String createScanPayQrcodeMode1(String productId) {
406448 params .put ("time_stamp" , String .valueOf (System .currentTimeMillis () / 1000 ));
407449 params .put ("nonce_str" , String .valueOf (System .currentTimeMillis ()));
408450
409- String sign = SignUtils .createSign (params , null , this .getConfig ().getMchKey (), false );
451+ String sign = SignUtils .createSign (params , null , this .getConfig ().getMchKey (), null );
410452 params .put ("sign" , sign );
411453
412454 for (String key : params .keySet ()) {
@@ -632,7 +674,7 @@ private String handleGzipFundFlow(String url, String requestStr) throws WxPayExc
632674 }
633675 } catch (WxPayException wxPayException ) {
634676 throw wxPayException ;
635- } catch (Exception e ){
677+ } catch (Exception e ) {
636678 this .log .error ("解析对账单文件时出错" , e );
637679 throw new WxPayException ("解压zip文件出错" );
638680 }
0 commit comments