fix: 包年改为 Waffo 一次性商品并切 CNY

包年 SKU 换为 PROD_1BIezCi932IbgCzRIV8hcJ,checkout type 统一 onetime。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Logan.LiandCursor committed 2026-08-12 16:04:36 +08:00
1 parent a47af22e91
commit d4c5637168
4 files changed
+19 -22

No files matched your search

@@ -6,12 +6,12 @@ import (
"testing"
)
func TestBuildCheckoutURL_YearlySubscription(t *testing.T) {
func TestBuildCheckoutURL_YearlyOnetime(t *testing.T) {
cfg := WaffoConfig{
StoreSlug: "opsxshell-pwsi6m4n",
ProductIDYearly: "PROD_2WmkUVoYWt0NN8OVEyC6n3",
ProductIDYearly: "PROD_1BIezCi932IbgCzRIV8hcJ",
ProductIDPerpetual: "PROD_0pcnzzT4nalEkkcdyIUoD5",
Currency: "USD",
Currency: "CNY",
Environment: "test",
SuccessURL: "opsxshell://pro/activated",
}
@@ -23,14 +23,14 @@ func TestBuildCheckoutURL_YearlySubscription(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if !strings.Contains(u.Path, "PROD_2WmkUVoYWt0NN8OVEyC6n3") {
if !strings.Contains(u.Path, "PROD_1BIezCi932IbgCzRIV8hcJ") {
t.Fatalf("yearly product missing: %s", raw)
}
q := u.Query()
if q.Get("type") != "subscription" {
t.Fatalf("type=%s want subscription", q.Get("type"))
if q.Get("type") != "onetime" {
t.Fatalf("type=%s want onetime", q.Get("type"))
}
if q.Get("currency") != "USD" {
if q.Get("currency") != "CNY" {
t.Fatalf("currency=%s", q.Get("currency"))
}
if q.Get("test") != "true" {
@@ -41,9 +41,9 @@ func TestBuildCheckoutURL_YearlySubscription(t *testing.T) {
func TestBuildCheckoutURL_PerpetualOnetime(t *testing.T) {
cfg := WaffoConfig{
StoreSlug: "opsxshell-pwsi6m4n",
ProductIDYearly: "PROD_2WmkUVoYWt0NN8OVEyC6n3",
ProductIDYearly: "PROD_1BIezCi932IbgCzRIV8hcJ",
ProductIDPerpetual: "PROD_0pcnzzT4nalEkkcdyIUoD5",
Currency: "USD",
Currency: "CNY",
Environment: "test",
SuccessURL: "opsxshell://pro/activated",
}