Skip to content

✨ app: scan pix qr codes - #1283

Closed
nfmelendez wants to merge 2 commits into
mainfrom
nicolas
Closed

✨ app: scan pix qr codes#1283
nfmelendez wants to merge 2 commits into
mainfrom
nicolas

Conversation

@nfmelendez

@nfmelendez nfmelendez commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Scan PIX QR/BR Codes when adding recipients, with automatic payment-detail and amount prefilling.
    • View PIX key details, BR Code information, and one-time-charge warnings.
    • Scan recipient addresses using an improved QR scanner with clearer error handling.
    • Support separate PIX onramp and offramp availability.
    • Display instant delivery for eligible BRL transfers.
  • Bug Fixes
    • Improved validation and handling of PIX keys, CPF/CNPJ numbers, and scanned codes.
  • Localization
    • Added and updated Portuguese and Spanish translations for PIX and QR-code flows.

@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9138bd0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@exactly/server Patch
@exactly/mobile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 9f3e4934-b13d-4661-b14e-437101001b04

📥 Commits

Reviewing files that changed from the base of the PR and between a0c54d5 and 9138bd0.

📒 Files selected for processing (15)
  • .changeset/brave-otters-shake.md
  • .changeset/silver-falcons-stick.md
  • cspell.json
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts
  • src/components/send-funds/NewRecipient.tsx
  • src/components/send-funds/QR.tsx
  • src/components/send-funds/Recipients.tsx
  • src/components/send-funds/Scanner.tsx
  • src/components/send-funds/SendAmount.tsx
  • src/components/send-funds/recipientForm.tsx
  • src/i18n/es-AR.json
  • src/i18n/es.json
  • src/i18n/pt.json
  • src/utils/pix.ts

Walkthrough

The server now supports separate pix_offramp and pix_onramp endorsements. The mobile send-funds flow adds shared QR scanning, BR Code parsing, PIX validation, recipient autofill, and static-code amount forwarding. Translations and release changesets support the new behavior.

Changes

Directional PIX endorsement handling

Layer / File(s) Summary
Directional currency contracts and bridge decisions
server/utils/ramps/bridge.ts
PIX endorsements now map to direction-specific currencies. Provider, onboarding, deposit, and external-account checks use the requested ramp. Unknown endorsements are filtered and reported.
Directional bridge validation
server/test/utils/bridge.test.ts
Tests cover directional provider currencies, onboarding endorsements, deposit availability, external-account creation, and unknown endorsement handling.
Server release metadata
.changeset/brave-otters-shake.md
Adds a patch changeset for @exactly/server.

PIX QR and BR Code recipient flow

Layer / File(s) Summary
PIX parsing and validation
src/utils/pix.ts, src/components/send-funds/recipientForm.tsx, cspell.json
Adds BR Code parsing, PIX-key detection, PIX account validation, and CPF/CNPJ validation. Removes the previous digits-only document validator.
Shared scanner and entry points
src/components/send-funds/Scanner.tsx, src/components/send-funds/Recipients.tsx, src/components/send-funds/QR.tsx
Adds permission handling, camera activation, scan de-duplication, camera controls, and BRL navigation into the shared scanner.
Recipient form integration
src/components/send-funds/NewRecipient.tsx
The form autofills parsed BR Code data, supports PIX keys and BR Codes in one field, displays key details, validates documents, and forwards static-code amounts.
Amount handling and translations
src/components/send-funds/SendAmount.tsx, src/i18n/es-AR.json, src/i18n/es.json, src/i18n/pt.json
The amount form accepts scanned amounts and shows the BRL instant-delivery label. Spanish and Portuguese translations cover scanner, PIX, BR Code, and validation messages.
Mobile release metadata
.changeset/silver-falcons-stick.md
Adds a patch changeset for @exactly/mobile.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🟡 Moderate · up to a0c54

This PR changes workspace dependency resolution and suppresses a high-severity denial-of-service advisory affecting the mobile dependency graph. The pinned versions reduce the immediate concern, but an independent audit suppression could hide a vulnerable version if the override is later reverted or drifts, so merge requires explicit owner acceptance or tighter coupling between the exception and remediation.

Sequence Diagram(s)

sequenceDiagram
  participant Recipient
  participant Recipients
  participant Scanner
  participant NewRecipient
  participant PIXParser
  participant SendAmount
  Recipient->>Recipients: Select BRL QR scanning
  Recipients->>Scanner: Open scanner
  Scanner->>NewRecipient: Return scanned payload
  NewRecipient->>PIXParser: Parse BR Code
  PIXParser-->>NewRecipient: Return recipient data and optional amount
  NewRecipient->>SendAmount: Navigate with recipient and amount
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the dependency upgrade and names the main affected packages. It matches the pull request objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nicolas
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch nicolas

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: d3f82996-86b2-4a3a-8287-91fb7f227e66

📥 Commits

Reviewing files that changed from the base of the PR and between f76c1f1 and a0c54d5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • pnpm-workspace.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread pnpm-workspace.yaml
- GHSA-mh99-v99m-4gvg
- GHSA-r28c-9q8g-f849
- GHSA-rgw5-rvv9-x895
- GHSA-vcc3-ghjq-m6fr # cspell:ignore ghjq

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
rg -n -C 4 'decode-uri-component' pnpm-lock.yaml
pnpm why decode-uri-component

Repository: exactly/exa

Length of output: 7501


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- repository review conventions ---'
find /tmp/coderabbit-repo-knowledge/exactly-exa-f26ca19b -type f -name '*.md' -maxdepth 3 -print
printf '%s\n' '--- workspace configuration ---'
cat -n pnpm-workspace.yaml | sed -n '1,35p'
printf '%s\n' '--- declared package-manager and CI references ---'
rg -n -C 2 '"packageManager"|"pnpm|corepack' package.json .github 2>/dev/null | head -120

Repository: exactly/exa

Length of output: 9836


Denial of Service (CWE-400): Uncontrolled Resource Consumption

Update the dependency or document the exception.

pnpm-lock.yaml resolves vulnerable decode-uri-component@0.2.2 through query-string@7.1.3 in the mobile/Expo dependency tree. Upgrade to 0.5.0 or later, or document why this path cannot process attacker-controlled input before suppressing GHSA-vcc3-ghjq-m6fr.

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.04%. Comparing base (f76c1f1) to head (a0c54d5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1283      +/-   ##
==========================================
+ Coverage   72.51%   73.04%   +0.53%     
==========================================
  Files         275      276       +1     
  Lines       13254    13257       +3     
  Branches     4610     4613       +3     
==========================================
+ Hits         9611     9684      +73     
+ Misses       3306     3236      -70     
  Partials      337      337              
Flag Coverage Δ
e2e 73.04% <ø> (+0.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nfmelendez nfmelendez changed the title ⬆️ dependencies: upgrade browserslist, nanoid and postcss-selector-pa… ✨ app: scan pix qr codes Sep 3, 2026
@nfmelendez

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9138bd0051

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +287 to +288
const input = code ? (
<BRCodeField value={value} name={code.ownerName} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep valid BR codes editable

When a user pastes or scans any syntactically valid BR Code, this branch replaces the editable FieldInput with BRCodeField, which only reveals or hides the value and provides no edit or clear action. If the user scanned the wrong code or needs to correct it, they cannot do so within the form and must abandon the recipient flow and start over; retain an editable control or provide a way to clear/rescan the code.

Useful? React with 👍 / 👎.

Comment on lines +283 to +284
if (field.kind === "option" || field.path === "account_pixKey") form.resetField("reference");
if (field.path === "account_pixKey") setAmount(undefined);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Carry fixed amounts from pasted BR codes

When the user pastes a static BR Code containing a fixed amount, this text-change path clears amount and never replaces it with the parsed code's value; setAmount(code.value...) is only called by the camera callback. The pasted code is still accepted and saved, but the amount screen opens blank and allows a value different from the charge encoded in the QR, so parse next here and preserve its fixed amount just as the scanner path does.

Useful? React with 👍 / 👎.

</Text>
);
}
if (code.type !== "dynamic" || !code.oneTime) return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Warn for one-time static BR codes

Static BR Codes can also carry the one-time point-of-initiation method, but parseBRCode only exposes oneTime for dynamic codes and this condition therefore suppresses the warning for every static code. A scanned single-use static charge is converted into a saved PIX-key contact and appears reusable even though its transaction ID may stop working after the first payment; propagate the initiation method for static codes and show the same warning.

Useful? React with 👍 / 👎.

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.

3 participants