fix(wallet): default Stripe checkout currency from UI language (pt→BRL, ja→JPY) — unblocks Pix - #327
Open
mguozhen wants to merge 1 commit into
Open
fix(wallet): default Stripe checkout currency from UI language (pt→BRL, ja→JPY) — unblocks Pix#327mguozhen wants to merge 1 commit into
mguozhen wants to merge 1 commit into
Conversation
…L, ja→JPY) #304 removed the language→currency mapping and stopped sending stripe_currency, but the backend requires it, which broke checkout; #306 hot-fixed by hard-defaulting USD. Result: pt/ja users always get a USD checkout. Stripe local payment methods are currency-gated (Pix requires BRL, Konbini requires JPY), so those users can never see local payment methods even once enabled in the Stripe dashboard. Restore the language-based default as a fallback only: an explicit ?currency= search param still wins, all other languages keep USD. Backend BRL/JPY price contracts already exist (expectedStripeTopUpAmountMinor). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题 / 背景
巴西/日本用户的 Stripe 收银台永远是 USD——而 Stripe 的本地支付方式是按结算货币门控的(Pix 只在 BRL 下出现、Konbini 只在 JPY 下出现)。这意味着即使在 Stripe Dashboard 开通 Pix,巴西用户也永远看不到它。这是 #292(收银台弃单救回)的前置缺口。
证据
/user/topup实拉(07-04)success 19 / pending 29 / expired 231(06-30 是 158,feat(wallet,pricing): top-up UI revamp + always-on promo + pricing tabs (#292) #304 上线后 3 天 +73),弃单 geo 集中在 SEA/IN/PT/AF 广告新兴市场根因(回归链)
getStripeCheckoutCurrencyForLanguage(原 pt→BRL / ja→JPY),前端不再发stripe_currencyresolveStripeTopUpCheckout把该字段设为必填 → checkout 全量报错DEFAULT_STRIPE_CHECKOUT_CURRENCY = 'USD'写死 → 充值恢复,但 pt/ja 用户从此永远 USD 收银台(唯一例外是手工带?currency=参数,而站内没有任何入口会带)改动 / 范围(纯前端,3 文件 +50/−5)
web/default/src/features/wallet/lib/stripe-currency.ts:恢复getStripeCheckoutCurrencyForLanguage(ja→JPY、pt→BRL、其他 undefined)web/default/src/features/wallet/index.tsx:checkoutCurrency = normalize(?currency=) ?? byLanguage(i18n.language)——显式参数仍然优先,其余语言行为不变(USD)expectedStripeTopUpAmountMinor:BRL 49.90/99.90/990、JPY 1500/3000/30000),Stripe Pricecurrency_options校验链完整影响 / 风险
currency_options(后端会校验,不匹配则报错拒单而不是错价)——上线前用 pt 语言真实走一笔确认验证
bun teststripe-currency + stripe-payment-request:7 passbunx tsc --noEmit:0 error部署建议(Rule 12)
关联 #292 #304 #306。cc @think-back
🤖 Generated with Claude Code