fix: 仅保留 Waffo,并修复调试包年误用永久 Product
调试不再把兼容字段 product_id 覆盖到包年;包年禁止回落永久商品;下单强制走 Waffo。
This commit is contained in:
1 parent
d94da2129c
commit
2b44e8dcb3
5 files changed
+53
-49
No files matched your search
@@ -435,10 +435,16 @@ func productIDForPlan(cfg WaffoConfig, planType string) string {
|
||||
if cfg.ProductIDYearly != "" {
|
||||
return cfg.ProductIDYearly
|
||||
}
|
||||
// 禁止回落到永久 Product,避免测包年误用永久价/币种 // Logan.Li
|
||||
return ""
|
||||
case "perpetual", "lifetime":
|
||||
if cfg.ProductIDPerpetual != "" {
|
||||
return cfg.ProductIDPerpetual
|
||||
}
|
||||
if cfg.ProductID != "" {
|
||||
return cfg.ProductID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
if id := strings.TrimSpace(cfg.ProductIDs["default"]); id != "" {
|
||||
return id
|
||||
@@ -446,10 +452,7 @@ func productIDForPlan(cfg WaffoConfig, planType string) string {
|
||||
if cfg.ProductID != "" {
|
||||
return cfg.ProductID
|
||||
}
|
||||
if cfg.ProductIDPerpetual != "" {
|
||||
return cfg.ProductIDPerpetual
|
||||
}
|
||||
return cfg.ProductIDYearly
|
||||
return firstNonEmpty(cfg.ProductIDPerpetual, cfg.ProductIDYearly)
|
||||
}
|
||||
|
||||
func currencyForPlan(cfg WaffoConfig, planType string) string {
|
||||
|
||||
Reference in new issue
Block a user