billing: catalog and book 2026-11-26-v1 with media minutes and a media pack
Records the flagship's next plan catalog and price book in deploy/billing. Nothing is installed or created at Stripe by this change. catalog-2026-11-26-v1.json is catalog-2026-11-15-v1.json (the flagship's installed plans.json) with only: version 2026-11-26-v1; media_minutes_month free 30, personal 600, community 1200, business 12000; a media pack adding 1000 media minutes a month, max 20; media offered on the three paid plans. pricebook-2026-11-26-v1.json is pricebook-2026-11-15-v2.json, approved, for catalog 2026-11-26-v1, with the media pack at USD 12, EUR 10 and GBP 9 a year. Paul approved these amounts and allowances directly on 2026-11-26, so there is no separate draft. scripts/stripe-setup.sh defaults to the new book (a ninth product, "Media pack", and 27 prices); its tests follow, and 2026-11-15-v2 stays as freeStorageBook. A new plans test checks the new catalog differs from 2026-11-15-v1 only by the media fields. Copy: delegated Luna pass, every rendered string kept, no flags. Review: Astra round 1, READY AFTER FIXES, no P1; its P2 (subscribers on an earlier book are shown a media pack row the console then refuses) is the existing tested refusal and is filed as discussion 1450. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from media-pack-catalog-20261126 into main.
5 files changed,
+239
−31
cmd/console/stripesetup_script_test.go+35 −29deploy/billing/catalog-2026-11-26-v1.json+111 −0deploy/billing/pricebook-2026-11-26-v1.json+24 −0internal/plans/repo_catalog_test.go+67 −0scripts/stripe-setup.sh+2 −2
CI cancelled — superseded by a newer push — run details
CI log
=== gate === go: downloading go1.26.10 (linux/arm64) go version go1.26.10 linux/arm64 opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1 tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz tofu: downloaded, digest verified aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip aws: downloaded, digest verified archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip archive: downloaded, digest verified installed in /tmp/carlos-opentofu-D6tmp2 .amadan/test-gate.sh go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0 go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e go: downloading golang.org/x/net v0.62.0 go: downloading modernc.org/sqlite v1.55.0 go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5 go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0 go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0 go: downloading golang.org/x/sys v0.49.0 go: downloading golang.org/x/crypto v0.58.0 go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0 go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2 go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0 go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0 go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6 go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1 go: downloading github.com/pion/logging v0.2.4 go: downloading github.com/pion/stun/v3 v3.1.5 go: downloading github.com/pion/turn/v4 v4.1.4 go: downloading github.com/pierrec/lz4/v4 v4.1.22 go: downloading google.golang.org/protobuf v1.36.10 go: downloading github.com/klauspost/compress v1.20.2 go: downloading golang.org/x/text v0.43.0 go: downloading github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23 go: downloading github.com/pion/transport/v4 v4.0.2 go: downloading github.com/pion/dtls/v3 v3.1.4 go: downloading github.com/pion/randutil v0.1.0 go: downloading github.com/wlynxg/anet v0.0.5 go: downloading modernc.org/sqlite v1.55.0 go: downloading github.com/klauspost/compress v1.20.2 go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0 go: downloading github.com/pierrec/lz4/v4 v4.1.22 go: downloading github.com/wlynxg/anet v0.0.5 go: downloading modernc.org/libc v1.74.1 go: downloading modernc.org/libc v1.74.1 go: downloading modernc.org/memory v1.11.0 go: downloading github.com/google/uuid v1.6.0 go: downloading modernc.org/mathutil v1.7.1 go: downloading github.com/dustin/go-humanize v1.0.1 go: downloading github.com/dustin/go-humanize v1.0.1 go: downloading github.com/google/uuid v1.6.0 go: downloading modernc.org/memory v1.11.0 go: downloading modernc.org/mathutil v1.7.1 amadan: job cancelled — a newer push superseded it
diff --git a/cmd/console/stripesetup_script_test.go b/cmd/console/stripesetup_script_test.go| index ef0ef75ca..d65dd77f3 100644 |
| --- a/cmd/console/stripesetup_script_test.go |
| +++ b/cmd/console/stripesetup_script_test.go |
| @@ -24,7 +24,8 @@ import ( |
| const ( |
| stripeSetupScript = "../../scripts/stripe-setup.sh" |
| - approvedBook = "../../deploy/billing/pricebook-2026-11-15-v2.json" |
| + approvedBook = "../../deploy/billing/pricebook-2026-11-26-v1.json" |
| + freeStorageBook = "../../deploy/billing/pricebook-2026-11-15-v2.json" |
| flatApprovedBook = "../../deploy/billing/pricebook-2026-11-14-v2.json" |
| prevApprovedBook = "../../deploy/billing/pricebook-2026-11-01-v1.json" |
| draftBook = "../../deploy/billing/pricebook-2026-10-27-v1.json" |
| @@ -351,7 +352,7 @@ func TestStripeSetupLiveApply(t *testing.T) { |
| } |
| } |
| fw := w.load() |
| - counts := map[string]int{"products": 8, "prices": 24, "billing_portal/configurations": 1, "coupons": 1, "webhook_endpoints": 1} |
| + counts := map[string]int{"products": 9, "prices": 27, "billing_portal/configurations": 1, "coupons": 1, "webhook_endpoints": 1} |
| for kind, want := range counts { |
| if got := len(fw.Objects[kind]); got != want { |
| t.Errorf("%s: made %d, want %d", kind, got, want) |
| @@ -363,7 +364,7 @@ func TestStripeSetupLiveApply(t *testing.T) { |
| } |
| } |
| for _, p := range fw.Objects["prices"] { |
| - if k, _ := p["lookup_key"].(string); !strings.HasPrefix(k, "2026-11-15-v2/") { |
| + if k, _ := p["lookup_key"].(string); !strings.HasPrefix(k, "2026-11-26-v1/") { |
| t.Errorf("price %v has lookup key %q, not one of the approved book's", p["id"], k) |
| } |
| } |
| @@ -376,7 +377,7 @@ func TestStripeSetupLiveApply(t *testing.T) { |
| if got := fw.Objects["webhook_endpoints"][0]["enabled_events"]; !reflect.DeepEqual(got, webhookEvents) { |
| t.Errorf("webhook endpoint events %v, want %v", got, webhookEvents) |
| } |
| - for _, want := range []string{"CARLOS_BILLING=live", `"2026-11-15-v2/pack/apps/gbp":"price_`, "rk_live_"} { |
| + for _, want := range []string{"CARLOS_BILLING=live", `"2026-11-26-v1/pack/apps/gbp":"price_`, "rk_live_"} { |
| if !strings.Contains(stdout, want) { |
| t.Errorf("stdout lacks %q:\n%s", want, stdout) |
| } |
| @@ -454,7 +455,7 @@ func TestStripeSetupLiveDryRunSendsNothing(t *testing.T) { |
| } |
| } |
| } |
| - if printed == 0 || !strings.Contains(stdout, "2026-11-15-v2/personal/usd") || !strings.Contains(stdout, "CARLOS_BILLING=live") { |
| + if printed == 0 || !strings.Contains(stdout, "2026-11-26-v1/personal/usd") || !strings.Contains(stdout, "CARLOS_BILLING=live") { |
| t.Fatalf("the dry run printed no live plan:\n%s", stdout) |
| } |
| } |
| @@ -580,7 +581,7 @@ func TestStripeSetupReplayedArchivedPriceStops(t *testing.T) { |
| fw := w.load() |
| archived := "" |
| for _, p := range fw.Objects["prices"] { |
| - if p["lookup_key"] == "2026-11-15-v2/personal/usd" { |
| + if p["lookup_key"] == "2026-11-26-v1/personal/usd" { |
| p["active"], p["lookup_key"] = false, nil |
| archived = p["id"].(string) |
| } |
| @@ -599,8 +600,8 @@ func TestStripeSetupReplayedArchivedPriceStops(t *testing.T) { |
| if strings.Contains(stdout, "CARLOS_BILLING_PRICES=") { |
| t.Fatalf("the environment block was printed after the refusal") |
| } |
| - if n := len(w.load().Objects["prices"]); n != 24 { |
| - t.Fatalf("%d prices, want the first run's 24", n) |
| + if n := len(w.load().Objects["prices"]); n != 27 { |
| + t.Fatalf("%d prices, want the first run's 27", n) |
| } |
| } |
| @@ -610,10 +611,12 @@ func TestStripeSetupReplayedArchivedPriceStops(t *testing.T) { |
| // installs). Books for catalog 2026-10-20-v1 priced its per-member team |
| // plans, which this console no longer loads (#1033); they stay as the |
| // record of what was sold, and a subscription bought under one keeps its |
| -// price keys. approvedBook is the newest approved book, 2026-11-15-v2 |
| -// (Paul, 2026-11-15, #1086), written from the draft 2026-11-15-v1, which |
| -// stays as it was; flatApprovedBook, 2026-11-14-v2, is the one before it. |
| -// The draft 2026-11-15-v1 stays a draft. |
| +// price keys. approvedBook is the newest approved book, 2026-11-26-v1: the |
| +// media pack and media allowances (Paul approved its amounts directly on |
| +// 2026-11-26, so it has no draft). freeStorageBook, 2026-11-15-v2 (Paul, |
| +// 2026-11-15, #1086), is the one before it, written from the draft |
| +// 2026-11-15-v1, which stays a draft; flatApprovedBook, 2026-11-14-v2, is |
| +// the one before that. |
| func TestRepoPriceBooksLoad(t *testing.T) { |
| catalogs := map[string]*plans.Catalog{} |
| catalogFor := func(version string) *plans.Catalog { |
| @@ -669,8 +672,10 @@ func TestRepoPriceBooksLoad(t *testing.T) { |
| if current == 0 { |
| t.Error("no book prices a catalog in deploy/billing") |
| } |
| - if _, err := plans.LoadPriceBook(flatApprovedBook, catalogFor("2026-11-14-v1")); err != nil { |
| - t.Errorf("%s: %v", flatApprovedBook, err) |
| + for book, catalog := range map[string]string{flatApprovedBook: "2026-11-14-v1", freeStorageBook: "2026-11-15-v1"} { |
| + if b, err := plans.LoadPriceBook(book, catalogFor(catalog)); err != nil || !b.Approved() { |
| + t.Errorf("%s: %v; want an approved book that loads", book, err) |
| + } |
| } |
| if newestApproved != approvedBook { |
| t.Errorf("the newest approved book is %s, not %s", newestApproved, approvedBook) |
| @@ -689,10 +694,10 @@ const freeStorageDraftBook = "../../deploy/billing/pricebook-2026-11-15-v1.json" |
| // The flat book (#1033) on an account that already has the previous |
| // approved book's objects: a sandbox --apply of the default (approved flat) |
| -// book reuses the eight products and adds its 24 prices beside the earlier |
| -// ones, Teams and Business at their flat yearly price; the printed price map |
| -// names only the flat book's keys. A live run, dry runs included, refuses the |
| -// draft it was approved from. |
| +// book reuses the eight products, makes the media pack's (2026-11-26-v1), |
| +// and adds its 27 prices beside the earlier ones, Teams and Business at |
| +// their flat yearly price; the printed price map names only the default |
| +// book's keys. A live run, dry runs included, refuses the flat draft. |
| func TestStripeSetupFlatBook(t *testing.T) { |
| w := newStripeWorld(t, sandboxAccount, false) |
| if stdout, stderr, code := w.run([]string{"PRICE_BOOK=" + prevApprovedBook}, "--apply"); code != 0 { |
| @@ -703,16 +708,17 @@ func TestStripeSetupFlatBook(t *testing.T) { |
| t.Fatalf("flat --apply failed (%d):\n%s\n%s", code, stdout, stderr) |
| } |
| fw := w.load() |
| - if n := len(fw.Objects["products"]); n != 8 { |
| - t.Errorf("%d products, want the approved run's 8 reused", n) |
| + if n := len(fw.Objects["products"]); n != 9 { |
| + t.Errorf("%d products, want the approved run's 8 reused and the media pack's", n) |
| } |
| - if n := len(fw.Objects["prices"]); n != 48 { |
| - t.Errorf("%d prices, want 24 per book", n) |
| + if n := len(fw.Objects["prices"]); n != 51 { |
| + t.Errorf("%d prices, want the earlier book's 24 and the default book's 27", n) |
| } |
| want := map[string]float64{ |
| - "2026-11-15-v2/community/eur": 5000, "2026-11-15-v2/community/usd": 6000, "2026-11-15-v2/community/gbp": 4500, |
| - "2026-11-15-v2/business/eur": 50000, "2026-11-15-v2/business/usd": 60000, "2026-11-15-v2/business/gbp": 45000, |
| - "2026-11-15-v2/personal/eur": 2400, |
| + "2026-11-26-v1/community/eur": 5000, "2026-11-26-v1/community/usd": 6000, "2026-11-26-v1/community/gbp": 4500, |
| + "2026-11-26-v1/business/eur": 50000, "2026-11-26-v1/business/usd": 60000, "2026-11-26-v1/business/gbp": 45000, |
| + "2026-11-26-v1/personal/eur": 2400, |
| + "2026-11-26-v1/pack/media/usd": 1200, "2026-11-26-v1/pack/media/eur": 1000, "2026-11-26-v1/pack/media/gbp": 900, |
| } |
| for _, p := range fw.Objects["prices"] { |
| k, _ := p["lookup_key"].(string) |
| @@ -733,12 +739,12 @@ func TestStripeSetupFlatBook(t *testing.T) { |
| } |
| } |
| var printed map[string]string |
| - if err := json.Unmarshal([]byte(line), &printed); err != nil || len(printed) != 24 { |
| - t.Fatalf("printed price map %q: %v, want the flat book's 24 keys", line, err) |
| + if err := json.Unmarshal([]byte(line), &printed); err != nil || len(printed) != 27 { |
| + t.Fatalf("printed price map %q: %v, want the default book's 27 keys", line, err) |
| } |
| for k := range printed { |
| - if !strings.HasPrefix(k, "2026-11-15-v2/") { |
| - t.Errorf("printed key %q is not the flat book's", k) |
| + if !strings.HasPrefix(k, "2026-11-26-v1/") { |
| + t.Errorf("printed key %q is not the default book's", k) |
| } |
| } |
diff --git a/deploy/billing/catalog-2026-11-26-v1.json b/deploy/billing/catalog-2026-11-26-v1.json| new file mode 100644 |
| index 000000000..dfd7949df |
| --- /dev/null |
| +++ b/deploy/billing/catalog-2026-11-26-v1.json |
| @@ -0,0 +1,111 @@ |
| +{ |
| + "version": "2026-11-26-v1", |
| + "default_plan": "free", |
| + "free_accounts_per_person": 1, |
| + "sponsor_accounts_before": "2026-11-02T11:20:56Z", |
| + "plans": { |
| + "free": { |
| + "paid": false, |
| + "max_members": 3, |
| + "limits": { |
| + "running_things": 3, |
| + "sidecars_per_app": 1, |
| + "idle_seconds": 90, |
| + "memory_tier": "small", |
| + "awake_hours_month": 90, |
| + "disk_bytes": 1073741824, |
| + "storage_bytes": 52428800, |
| + "storage_self_serve": true, |
| + "storage_scan_required": true, |
| + "email_per_day": 50, |
| + "email_per_hour": 5, |
| + "bandwidth_bytes_month": 10737418240, |
| + "pdf_renders_month": 100, |
| + "media_minutes_month": 30, |
| + "min_schedule_seconds": 900 |
| + }, |
| + "kept_storage": {"approved_before": "2026-11-15T00:00:00Z", "storage_bytes": 1073741824} |
| + }, |
| + "personal": { |
| + "paid": true, |
| + "limits": { |
| + "running_things": 25, |
| + "sidecars_per_app": 5, |
| + "idle_seconds": 900, |
| + "memory_tier": "default", |
| + "awake_hours_month": 1500, |
| + "disk_bytes": 10737418240, |
| + "storage_bytes": 26843545600, |
| + "storage_self_serve": true, |
| + "email_per_day": 1000, |
| + "bandwidth_bytes_month": 53687091200, |
| + "pdf_renders_month": 2000, |
| + "media_minutes_month": 600, |
| + "custom_domains": true, |
| + "fleets": true, |
| + "min_schedule_seconds": 60, |
| + "history_days": 7 |
| + }, |
| + "packs": ["apps", "disk", "storage", "email", "bandwidth", "media"] |
| + }, |
| + "community": { |
| + "name": "Teams", |
| + "paid": true, |
| + "limits": { |
| + "running_things": 50, |
| + "sidecars_per_app": 5, |
| + "idle_seconds": 900, |
| + "memory_tier": "default", |
| + "awake_hours_month": 3000, |
| + "disk_bytes": 10737418240, |
| + "storage_bytes": 53687091200, |
| + "storage_self_serve": true, |
| + "email_per_day": 2000, |
| + "bandwidth_bytes_month": 107374182400, |
| + "pdf_renders_month": 4000, |
| + "media_minutes_month": 1200, |
| + "custom_domains": true, |
| + "fleets": true, |
| + "min_schedule_seconds": 60 |
| + }, |
| + "packs": ["apps", "disk", "storage", "email", "bandwidth", "media"], |
| + "ceilings": {"running_things": 400, "email_per_day": 20000, "idle_seconds": 900} |
| + }, |
| + "business": { |
| + "paid": true, |
| + "limits": { |
| + "running_things": 500, |
| + "sidecars_per_app": 5, |
| + "idle_seconds": 900, |
| + "memory_tier": "default", |
| + "awake_hours_month": 30000, |
| + "disk_bytes": 10737418240, |
| + "storage_bytes": 536870912000, |
| + "storage_self_serve": true, |
| + "email_per_day": 20000, |
| + "bandwidth_bytes_month": 1073741824000, |
| + "pdf_renders_month": 40000, |
| + "media_minutes_month": 12000, |
| + "custom_domains": true, |
| + "fleets": true, |
| + "min_schedule_seconds": 60, |
| + "history_days": 7 |
| + }, |
| + "packs": ["apps", "disk", "storage", "email", "bandwidth", "media"], |
| + "ceilings": {"running_things": 4000, "email_per_day": 200000, "idle_seconds": 900} |
| + } |
| + }, |
| + "packs": { |
| + "apps": {"adds": {"running_things": 5}, "max_quantity": 20}, |
| + "disk": {"adds": {"disk_bytes": 10737418240}, "max_quantity": 20}, |
| + "storage": {"adds": {"storage_bytes": 53687091200}, "max_quantity": 20}, |
| + "email": {"adds": {"email_per_day": 1000}, "max_quantity": 20}, |
| + "bandwidth": {"adds": {"bandwidth_bytes_month": 53687091200}, "max_quantity": 20}, |
| + "media": {"adds": {"media_minutes_month": 1000}, "max_quantity": 20} |
| + }, |
| + "ceilings": { |
| + "running_things": 200, |
| + "email_per_day": 10000, |
| + "idle_seconds": 900 |
| + } |
| +} |
diff --git a/deploy/billing/pricebook-2026-11-26-v1.json b/deploy/billing/pricebook-2026-11-26-v1.json| new file mode 100644 |
| index 000000000..b3b491e9c |
| --- /dev/null |
| +++ b/deploy/billing/pricebook-2026-11-26-v1.json |
| @@ -0,0 +1,24 @@ |
| +{ |
| + "version": "2026-11-26-v1", |
| + "status": "approved", |
| + "catalog_version": "2026-11-26-v1", |
| + "default_currency": "usd", |
| + "currencies": ["usd", "eur", "gbp"], |
| + "country_currency": { |
| + "eur": ["AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE"], |
| + "gbp": ["GB"] |
| + }, |
| + "plans": { |
| + "personal": {"usd": 2800, "eur": 2400, "gbp": 2200}, |
| + "community": {"usd": 6000, "eur": 5000, "gbp": 4500}, |
| + "business": {"usd": 60000, "eur": 50000, "gbp": 45000} |
| + }, |
| + "packs": { |
| + "apps": {"usd": 1200, "eur": 1000, "gbp": 900}, |
| + "disk": {"usd": 3600, "eur": 3100, "gbp": 2800}, |
| + "storage": {"usd": 1200, "eur": 1000, "gbp": 900}, |
| + "email": {"usd": 2400, "eur": 2100, "gbp": 1900}, |
| + "bandwidth": {"usd": 4800, "eur": 4100, "gbp": 3800}, |
| + "media": {"usd": 1200, "eur": 1000, "gbp": 900} |
| + } |
| +} |
diff --git a/internal/plans/repo_catalog_test.go b/internal/plans/repo_catalog_test.go| index e737c5ace..1dca87651 100644 |
| --- a/internal/plans/repo_catalog_test.go |
| +++ b/internal/plans/repo_catalog_test.go |
| @@ -1,9 +1,12 @@ |
| package plans |
| import ( |
| + "encoding/json" |
| "os" |
| "path/filepath" |
| + "reflect" |
| "regexp" |
| + "slices" |
| "strings" |
| "testing" |
| "time" |
| @@ -103,6 +106,70 @@ func TestDraftCatalogChangesFreeOnly(t *testing.T) { |
| } |
| } |
| +// Catalog 2026-11-26-v1 (Paul, 2026-11-26) is 2026-11-15-v1, the flagship's |
| +// installed catalog, with media conversion priced in: each plan's monthly |
| +// media minutes, a media pack that adds 1,000, and that pack offered on the |
| +// three paid plans. Everything else, the version aside, is byte-for-byte |
| +// the same once those are taken out of both. |
| +func TestMediaCatalogAddsMediaOnly(t *testing.T) { |
| + read := func(name string) map[string]any { |
| + t.Helper() |
| + b, err := os.ReadFile(filepath.Join(repoBilling, name)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var m map[string]any |
| + if err := json.Unmarshal(b, &m); err != nil { |
| + t.Fatal(err) |
| + } |
| + return m |
| + } |
| + was, now := read("catalog-2026-11-15-v1.json"), read("catalog-2026-11-26-v1.json") |
| + if now["version"] != "2026-11-26-v1" { |
| + t.Errorf("version %v", now["version"]) |
| + } |
| + delete(was, "version") |
| + delete(now, "version") |
| + nowPacks := now["packs"].(map[string]any) |
| + if got, want := nowPacks["media"], any(map[string]any{"adds": map[string]any{"media_minutes_month": 1000.0}, "max_quantity": 20.0}); !reflect.DeepEqual(got, want) { |
| + t.Errorf("media pack %v, want %v", got, want) |
| + } |
| + delete(nowPacks, "media") |
| + wasPlans, nowPlans := was["plans"].(map[string]any), now["plans"].(map[string]any) |
| + for name, minutes := range map[string]float64{"free": 30, "personal": 600, "community": 1200, "business": 12000} { |
| + p := nowPlans[name].(map[string]any) |
| + limits := p["limits"].(map[string]any) |
| + if limits["media_minutes_month"] != minutes { |
| + t.Errorf("%s media_minutes_month %v, want %v", name, limits["media_minutes_month"], minutes) |
| + } |
| + delete(limits, "media_minutes_month") |
| + if name == "free" { |
| + continue |
| + } |
| + packs := p["packs"].([]any) |
| + wasPacks := wasPlans[name].(map[string]any)["packs"].([]any) |
| + if !reflect.DeepEqual(packs, append(slices.Clone(wasPacks), "media")) { |
| + t.Errorf("%s packs %v, want %v and media", name, packs, wasPacks) |
| + } |
| + p["packs"] = wasPacks |
| + } |
| + if !reflect.DeepEqual(was, now) { |
| + t.Errorf("2026-11-26-v1 changed more than media:\n was %v\n now %v", was, now) |
| + } |
| + |
| + // And it loads, so a paid plan's media packs raise its allowance. |
| + c, err := LoadCatalog(filepath.Join(repoBilling, "catalog-2026-11-26-v1.json")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if l, err := c.Effective("personal", map[string]int{"media": 2}, nil); err != nil || l.MediaMinutesMonth != 2600 { |
| + t.Errorf("personal with two media packs: %d media minutes, %v; want 2600", l.MediaMinutesMonth, err) |
| + } |
| + if _, err := c.Effective("free", map[string]int{"media": 1}, nil); err == nil { |
| + t.Error("free took a media pack") |
| + } |
| +} |
| + |
| func TestKeptStorageRefuses(t *testing.T) { |
| base, err := os.ReadFile(filepath.Join(repoBilling, "catalog-2026-11-15-v1.json")) |
| if err != nil { |
diff --git a/scripts/stripe-setup.sh b/scripts/stripe-setup.sh| index 75411c33f..0c3a518e0 100755 |
| --- a/scripts/stripe-setup.sh |
| +++ b/scripts/stripe-setup.sh |
| @@ -40,7 +40,7 @@ |
| # be using. It is the second confirmation of a live run. |
| # Without --live it must be unset. |
| # PRICE_BOOK the book file. Default |
| -# deploy/billing/pricebook-2026-11-15-v2.json. |
| +# deploy/billing/pricebook-2026-11-26-v1.json. |
| # PRICE_BOOK_PATH where the console box keeps the book, for the |
| # printed CARLOS_PRICE_BOOK. Default |
| # /etc/carlos/<book file name>. |
| @@ -168,7 +168,7 @@ else |
| [[ "$account" =~ ^acct_[A-Za-z0-9]+$ ]] || die "STRIPE_ACCOUNT must look like acct_..." |
| fi |
| -book_file="${PRICE_BOOK:-$here/../deploy/billing/pricebook-2026-11-15-v2.json}" |
| +book_file="${PRICE_BOOK:-$here/../deploy/billing/pricebook-2026-11-26-v1.json}" |
| [[ -r "$book_file" ]] || die "PRICE_BOOK $book_file cannot be read" |
| book_path="${PRICE_BOOK_PATH:-/etc/carlos/$(basename "$book_file")}" |
| catalog_path="${PLAN_CATALOG_PATH:-/etc/carlos/plans.json}" |