Bladeren bron

fix(payment): 微信支付 v3 回调通知加入白名单并修正 notify-url

普通微信支付回调统一走 /api/payment/wechat/v3-notify:notify-url 改用 WECHAT_NOTIFY_URL 环境变量(默认 https://cfc.etotem.com.cn),并在 JWT 与家庭访问两处拦截器白名单放行回调地址,避免回调被拦截导致支付状态无法回写。

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
iwt 6 dagen geleden
bovenliggende
commit
b01de130fb

+ 4 - 2
cfc-backend/src/main/java/com/etotem/cfc/config/WebConfig.java

@@ -125,7 +125,8 @@ public class WebConfig implements WebMvcConfigurer {
                 "/api/payment/wechat/create",
                 "/api/payment/wechat/status",
                 "/api/payment/wechat/oauth2-url",
-                "/api/payment/wechat/oauth2-callback"
+                "/api/payment/wechat/oauth2-callback",
+                "/api/payment/wechat/v3-notify"
         );
 
         registry.addInterceptor(operationLogInterceptor)
@@ -159,7 +160,8 @@ public class WebConfig implements WebMvcConfigurer {
                 "/api/articles/record-read",
                 "/api/growth/**",
                 "/api/activity/list",
-                "/api/activity/detail"
+                "/api/activity/detail",
+                "/api/payment/wechat/v3-notify"
         );
     }
 

+ 1 - 1
cfc-backend/src/main/resources/application.yml

@@ -89,7 +89,7 @@ wechat:
   api-v3-key: ${WECHAT_API_V3_KEY:dev-only-api-v3-key}
   mch-serial-no: 53C2A906094D725BC350A3414AADCA6D79882AAF
   private-key-path: cert/apiclient_key.pem
-  notify-url: http://cfc.bianwoyou.com.cn/api/payment/notify
+  notify-url: ${WECHAT_NOTIFY_URL:https://cfc.etotem.com.cn/api/payment/wechat/v3-notify}
   login-url: https://api.weixin.qq.com/sns/jscode2session
   phone-url: https://api.weixin.qq.com/wxa/business/getuserphonenumber
   test-mode: true  # 测试模式:跳过微信 API 调用,使用模拟数据