@@ -342,7 +342,7 @@ public <T> T createOrder(WxPayUnifiedOrderRequest request) throws WxPayException
342342 configMap .put ("appid" , appId );
343343
344344 final WxPayAppOrderResult result = WxPayAppOrderResult .builder ()
345- .sign (SignUtils .createSign (configMap , null , this .getConfig ().getMchKey (), null ))
345+ .sign (SignUtils .createSign (configMap , request . getSignType () , this .getConfig ().getMchKey (), null ))
346346 .prepayId (prepayId )
347347 .partnerId (partnerId )
348348 .appId (appId )
@@ -419,7 +419,7 @@ public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws W
419419 configMap .put ("noncestr" , nonceStr );
420420 configMap .put ("appid" , appId );
421421 // 此map用于客户端与微信服务器交互
422- payInfo .put ("sign" , SignUtils .createSign (configMap , null , this .getConfig ().getMchKey (), null ));
422+ payInfo .put ("sign" , SignUtils .createSign (configMap , request . getSignType () , this .getConfig ().getMchKey (), null ));
423423 payInfo .put ("prepayId" , prepayId );
424424 payInfo .put ("partnerId" , partnerId );
425425 payInfo .put ("appId" , appId );
@@ -432,8 +432,8 @@ public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws W
432432 payInfo .put ("timeStamp" , timestamp );
433433 payInfo .put ("nonceStr" , nonceStr );
434434 payInfo .put ("package" , "prepay_id=" + prepayId );
435- payInfo .put ("signType" , SignType . MD5 );
436- payInfo .put ("paySign" , SignUtils .createSign (payInfo , null , this .getConfig ().getMchKey (), null ));
435+ payInfo .put ("signType" , request . getSignType () );
436+ payInfo .put ("paySign" , SignUtils .createSign (payInfo , request . getSignType () , this .getConfig ().getMchKey (), null ));
437437 }
438438
439439 return payInfo ;
@@ -457,7 +457,7 @@ public String createScanPayQrcodeMode1(String productId) {
457457 params .put ("time_stamp" , String .valueOf (System .currentTimeMillis () / 1000 ));
458458 params .put ("nonce_str" , String .valueOf (System .currentTimeMillis ()));
459459
460- String sign = SignUtils .createSign (params , null , this .getConfig ().getMchKey (), null );
460+ String sign = SignUtils .createSign (params , SignType . MD5 , this .getConfig ().getMchKey (), null );
461461 params .put ("sign" , sign );
462462
463463 for (String key : params .keySet ()) {
0 commit comments