|
|
@ -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)) { |
|
|
|