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

【欢迎贡献】微信支付初始化 client 客户端错误,导致发起支付报错,错误码:CUSTOM_ERROR,错误提示:v3请求构造异常! #319

Closed
52Lau opened this issue Aug 2, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@52Lau
Copy link

52Lau commented Aug 2, 2023

基本信息

  • ruoyi-vue-pro 版本:1.8
  • 操作系统:mac
  • 数据库:mysql8.0

你猜测可能的原因

参数错误,实际为证书错误

微信小程序支付,下单后,发起支付报错,错误码:CUSTOM_ERROR,错误提示:v3请求构造异常!
实际还有个报错原因没有打印,完善代码如下
static String getErrorMessage(WxPayException e) { StringBuilder errorMessage = new StringBuilder(); if (StrUtil.isNotEmpty(e.getErrCode())) { errorMessage.append(e.getErrCodeDes()); } if (StrUtil.isNotEmpty(e.getCustomErrorMsg())) { errorMessage.append(e.getCustomErrorMsg()); } if(e.getCause()!=null&&e.getCause().getMessage()!=null){ errorMessage.append(e.getCause().getMessage()); } return errorMessage.toString(); }

然后对比历史版本,发现客户端初始化的时候是copyProperties的,对比下来,发现多了"keyContent","privateKeyContent","privateCertContent"这三个,所以要忽略
image
image

@YunaiV
Copy link
Owner

YunaiV commented Aug 5, 2023

好的噢,有兴趣 pr 下哇?

@YunaiV YunaiV added the bug Something isn't working label Aug 5, 2023
@YunaiV YunaiV changed the title 微信支付初始化 client 客户端错误,导致发起支付报错,错误码:CUSTOM_ERROR,错误提示:v3请求构造异常! 【欢迎贡献】微信支付初始化 client 客户端错误,导致发起支付报错,错误码:CUSTOM_ERROR,错误提示:v3请求构造异常! Aug 5, 2023
@momo-big
Copy link

momo-big commented Aug 7, 2023

我也是刚刚发现这个bug,然后想着来提bug,结果发现已经有大佬提出来了,早知道过来看看也就不用浪费我一个早上的时间了

YunaiV added a commit that referenced this issue Sep 3, 2023
修复:#319 微信支付初始化 client 客户端错误,导致发起支付报错
@YunaiV
Copy link
Owner

YunaiV commented Sep 3, 2023

已经修复。

@YunaiV YunaiV self-assigned this Sep 3, 2023
@YunaiV YunaiV closed this as completed Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants