refactor: 清理 YAML 支付配置遗留代码,重命名 Card* 常量为 Asset*,新增支付配置相关错误码
- 删除 PaymentConfig 结构体和 WechatConfig.Payment 字段(YAML 方案已废弃) - 删除 wechat.payment 配置节和 NewPaymentApp() 函数 - 删除 validateWechatConfig 中所有 wechatCfg.Payment.* 校验代码 - pkg/constants/wallet.go: Card* 前缀统一重命名为 Asset*,旧名保留废弃别名 - pkg/constants/redis.go: 新增 RedisWechatConfigActiveKey() - pkg/errors/codes.go: 新增错误码 1170-1175 - go.mod: 新增 golang.org/x/text 依赖(富友支付 GBK 编解码) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -160,7 +160,6 @@ type PresignConfig struct {
|
||||
// WechatConfig 微信配置
|
||||
type WechatConfig struct {
|
||||
OfficialAccount OfficialAccountConfig `mapstructure:"official_account"`
|
||||
Payment PaymentConfig `mapstructure:"payment"`
|
||||
}
|
||||
|
||||
// OfficialAccountConfig 微信公众号配置
|
||||
@@ -172,20 +171,6 @@ type OfficialAccountConfig struct {
|
||||
OAuthRedirectURL string `mapstructure:"oauth_redirect_url"`
|
||||
}
|
||||
|
||||
// PaymentConfig 微信支付配置
|
||||
type PaymentConfig struct {
|
||||
AppID string `mapstructure:"app_id"`
|
||||
MchID string `mapstructure:"mch_id"`
|
||||
APIV3Key string `mapstructure:"api_v3_key"`
|
||||
APIV2Key string `mapstructure:"api_v2_key"`
|
||||
CertPath string `mapstructure:"cert_path"`
|
||||
KeyPath string `mapstructure:"key_path"`
|
||||
SerialNo string `mapstructure:"serial_no"`
|
||||
NotifyURL string `mapstructure:"notify_url"`
|
||||
HttpDebug bool `mapstructure:"http_debug"`
|
||||
Timeout time.Duration `mapstructure:"timeout"`
|
||||
}
|
||||
|
||||
type requiredField struct {
|
||||
value string
|
||||
name string
|
||||
|
||||
@@ -120,14 +120,4 @@ wechat:
|
||||
token: "" # 可选:JUNHONG_WECHAT_OFFICIAL_ACCOUNT_TOKEN
|
||||
aes_key: "" # 可选:JUNHONG_WECHAT_OFFICIAL_ACCOUNT_AES_KEY(敏感)
|
||||
oauth_redirect_url: "" # 可选:JUNHONG_WECHAT_OFFICIAL_ACCOUNT_OAUTH_REDIRECT_URL
|
||||
payment:
|
||||
app_id: "" # 必填:JUNHONG_WECHAT_PAYMENT_APP_ID
|
||||
mch_id: "" # 必填:JUNHONG_WECHAT_PAYMENT_MCH_ID
|
||||
api_v3_key: "" # 必填:JUNHONG_WECHAT_PAYMENT_API_V3_KEY(敏感)
|
||||
api_v2_key: "" # 可选:JUNHONG_WECHAT_PAYMENT_API_V2_KEY(敏感)
|
||||
cert_path: "" # 必填:JUNHONG_WECHAT_PAYMENT_CERT_PATH(证书文件路径)
|
||||
key_path: "" # 必填:JUNHONG_WECHAT_PAYMENT_KEY_PATH(私钥文件路径)
|
||||
serial_no: "" # 必填:JUNHONG_WECHAT_PAYMENT_SERIAL_NO
|
||||
notify_url: "" # 必填:JUNHONG_WECHAT_PAYMENT_NOTIFY_URL
|
||||
http_debug: false
|
||||
timeout: "30s"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user