mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-21 02:57:37 +08:00
#888 修复微信支付部分接口请求中签名方法不统一的问题
This commit is contained in:
@@ -342,7 +342,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
configMap.put("appid", appId);
|
||||
|
||||
final WxPayAppOrderResult result = WxPayAppOrderResult.builder()
|
||||
.sign(SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), null))
|
||||
.sign(SignUtils.createSign(configMap, request.getSignType(), this.getConfig().getMchKey(), null))
|
||||
.prepayId(prepayId)
|
||||
.partnerId(partnerId)
|
||||
.appId(appId)
|
||||
@@ -419,7 +419,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
configMap.put("noncestr", nonceStr);
|
||||
configMap.put("appid", appId);
|
||||
// 此map用于客户端与微信服务器交互
|
||||
payInfo.put("sign", SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), null));
|
||||
payInfo.put("sign", SignUtils.createSign(configMap, request.getSignType(), this.getConfig().getMchKey(), null));
|
||||
payInfo.put("prepayId", prepayId);
|
||||
payInfo.put("partnerId", partnerId);
|
||||
payInfo.put("appId", appId);
|
||||
@@ -432,8 +432,8 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
payInfo.put("timeStamp", timestamp);
|
||||
payInfo.put("nonceStr", nonceStr);
|
||||
payInfo.put("package", "prepay_id=" + prepayId);
|
||||
payInfo.put("signType", SignType.MD5);
|
||||
payInfo.put("paySign", SignUtils.createSign(payInfo, null, this.getConfig().getMchKey(), null));
|
||||
payInfo.put("signType", request.getSignType());
|
||||
payInfo.put("paySign", SignUtils.createSign(payInfo, request.getSignType(), this.getConfig().getMchKey(), null));
|
||||
}
|
||||
|
||||
return payInfo;
|
||||
@@ -457,7 +457,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
params.put("time_stamp", String.valueOf(System.currentTimeMillis() / 1000));
|
||||
params.put("nonce_str", String.valueOf(System.currentTimeMillis()));
|
||||
|
||||
String sign = SignUtils.createSign(params, null, this.getConfig().getMchKey(), null);
|
||||
String sign = SignUtils.createSign(params, SignType.MD5, this.getConfig().getMchKey(), null);
|
||||
params.put("sign", sign);
|
||||
|
||||
for (String key : params.keySet()) {
|
||||
|
@@ -52,7 +52,7 @@ public class SignUtils {
|
||||
*/
|
||||
@Deprecated
|
||||
public static String createSign(Map<String, String> params, String signKey) {
|
||||
return createSign(params, null, signKey, new String[0]);
|
||||
return createSign(params, SignType.MD5, signKey, new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user