#829 优化退款结果通知类的fromXML方法

如果return_code为FAIL时,没有加密信息req_info,因此后面的加密处理会抛出异常。
因此return_code为FAIL时,直接返回结果。
This commit is contained in:
SunshineTech Zhang 2018-11-01 15:42:46 +08:00 committed by Binary Wang
parent 66055b4a00
commit 64446f35e4

View File

@ -46,6 +46,10 @@ public class WxPayRefundNotifyResult extends BaseWxPayResult implements Serializ
*/
public static WxPayRefundNotifyResult fromXML(String xmlString, String mchKey) throws WxPayException {
WxPayRefundNotifyResult result = BaseWxPayResult.fromXML(xmlString, WxPayRefundNotifyResult.class);
if ("FAIL".equals(result.getReturnCode())) {
return result;
}
String reqInfoString = result.getReqInfoString();
try {
final String keyMd5String = DigestUtils.md5Hex(mchKey).toLowerCase();