Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

Restrict wallet and payment APIs to approved B2B users - #40

Merged
leoxk merged 4 commits into
mainfrom
agent/b2b-stripe-only-wallet
Jul 20, 2026
Merged

Restrict wallet and payment APIs to approved B2B users#40
leoxk merged 4 commits into
mainfrom
agent/b2b-stripe-only-wallet

Conversation

@leoxk

@leoxk leoxk commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What changed

  • gate all wallet, redemption, and payment-session APIs on the user's current database group being b2b
  • hide Wallet from non-B2B navigation and redirect direct /wallet access to 403
  • update the Stripe minimum top-up acceptance test from US$20 to US$10

Why

The Wallet sidebar is a global display setting and is not an authorization boundary. Non-approved default users could still navigate directly to the wallet APIs and create payment sessions. The production B2B pilot must remain approval-only before live payment testing.

Safety

  • the group is read from the database on every protected request, so downgrades take effect without waiting for session refresh
  • Stripe webhooks remain public and signature-verified; only authenticated customer wallet routes are gated
  • no pricing ratios, balances, existing users, channels, or payment credentials are changed

Validation

  • default frontend typecheck passed
  • default frontend production build passed
  • git diff --check
  • Go middleware and controller tests will run in CI (the local host does not have the Go toolchain)

@leoxk
leoxk marked this pull request as ready for review July 20, 2026 08:00
@leoxk
leoxk merged commit c7098a2 into main Jul 20, 2026
4 checks passed
@leoxk
leoxk deleted the agent/b2b-stripe-only-wallet branch July 20, 2026 08:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant