Skip to content

Ask Pix or USDC before starting a Stocks checkout - #1464

Merged
ebma merged 3 commits into
stagingfrom
fix/stocks-usdc-method-choice
Nov 16, 2026
Merged

ebma merged 3 commits into
stagingfrom
fix/stocks-usdc-method-choice

Conversation

@ebma

@ebma ebma commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

In the Brazil Stocks app, a signed-in user's Comprar and Vender opened the Pix flow whenever Pix was open. USDC on Base appeared only as a small secondary option inside it, so a tester who wanted to pay with USDC continued on Pix and reached the Pix identity check, which a Base USDC order does not use.

  • Buy and sell now open on an explicit choice, "Como deseja pagar?" / "Como deseja receber?", with Pix · Brasil and USDC · Base, matching Gold's payment picker. USDC opens the existing USDC checkout before any Pix step; Pix continues to the amount step, which has a "Voltar" back to the choice. Screen readers hear the sell choice as "Forma de recebimento".
  • The step appears only while USDC checkout is on and, in a live build, only for a direction that the backend's USDC listing opens for that token. The backend opens USDC buys and sells separately, so a seller is not offered USDC while only USDC buys are open. If the listing cannot be read, the flow offers Pix only. The app reads the listing once per page load, and the USDC checkout still checks it again before every quote. Demo and preview builds keep their simulated USDC, which is always offered.
  • The step is skipped when the user already chose Pix in the price preview, for a resumed operation, and for the buy-quote and sell-reserve-used demo links. With USDC off (production today), the flows are unchanged.
  • The inline USDC tile in the buy amount step ("English checkout") and the "Receber USDC na Base em vez de Pix" button in the sell amount step are removed; the new step replaces them.
  • apps/stocks/CLAUDE.md notes the step and the direction check (usdcOpen in detail-actions.js).

Validation: 420 Stocks tests pass, including five new tests and one updated test. The tests for the choice itself fail on the current staging code. They cover:

  • buy and sell starting on the choice, with "Voltar" back to it from the amount;
  • USDC leaving before any Pix step, and Pix still reaching its identity check;
  • the stock page's "Comprar" asking for the method first;
  • USDC offered only in a direction the listing opens;
  • resumed operations and the two demo links skipping the choice.

bun lint and bun build:stocks pass. In a local demo build, the buy (Pix, back, USDC) and the sell were checked in the browser on desktop and at 375 px, with no console errors, and the sell choice's label was confirmed. scripts/verify-usdc-ui.mjs targets the same labels but was not run.

With both methods open, a signed-in user's Comprar and Vender opened the Pix flow, which offered USDC only as a small secondary option. A USDC tester continued on Pix and ended up in the Pix identity check, which a Base USDC order does not need. Both flows now start on an explicit Pix-or-USDC choice, as Gold's picker does, unless the user already chose Pix in the preview or is resuming an operation.
@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 661c22b
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6afb585f07a41254fb5e6128
😎 Deploy Preview https://deploy-preview-1464--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 661c22b
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6afb585f2213404c8aec04e1
😎 Deploy Preview https://deploy-preview-1464--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vrtx-dashboard canceled.

Name Link
🔨 Latest commit 661c22b
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6afb585fd9d2ad8a82294161

ebma added 2 commits November 16, 2026 20:24
…open

The backend opens each Base USDC direction apart from Pix, but the Pix
flows offered USDC whenever the checkout flag was on. With only USDC buys
open, a seller could pick USDC and only learn after entering an amount
that the route was unavailable.

App now reads the live USDC listing once per runtime and passes the USDC
handler to the buy or sell flow only when that direction is listed for
the token (usdcOpen). An unread or failed listing offers Pix only; the
simulated checkout stays open. LiveUsdcFlow still re-checks before every
quote.
…p paths

The sell method step announced its group as "Forma de pagamento" under
the heading "Como deseja receber?"; it is now "Forma de recebimento".

Tests now cover going back from the sell amount to the choice, and that a
resumed Pix operation and the buy-quote and sell-reserve-used demo links
skip it. The stock-page regression test asserts that "Comprar" became
enabled before clicking it, so a pending operation left by another test
fails with a clear message.
@ebma
ebma merged commit cc79d82 into staging Nov 16, 2026
6 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.

1 participant