mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 07:23:01 +08:00
🆕 #1814 微信支付解析扫码支付回调通知增加签名类型的重载方法
This commit is contained in:
parent
c9d8509a11
commit
3c7d470210
@ -413,6 +413,17 @@ public interface WxPayService {
|
||||
*/
|
||||
WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 解析扫码支付回调通知
|
||||
* 详见https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_4
|
||||
*
|
||||
* @param xmlData the xml data
|
||||
* @param signType 签名类型
|
||||
* @return the wx scan pay notify result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, String signType) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 解析扫码支付回调通知
|
||||
* 详见https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_4
|
||||
|
@ -236,19 +236,24 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData) throws WxPayException {
|
||||
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, String signType) throws WxPayException {
|
||||
try {
|
||||
log.debug("扫码支付回调通知请求参数:{}", xmlData);
|
||||
WxScanPayNotifyResult result = BaseWxPayResult.fromXML(xmlData, WxScanPayNotifyResult.class);
|
||||
log.debug("扫码支付回调通知解析后的对象:{}", result);
|
||||
result.checkResult(this, this.getConfig().getSignType(), false);
|
||||
result.checkResult(this, signType, false);
|
||||
return result;
|
||||
} catch (WxPayException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new WxPayException("发生异常," + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData) throws WxPayException {
|
||||
final String signType = this.getConfig().getSignType();
|
||||
return this.parseScanPayNotifyResult(xmlData, signType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user