1
0
mirror of synced 2026-05-23 02:46:15 +08:00

🎨 #3968【微信支付】修复微信支付api-host-url配置反向代理路径前缀时会导致v3签名异常的问题

This commit is contained in:
水依寒
2026-05-11 20:32:42 +08:00
committed by GitHub
parent bcb3110bd7
commit 24703be583
16 changed files with 164 additions and 9 deletions

View File

@@ -23,6 +23,8 @@ wx:
pay:
appId: xxxxxxxxxxx
mchId: 15xxxxxxxxx #商户id
apiHostUrl: http://10.0.0.1:3128 # 可选:代理主机
apiHostUrlPath: /api-weixin # 可选:代理入口前缀
apiV3Key: Dc1DBwSc094jACxxxxxxxxxxxxxxx #V3密钥
certSerialNo: 62C6CEAA360BCxxxxxxxxxxxxxxx
privateKeyPath: classpath:cert/apiclient_key.pem #apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径

View File

@@ -59,6 +59,7 @@ public class WxPayAutoConfiguration {
payConfig.setPublicKeyId(StringUtils.trimToNull(this.properties.getPublicKeyId()));
payConfig.setPublicKeyPath(StringUtils.trimToNull(this.properties.getPublicKeyPath()));
payConfig.setApiHostUrl(StringUtils.trimToNull(this.properties.getApiHostUrl()));
payConfig.setApiHostUrlPath(StringUtils.trimToNull(this.properties.getApiHostUrlPath()));
payConfig.setStrictlyNeedWechatPaySerial(this.properties.isStrictlyNeedWechatPaySerial());
payConfig.setFullPublicKeyModel(this.properties.isFullPublicKeyModel());

View File

@@ -113,6 +113,12 @@ public class WxPayProperties {
*/
private String apiHostUrl;
/**
* 自定义API主机路径前缀用于代理入口前缀
* 例如:/api-weixin
*/
private String apiHostUrlPath;
/**
* 是否将全部v3接口的请求都添加Wechatpay-Serial请求头默认添加
*/