fix: 微信支付,支付订单创建失败,修改。
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user