Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信支付退款回调,有乱码 #830

Closed
buzzxu opened this issue Nov 1, 2018 · 2 comments
Closed

微信支付退款回调,有乱码 #830

buzzxu opened this issue Nov 1, 2018 · 2 comments

Comments

@buzzxu
Copy link

buzzxu commented Nov 1, 2018

退款回调的时候,refund_recv_accout值保存到mysql中乱码 ������������������
将源码 com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult.fromXML()方法中

result.setReqInfo(WxPayRefundNotifyResult.ReqInfo.fromXML(new String(cipher.doFinal(Base64.decodeBase64(reqInfoString)))));

改为:

result.setReqInfo(WxPayRefundNotifyResult.ReqInfo.fromXML(new String(cipher.doFinal(Base64.decodeBase64(reqInfoString)),"UTF-8")));

转成UTF-8就能解决。我用的是SpringBoot、JDK11,MySQL编码是utf8mb4

@binarywang
Copy link
Owner

这还真是个问题

@binarywang
Copy link
Owner

3.2.3.B测试版本已修复

comeonc added a commit to comeonc/weixin-java-tools that referenced this issue Nov 13, 2018
…nto wechat-develop

* 'develop' of github.com:Wechat-Group/weixin-java-tools: (31 commits)
  xml代码优化
  发布3.2.4.B测试版本
  微信支付增加对账单下载返回原始字符串数据的downloadRawBill方法
  微信支付模块配置中增加ifSaveApiData参数,可以选择是否保存接口请求信息到ThreadLocal中方便读取
  update xstream to 1.4.10
  binarywang#841 增加会员卡更新接口
  binarywang#651 WxMpXmlMessage增加allFieldsMap属性, 用于存放所有xml属性和值。
  增加xml解析工具类
  binarywang#835 小程序模块增加微信运动数据解密方法
  发布3.2.3.B测试版本
  优化代码
  优化代码,替换掉ToStringBuilder.reflectionToString相关代码
  binarywang#833 小程序模块增加错误码
  优化对账方法
  调整test
  binarywang#821 查询企业付款结果接口的结果类增加payment_time属性
  binarywang#830 修复微信支付退款通知解析代码在某些环境下可能会出现的乱码问题
  尽量使用常量
  binarywang#828 优化支付结果通知类的checkResult方法
  binarywang#829 优化退款结果通知类的fromXML方法
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants