修复支付证书的拼接规则。
This commit is contained in:
@@ -250,8 +250,9 @@ public class ShopOrderController extends BaseController {
|
||||
NotificationConfig config;
|
||||
try {
|
||||
if (active.equals("dev")) {
|
||||
// 开发环境 - 构建包含租户号的私钥路径
|
||||
String tenantCertPath = "dev/wechat/" + tenantId;
|
||||
// 开发环境 - 使用配置文件的upload-path构建证书路径
|
||||
String uploadPath = conf.getUploadPath();
|
||||
String tenantCertPath = uploadPath + "dev/wechat/" + tenantId;
|
||||
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
|
||||
|
||||
logger.info("开发环境异步通知证书路径: {}", privateKeyPath);
|
||||
|
||||
@@ -304,8 +304,9 @@ import com.gxwebsoft.common.core.service.PaymentCacheService;
|
||||
|
||||
// 开发环境配置 - 使用自动证书配置
|
||||
if (active.equals("dev")) {
|
||||
// 构建包含租户号的证书路径: dev/wechat/{tenantId}/
|
||||
String tenantCertPath = "dev/wechat/" + order.getTenantId();
|
||||
// 开发环境 - 使用配置文件的upload-path构建证书路径
|
||||
String uploadPath = config.getUploadPath();
|
||||
String tenantCertPath = uploadPath + "dev/wechat/" + order.getTenantId();
|
||||
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
|
||||
|
||||
System.out.println("开发环境证书路径 - 租户ID: " + order.getTenantId());
|
||||
@@ -395,8 +396,9 @@ import com.gxwebsoft.common.core.service.PaymentCacheService;
|
||||
payment.getPubKeyId() != null && !payment.getPubKeyId().isEmpty()) {
|
||||
|
||||
try {
|
||||
// 开发环境固定使用 wechatpay_public_key.pem
|
||||
String tenantCertPath = "dev/wechat/" + order.getTenantId();
|
||||
// 开发环境使用配置文件的upload-path构建公钥路径
|
||||
String uploadPath = config.getUploadPath();
|
||||
String tenantCertPath = uploadPath + "dev/wechat/" + order.getTenantId();
|
||||
String pubKeyPath = tenantCertPath + "/wechatpay_public_key.pem";
|
||||
|
||||
System.out.println("开发环境公钥文件路径: " + pubKeyPath);
|
||||
@@ -470,7 +472,8 @@ import com.gxwebsoft.common.core.service.PaymentCacheService;
|
||||
System.err.println("⚠️ 开发环境回退到基础RSA配置...");
|
||||
try {
|
||||
// 方案1:尝试使用RSA证书配置(需要商户证书文件)
|
||||
String tenantCertPath = "dev/wechat/" + order.getTenantId();
|
||||
String uploadPath = config.getUploadPath();
|
||||
String tenantCertPath = uploadPath + "dev/wechat/" + order.getTenantId();
|
||||
String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile();
|
||||
|
||||
if (certificateLoader.certificateExists(apiclientCertPath)) {
|
||||
|
||||
@@ -46,7 +46,7 @@ mqtt:
|
||||
config:
|
||||
# 开发环境接口
|
||||
server-url: https://server.websoft.top/api
|
||||
upload-path: /Users/gxwebsoft/Documents/uploads/ # window(D:\Temp)
|
||||
upload-path: /Users/gxwebsoft/JAVA/mp-java/src/main/resources/ # window(D:\Temp)
|
||||
|
||||
# 开发环境证书配置
|
||||
certificate:
|
||||
|
||||
Reference in New Issue
Block a user