fix: 永久授权结账币种改为 CNY

与 pancake 永久商品 onetime+CNY 链接对齐,包年/永久均为 CNY。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Logan.LiandCursor committed 2026-08-12 16:19:33 +08:00
1 parent e8d98c993f
commit 554998f4b7
3 files changed
+7 -12

No files matched your search

+1 -6
View File
@@ -41,12 +41,7 @@ func LoadWaffoConfig() WaffoConfig {
}
currencyPerpetual := strings.TrimSpace(os.Getenv("WAFFO_CURRENCY_PERPETUAL"))
if currencyPerpetual == "" {
// 永久默认 USD(与 pancake 商品一致);可用环境变量覆盖。 // Logan.Li
if currency == "CNY" {
currencyPerpetual = "USD"
} else {
currencyPerpetual = currency
}
currencyPerpetual = currency
}
defaultProduct := strings.TrimSpace(os.Getenv("WAFFO_PRODUCT_ID"))
yearly := strings.TrimSpace(os.Getenv("WAFFO_PRODUCT_ID_YEARLY"))
@@ -37,14 +37,14 @@ func TestBuildCheckoutURL_YearlyOnetimeCNY(t *testing.T) {
}
}
func TestBuildCheckoutURL_PerpetualOnetimeUSD(t *testing.T) {
func TestBuildCheckoutURL_PerpetualOnetimeCNY(t *testing.T) {
cfg := WaffoConfig{
StoreSlug: "opsxshell-pwsi6m4n",
ProductIDYearly: "PROD_1BIezCi932IbgCzRIV8hcJ",
ProductIDPerpetual: "PROD_0pcnzzT4nalEkkcdyIUoD5",
Currency: "CNY",
CurrencyYearly: "CNY",
CurrencyPerpetual: "USD",
CurrencyPerpetual: "CNY",
Environment: "test",
SuccessURL: "opsxshell://pro/activated",
}
@@ -63,7 +63,7 @@ func TestBuildCheckoutURL_PerpetualOnetimeUSD(t *testing.T) {
if q.Get("type") != "onetime" {
t.Fatalf("type=%s want onetime", q.Get("type"))
}
if q.Get("currency") != "USD" {
t.Fatalf("currency=%s want USD", q.Get("currency"))
if q.Get("currency") != "CNY" {
t.Fatalf("currency=%s want CNY", q.Get("currency"))
}
}