fix: 永久授权结账币种改为 CNY
与 pancake 永久商品 onetime+CNY 链接对齐,包年/永久均为 CNY。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e8d98c993f
commit
554998f4b7
3 files changed
+6
-11
No files matched your search
+2
-2
@@ -43,7 +43,7 @@ DB_NAME=db.sqlite3
|
||||
# ============================================
|
||||
# 店铺: https://pancake.waffo.ai/store/opsxshell-pwsi6m4n
|
||||
# 包年一次性: PROD_1BIezCi932IbgCzRIV8hcJ (type=onetime, currency=CNY)
|
||||
# 永久买断: PROD_0pcnzzT4nalEkkcdyIUoD5 (type=onetime, currency=USD)
|
||||
# 永久买断: PROD_0pcnzzT4nalEkkcdyIUoD5 (type=onetime, currency=CNY)
|
||||
# 勿设置单一 WAFFO_CHECKOUT_URL,否则无法按档位分流商品
|
||||
WAFFO_STORE_SLUG=opsxshell-pwsi6m4n
|
||||
WAFFO_PRODUCT_ID=PROD_0pcnzzT4nalEkkcdyIUoD5
|
||||
@@ -51,7 +51,7 @@ WAFFO_PRODUCT_ID_YEARLY=PROD_1BIezCi932IbgCzRIV8hcJ
|
||||
WAFFO_PRODUCT_ID_PERPETUAL=PROD_0pcnzzT4nalEkkcdyIUoD5
|
||||
WAFFO_CURRENCY=CNY
|
||||
WAFFO_CURRENCY_YEARLY=CNY
|
||||
WAFFO_CURRENCY_PERPETUAL=USD
|
||||
WAFFO_CURRENCY_PERPETUAL=CNY
|
||||
# test | live(test 时自动附加 test=true)
|
||||
WAFFO_ENVIRONMENT=test
|
||||
# 支付成功回跳(桌面端 deep link;CreateOrder/Checkout 的 return_url 可覆盖)
|
||||
|
||||
@@ -41,13 +41,8 @@ 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
|
||||
}
|
||||
}
|
||||
defaultProduct := strings.TrimSpace(os.Getenv("WAFFO_PRODUCT_ID"))
|
||||
yearly := strings.TrimSpace(os.Getenv("WAFFO_PRODUCT_ID_YEARLY"))
|
||||
perpetual := strings.TrimSpace(os.Getenv("WAFFO_PRODUCT_ID_PERPETUAL"))
|
||||
|
||||
@@ -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"))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user