You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YunaiV
changed the title
微信支付初始化 client 客户端错误,导致发起支付报错,错误码:CUSTOM_ERROR,错误提示:v3请求构造异常!
【欢迎贡献】微信支付初始化 client 客户端错误,导致发起支付报错,错误码:CUSTOM_ERROR,错误提示:v3请求构造异常!
Aug 5, 2023
基本信息
你猜测可能的原因
参数错误,实际为证书错误
微信小程序支付,下单后,发起支付报错,错误码: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](https://private-user-images.githubusercontent.com/37538641/257870132-476aa206-fe8d-4393-9be6-e37ae12d7967.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMzE0MTcsIm5iZiI6MTcyNDEzMTExNywicGF0aCI6Ii8zNzUzODY0MS8yNTc4NzAxMzItNDc2YWEyMDYtZmU4ZC00MzkzLTliZTYtZTM3YWUxMmQ3OTY3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIwVDA1MTgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwZjkyYmM3NmQ2NWIyYTlhZWE1YzE5NjRlYTJiMGVlOGIxN2M0ZTAwYWFjODUzMTA3MDg5M2M5NjkwMzc5MjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.eI56XrQQaaPRO0EVMYYz17THL-BMw9SXo0yUpx-WLmo)
![image](https://private-user-images.githubusercontent.com/37538641/257870259-877b8c16-04b0-48be-9cf7-936e15db7380.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMzE0MTcsIm5iZiI6MTcyNDEzMTExNywicGF0aCI6Ii8zNzUzODY0MS8yNTc4NzAyNTktODc3YjhjMTYtMDRiMC00OGJlLTljZjctOTM2ZTE1ZGI3MzgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIwVDA1MTgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4OWVmNjVkNWRlNDJiMzgyOWVhYmQ5YzAxOGMxY2I2NzE1M2YyMThkZDJiNDk2MmEyODE5MDZkZDc0M2Q4NDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.npysNhzHG-TonGVS3G19lztNn6nfu10aVJy1qjkYqzM)
The text was updated successfully, but these errors were encountered: