mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 13:06:54 +08:00
#830 修复微信支付退款通知解析代码在某些环境下可能会出现的乱码问题
This commit is contained in:
parent
b4833d1019
commit
9236f04d68
@ -50,7 +50,7 @@ public class WxPayRefundNotifyResult extends BaseWxPayResult implements Serializ
|
|||||||
if (WxPayConstants.ResultCode.FAIL.equals(result.getReturnCode())) {
|
if (WxPayConstants.ResultCode.FAIL.equals(result.getReturnCode())) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
String reqInfoString = result.getReqInfoString();
|
String reqInfoString = result.getReqInfoString();
|
||||||
try {
|
try {
|
||||||
final String keyMd5String = DigestUtils.md5Hex(mchKey).toLowerCase();
|
final String keyMd5String = DigestUtils.md5Hex(mchKey).toLowerCase();
|
||||||
@ -58,7 +58,8 @@ public class WxPayRefundNotifyResult extends BaseWxPayResult implements Serializ
|
|||||||
|
|
||||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||||
cipher.init(Cipher.DECRYPT_MODE, key);
|
cipher.init(Cipher.DECRYPT_MODE, key);
|
||||||
result.setReqInfo(ReqInfo.fromXML(new String(cipher.doFinal(Base64.decodeBase64(reqInfoString)))));
|
result.setReqInfo(ReqInfo.fromXML(new String(cipher.doFinal(Base64.decodeBase64(reqInfoString)),
|
||||||
|
StandardCharsets.UTF_8)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new WxPayException("解密退款通知加密信息时出错", e);
|
throw new WxPayException("解密退款通知加密信息时出错", e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user