Skip to content

fix: block Stripe auto-fallback for non-US users#2529

Merged
Larkooo merged 1 commit intomainfrom
lattice/1774958425
Mar 31, 2026
Merged

fix: block Stripe auto-fallback for non-US users#2529
Larkooo merged 1 commit intomainfrom
lattice/1774958425

Conversation

@Larkooo
Copy link
Copy Markdown
Contributor

@Larkooo Larkooo commented Mar 31, 2026

Summary

  • The token fallback hook (useTokenFallback) auto-selects Stripe when no crypto token has sufficient balance — this was bypassing the US-only fiat gate from fix: gate KYC verification to US users only #2528
  • Pass a no-op callback instead of onStripeSelect for non-US users so fiat checkout is never auto-selected outside the US

Test plan

  • Non-US user with insufficient crypto balance should NOT auto-switch to credit card
  • US user with insufficient crypto balance should still auto-fallback to Stripe

🪟 Made with Lattice

The token fallback hook auto-selects Stripe when no crypto token has
sufficient balance. Pass a no-op instead of onStripeSelect for non-US
users so fiat checkout is never auto-selected outside the US.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
controller-example-next Ready Ready Preview Mar 31, 2026 1:57pm
keychain Ready Ready Preview Mar 31, 2026 1:57pm
keychain-storybook Ready Ready Preview Mar 31, 2026 1:57pm

Request Review

@Larkooo Larkooo merged commit fc33961 into main Mar 31, 2026
12 checks passed
@Larkooo Larkooo deleted the lattice/1774958425 branch March 31, 2026 14:08
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 31, 2026

Claude finished @Larkooo's task —— View job


Documentation analysis complete

Task: Review merged PR #2529 and determine if docs updates are needed.

Todo List

  • Verify docs repository structure
  • Analyze if change requires documentation updates
  • Final decision

Analysis

This PR fixes a bug where the token fallback hook was auto-selecting Stripe for non-US users when crypto balance was insufficient, bypassing the US-only fiat restriction from PR #2528.

The fix: Pass a no-op callback instead of onStripeSelect for non-US users (line 186 in the changed file):

onStripeSelect: isUS ? onStripeSelect : () => {},

Decision: No documentation updates needed

Rationale:

  1. This is a bug fix, not a feature change — The US-only fiat restriction was already the intended behavior. This PR simply fixes unintended auto-fallback logic that was bypassing that restriction.

  2. Existing documentation already reflects correct behavior — The docs at docs-repo/src/pages/controller/starter-packs.md:237 already states:

    Identity Verification (US users only): First-time US-based Stripe users must verify their identity... User location is determined via IP geolocation.

  3. No user-facing API or behavior change — From a user's perspective:

    • US users: No change in behavior (still auto-fallback to Stripe when needed)
    • Non-US users: This fixes broken behavior where they were incorrectly being auto-switched to Stripe despite geo-restrictions
  4. Internal implementation detail — The useTokenFallback hook behavior is an internal implementation detail, not a documented API surface.

Per the documentation update rules: "DEFAULT TO NO CHANGES. Most code PRs do not need docs updates. Internal refactors, test changes, CI changes, and dependency bumps need nothing."

This qualifies as an internal bug fix that restores intended behavior already documented.


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