🐛 【微信支付】修复多商户情况下微信回调签名失败的问题
This commit is contained in:
@@ -345,9 +345,10 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
if (result.getSignType() != null) {
|
if (result.getSignType() != null) {
|
||||||
// 如果解析的通知对象中signType有值,则使用它进行验签
|
// 如果解析的通知对象中signType有值,则使用它进行验签
|
||||||
signType = result.getSignType();
|
signType = result.getSignType();
|
||||||
} else if (this.getConfig().getSignType() != null) {
|
} else if (configMap.get(result.getMchId()).getSignType() != null) {
|
||||||
// 如果配置中signType有值,则使用它进行验签
|
// 如果配置中signType有值,则使用它进行验签
|
||||||
signType = this.getConfig().getSignType();
|
signType = configMap.get(result.getMchId()).getSignType();
|
||||||
|
this.switchover(result.getMchId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,6 +431,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
WxPayRefundNotifyResult result;
|
WxPayRefundNotifyResult result;
|
||||||
if (XmlConfig.fastMode) {
|
if (XmlConfig.fastMode) {
|
||||||
result = BaseWxPayResult.fromXML(xmlData, WxPayRefundNotifyResult.class);
|
result = BaseWxPayResult.fromXML(xmlData, WxPayRefundNotifyResult.class);
|
||||||
|
this.switchover(result.getMchId());
|
||||||
result.decryptReqInfo(this.getConfig().getMchKey());
|
result.decryptReqInfo(this.getConfig().getMchKey());
|
||||||
} else {
|
} else {
|
||||||
result = WxPayRefundNotifyResult.fromXML(xmlData, this.getConfig().getMchKey());
|
result = WxPayRefundNotifyResult.fromXML(xmlData, this.getConfig().getMchKey());
|
||||||
@@ -465,12 +467,13 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, String signType) throws WxPayException {
|
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, @Deprecated String signType) throws WxPayException {
|
||||||
try {
|
try {
|
||||||
log.debug("扫码支付回调通知请求参数:{}", xmlData);
|
log.debug("扫码支付回调通知请求参数:{}", xmlData);
|
||||||
WxScanPayNotifyResult result = BaseWxPayResult.fromXML(xmlData, WxScanPayNotifyResult.class);
|
WxScanPayNotifyResult result = BaseWxPayResult.fromXML(xmlData, WxScanPayNotifyResult.class);
|
||||||
|
this.switchover(result.getMchId());
|
||||||
log.debug("扫码支付回调通知解析后的对象:{}", result);
|
log.debug("扫码支付回调通知解析后的对象:{}", result);
|
||||||
result.checkResult(this, signType, false);
|
result.checkResult(this, this.getConfig().getSignType(), false);
|
||||||
return result;
|
return result;
|
||||||
} catch (WxPayException e) {
|
} catch (WxPayException e) {
|
||||||
throw e;
|
throw e;
|
||||||
@@ -481,8 +484,8 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData) throws WxPayException {
|
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData) throws WxPayException {
|
||||||
final String signType = this.getConfig().getSignType();
|
// final String signType = this.getConfig().getSignType();
|
||||||
return this.parseScanPayNotifyResult(xmlData, signType);
|
return this.parseScanPayNotifyResult(xmlData, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user