fix: 微信支付,支付订单创建失败,修改。

This commit is contained in:
tianyongbao
2026-01-19 14:57:30 +08:00
parent c013c779db
commit c991196549
2 changed files with 9 additions and 8 deletions

View File

@@ -50,12 +50,13 @@ public class WxPayConfiguration {
payConfig.setKeyPath(wxPayProperties.getKeyPath());
}
if (wxPayProperties.getPrivateKeyPath() != null) {
payConfig.setPrivateKeyPath(wxPayProperties.getPrivateKeyPath());
}
if (wxPayProperties.getPrivateContent() != null) {
// 私钥配置优先使用privateContent避免文件不存在的问题
if (wxPayProperties.getPrivateContent() != null && !wxPayProperties.getPrivateContent().isEmpty()) {
payConfig.setPrivateCertContent(wxPayProperties.getPrivateContent().getBytes());
log.info("使用私钥内容配置");
} else if (wxPayProperties.getPrivateKeyPath() != null) {
payConfig.setPrivateKeyPath(wxPayProperties.getPrivateKeyPath());
log.info("使用私钥路径配置: {}", wxPayProperties.getPrivateKeyPath());
}
WxPayService wxPayService = new WxPayServiceImpl();