From 52aba13c9ef605290b5363c2f0d85e1a54cdaed6 Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Sat, 9 May 2026 22:05:23 +0800 Subject: [PATCH] f --- config.yaml | 1 + configs/env.development.yaml | 2 +- configs/env.production.yaml | 6 ++++++ internal/config/config.go | 1 + internal/shared/payment/wechatpay.go | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index e1d6eee..f16a79a 100644 --- a/config.yaml +++ b/config.yaml @@ -400,6 +400,7 @@ alipay: # 💰 微信支付配置 # =========================================== Wxpay: + app_id: "wxa42614fcc7e5c50e" mch_id: "1111281099" mch_certificate_serial_number: "5E6FBBCB4C6C5378BEBA85D151A258CE0BE33A77" mch_apiv3_key: "7s9KpG2tR8aZcX5bN3mQ6wE4dF1hJ7Lq" diff --git a/configs/env.development.yaml b/configs/env.development.yaml index 80480fa..c943197 100644 --- a/configs/env.development.yaml +++ b/configs/env.development.yaml @@ -88,7 +88,7 @@ alipay: # 💰 微信支付配置 # =========================================== Wxpay: - app_id: "wxa581992dc74d860e" + app_id: "wxa42614fcc7e5c50e" mch_id: "1683589176" mch_certificate_serial_number: "1F4E8B3C39C60035D4CC154F276D03D9CC2C603D" mch_apiv3_key: "TY8X9nP2qR5tY7uW3zA6bC4dE1flgGJ0" diff --git a/configs/env.production.yaml b/configs/env.production.yaml index 49e389c..d33ddfd 100644 --- a/configs/env.production.yaml +++ b/configs/env.production.yaml @@ -101,6 +101,12 @@ alipay: notify_url: "https://console.haiyudata.com/api/v1/finance/alipay/callback" return_url: "https://console.haiyudata.com/api/v1/finance/alipay/return" +# =========================================== +# 💰 微信支付配置 +# =========================================== +Wxpay: + app_id: "wxa42614fcc7e5c50e" + # =========================================== # 💰 钱包配置 # =========================================== diff --git a/internal/config/config.go b/internal/config/config.go index 9350910..84dcd93 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -509,6 +509,7 @@ type AliPayConfig struct { // WxpayConfig 微信支付配置 type WxpayConfig struct { + AppID string `mapstructure:"app_id"` MchID string `mapstructure:"mch_id"` MchCertificateSerialNumber string `mapstructure:"mch_certificate_serial_number"` MchApiv3Key string `mapstructure:"mch_apiv3_key"` diff --git a/internal/shared/payment/wechatpay.go b/internal/shared/payment/wechatpay.go index 1fd5030..2ad3d04 100644 --- a/internal/shared/payment/wechatpay.go +++ b/internal/shared/payment/wechatpay.go @@ -231,6 +231,7 @@ func newWechatPayServiceWithWxPayPubKey(c config.Config, logger *zap.Logger) *We func (w *WechatPayService) CreateWechatNativeOrder(ctx context.Context, amount float64, description string, outTradeNo string) (interface{}, error) { totalAmount := ToWechatAmount(amount) req := native.PrepayRequest{ + Appid: core.String(w.config.Wxpay.AppID), Mchid: core.String(w.config.Wxpay.MchID), Description: core.String(description), OutTradeNo: core.String(outTradeNo),