Skip to content

Commit 64446f3

Browse files
SunshineTechbinarywang
authored andcommitted
binarywang#829 优化退款结果通知类的fromXML方法
如果return_code为FAIL时,没有加密信息req_info,因此后面的加密处理会抛出异常。 因此return_code为FAIL时,直接返回结果。
1 parent 66055b4 commit 64446f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public class WxPayRefundNotifyResult extends BaseWxPayResult implements Serializ
4646
*/
4747
public static WxPayRefundNotifyResult fromXML(String xmlString, String mchKey) throws WxPayException {
4848
WxPayRefundNotifyResult result = BaseWxPayResult.fromXML(xmlString, WxPayRefundNotifyResult.class);
49+
if ("FAIL".equals(result.getReturnCode())) {
50+
return result;
51+
}
52+
4953
String reqInfoString = result.getReqInfoString();
5054
try {
5155
final String keyMd5String = DigestUtils.md5Hex(mchKey).toLowerCase();

0 commit comments

Comments
 (0)