@@ -825,7 +825,7 @@ public void setMaxRetryTimes(int maxRetryTimes) {
825
825
826
826
@ Override
827
827
public WxMpPrepayIdResult getPrepayId (String openId , String outTradeNo , double amt , String body , String tradeType , String ip , String callbackUrl ) {
828
- Map <String , String > packageParams = new HashMap <String , String >();
828
+ Map <String , String > packageParams = new HashMap <>();
829
829
packageParams .put ("appid" , this .wxMpConfigStorage .getAppId ());
830
830
packageParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
831
831
packageParams .put ("body" , body );
@@ -843,7 +843,7 @@ public WxMpPrepayIdResult getPrepayId(String openId, String outTradeNo, double a
843
843
public WxMpPrepayIdResult getPrepayId (final Map <String , String > parameters ) {
844
844
String nonce_str = System .currentTimeMillis () + "" ;
845
845
846
- final SortedMap <String , String > packageParams = new TreeMap <String , String >(parameters );
846
+ final SortedMap <String , String > packageParams = new TreeMap <>(parameters );
847
847
packageParams .put ("appid" , this .wxMpConfigStorage .getAppId ());
848
848
packageParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
849
849
packageParams .put ("nonce_str" , nonce_str );
@@ -895,7 +895,7 @@ private void checkParameters(Map<String, String> parameters) {
895
895
896
896
@ Override
897
897
public Map <String , String > getJsapiPayInfo (String openId ,String outTradeNo , double amt , String body ,String ip , String callbackUrl ) throws WxErrorException {
898
- Map <String , String > packageParams = new HashMap <String , String >();
898
+ Map <String , String > packageParams = new HashMap <>();
899
899
packageParams .put ("appid" , this .wxMpConfigStorage .getAppId ());
900
900
packageParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
901
901
packageParams .put ("body" , body );
@@ -911,7 +911,7 @@ public Map<String, String> getJsapiPayInfo(String openId,String outTradeNo, doub
911
911
912
912
@ Override
913
913
public Map <String , String > getNativePayInfo (String productId ,String outTradeNo , double amt , String body ,String ip , String callbackUrl ) throws WxErrorException {
914
- Map <String , String > packageParams = new HashMap <String , String >();
914
+ Map <String , String > packageParams = new HashMap <>();
915
915
packageParams .put ("appid" , this .wxMpConfigStorage .getAppId ());
916
916
packageParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
917
917
packageParams .put ("body" , body );
@@ -946,15 +946,15 @@ public Map<String, String> getPayInfo(Map<String, String> parameters) throws WxE
946
946
throw new RuntimeException (String .format ("Failed to get prepay id due to error code '%s'(%s)." , wxMpPrepayIdResult .getErr_code (), wxMpPrepayIdResult .getErr_code_des ()));
947
947
}
948
948
949
- Map <String , String > payInfo = new HashMap <String , String >();
949
+ Map <String , String > payInfo = new HashMap <>();
950
950
payInfo .put ("appId" , this .wxMpConfigStorage .getAppId ());
951
951
// 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
952
952
payInfo .put ("timeStamp" , String .valueOf (System .currentTimeMillis () / 1000 ));
953
953
payInfo .put ("nonceStr" , System .currentTimeMillis () + "" );
954
954
payInfo .put ("package" , "prepay_id=" + prepayId );
955
955
payInfo .put ("signType" , "MD5" );
956
956
if ("NATIVE" .equals (parameters .get ("trade_type" ))){
957
- payInfo .put ("codeUrl" , wxMpPrepayIdResult .getCode_url ());
957
+ payInfo .put ("codeUrl" , wxMpPrepayIdResult .getCode_url ());
958
958
}
959
959
960
960
String finalSign = WxCryptUtil .createSign (payInfo , this .wxMpConfigStorage .getPartnerKey ());
@@ -966,7 +966,7 @@ public Map<String, String> getPayInfo(Map<String, String> parameters) throws WxE
966
966
public WxMpPayResult getJSSDKPayResult (String transactionId , String outTradeNo ) {
967
967
String nonce_str = System .currentTimeMillis () + "" ;
968
968
969
- SortedMap <String , String > packageParams = new TreeMap <String , String >();
969
+ SortedMap <String , String > packageParams = new TreeMap <>();
970
970
packageParams .put ("appid" , this .wxMpConfigStorage .getAppId ());
971
971
packageParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
972
972
if (transactionId != null && !"" .equals (transactionId .trim ()))
@@ -1018,7 +1018,7 @@ public WxMpPayCallback getJSSDKCallbackData(String xmlData) {
1018
1018
1019
1019
@ Override
1020
1020
public WxMpPayRefundResult refundPay (Map <String , String > parameters ) throws WxErrorException {
1021
- SortedMap <String , String > refundParams = new TreeMap <String , String >(parameters );
1021
+ SortedMap <String , String > refundParams = new TreeMap <>(parameters );
1022
1022
refundParams .put ("appid" , this .wxMpConfigStorage .getAppId ());
1023
1023
refundParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
1024
1024
refundParams .put ("nonce_str" , System .currentTimeMillis () + "" );
@@ -1080,7 +1080,7 @@ public boolean checkJSSDKCallbackDataSignature(Map<String, String> kvm, String s
1080
1080
public WxRedpackResult sendRedpack (Map <String , String > parameters ) throws WxErrorException {
1081
1081
String nonce_str = System .currentTimeMillis () + "" ;
1082
1082
1083
- SortedMap <String , String > packageParams = new TreeMap <String , String >(parameters );
1083
+ SortedMap <String , String > packageParams = new TreeMap <>(parameters );
1084
1084
packageParams .put ("wxappid" , this .wxMpConfigStorage .getAppId ());
1085
1085
packageParams .put ("mch_id" , this .wxMpConfigStorage .getPartnerId ());
1086
1086
packageParams .put ("nonce_str" , nonce_str );
0 commit comments