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