mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 22:11:40 +08:00
对相应数据进行判断,及时抛出异常
This commit is contained in:
parent
b13d3c9e6d
commit
e70c539465
@ -439,7 +439,13 @@ public class WxMpPayServiceImpl implements WxMpPayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String responseContent = this.wxMpService.post(url, xstream.toXML(request));
|
String responseContent = this.wxMpService.post(url, xstream.toXML(request));
|
||||||
return (WxRedpackResult) xstream.fromXML(responseContent);
|
WxRedpackResult redpackResult = (WxRedpackResult) xstream.fromXML(responseContent);
|
||||||
|
if("FAIL".equals(redpackResult.getResultCode())){
|
||||||
|
throw new WxErrorException(
|
||||||
|
WxError.newBuilder().setErrorMsg(redpackResult.getErrCode() + ":" + redpackResult.getErrCodeDes()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
return redpackResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> xmlBean2Map(Object bean) {
|
private Map<String, String> xmlBean2Map(Object bean) {
|
||||||
@ -465,7 +471,7 @@ public class WxMpPayServiceImpl implements WxMpPayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信公众号支付签名算法(详见:http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_3)
|
* 微信公众号支付签名算法(详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=4_3)
|
||||||
* @param packageParams 原始参数
|
* @param packageParams 原始参数
|
||||||
* @param signKey 加密Key(即 商户Key)
|
* @param signKey 加密Key(即 商户Key)
|
||||||
* @return 签名字符串
|
* @return 签名字符串
|
||||||
|
Loading…
Reference in New Issue
Block a user