Skip to content

fix: send canonical offers for sponsored billing - #567

Merged
Maxerns merged 1 commit into
mainfrom
fix/sponsored-billing-offer-contract
Oct 12, 2026
Merged

Maxerns merged 1 commit into
mainfrom
fix/sponsored-billing-offer-contract

Conversation

@Maxerns

@Maxerns Maxerns commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Why

The sponsored seat form sent monthly to both billing quote and checkout endpoints. The server only accepts canonical catalogue offers, so the sponsored journey was rejected before checkout.

What Changed

  • Keep the form’s monthly term but send standard_monthly to quote and checkout.
  • Share the canonical BillingOffer type across personal and sponsored API calls, so display terms cannot be passed as server offers.
  • Add a panel test that checks both requests. It failed against the old code because the quote call used monthly, and passes with the canonical value.

This does not add founding-price selection or reserve founding places. That remains separate work requiring the shared personal and sponsored capacity ledger.

Validation

  • git diff --check passed.
  • npm run build:wasm and npm run typecheck passed.
  • TeamPanel.test.tsx: 27 tests passed.
  • The full web suite reported 149 passed and one failure in an unrelated recipient heading focus assertion; that file passed 10/10 when rerun alone.

Sponsored seat controls submitted monthly to endpoints that require canonical catalogue offers. Send the standard monthly offer to both quote and checkout, and share the typed offer contract with personal billing.

Pin both request values in the panel test so a display term cannot silently become an invalid API offer again.

Signed-off-by: Maxerns <maksafk@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues remain, and regression coverage verifies both requests.

0 open findings

What changed in this PR

Fixes sponsored billing by sending canonical catalogue offers to quote and checkout endpoints.

Changes:

  • Uses standard_monthly for sponsored billing requests.
  • Shares the BillingOffer type across billing APIs.
  • Adds regression tests for both requests.
File Description
web/​src/​TeamPanel.tsx Sends the canonical sponsored offer.
web/​src/​api.ts Defines and applies the shared BillingOffer type.
web/​src/​__tests__/​TeamPanel.test.tsx Verifies canonical offers reach both requests.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Maxerns
Maxerns merged commit d571cbc into main Oct 12, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants