fix: 测试包年商品改用 USD,避免 CNY 不被支持

Waffo 测试侧 Yearly Product 仅支持 USD;按 Product ID 自动选币种。
This commit is contained in:
Logan.Li committed 2026-08-13 00:13:07 +08:00
1 parent 2b44e8dcb3
commit 37d9e8ca56
3 files changed
+51 -23

No files matched your search

+17 -3
View File
@@ -456,22 +456,36 @@ func productIDForPlan(cfg WaffoConfig, planType string) string {
}
func currencyForPlan(cfg WaffoConfig, planType string) string {
// 已知商品 ID 优先(测试包年不支持 CNY) // Logan.Li
if pid := productIDForPlan(cfg, planType); pid != "" {
switch pid {
case "PROD_1BIezCi932IbgCzRIV8hcJ", // test yearly
"PROD_0pcnzzT4nalEkkcdyIUoD5", // test perpetual
"PROD_3BSJqDRkVBoYNgO78NsTAU": // live perpetual
return "USD"
case "PROD_5PqVJyEiCM4nDgVoA0RKjN": // live yearly
return "CNY"
}
}
switch strings.TrimSpace(strings.ToLower(planType)) {
case "yearly", "monthly":
if cfg.CurrencyYearly != "" {
return cfg.CurrencyYearly
}
return "CNY" // OpsXshell 包年默认人民币 // Logan.Li
if NormalizeWaffoEnvironment(cfg.Environment) == "live" {
return "CNY"
}
return "USD"
case "perpetual", "lifetime":
if cfg.CurrencyPerpetual != "" {
return cfg.CurrencyPerpetual
}
return "USD" // OpsXshell 永久默认美元 // Logan.Li
return "USD"
}
if cfg.Currency != "" {
return cfg.Currency
}
return "CNY"
return "USD"
}
func checkoutTypeForPlan(planType string) string {