Skip to content

Validate: reject invalid IBAN before submit - #1585

Merged
Baskarayelu merged 3 commits into
Remitwise-Org:mainfrom
1nonlypiece:validate/1472-iban-validation
Jul 30, 2026
Merged

Validate: reject invalid IBAN before submit#1585
Baskarayelu merged 3 commits into
Remitwise-Org:mainfrom
1nonlypiece:validate/1472-iban-validation

Conversation

@1nonlypiece

Copy link
Copy Markdown
Contributor

Summary

No IBAN field existed anywhere in the app. Adds isValidIban() (lib/validation/iban.ts), a dependency-free ISO 13616 MOD-97-10 checksum validator (verified against well-known real IBAN test vectors from GB/DE/FR), and a new "Linked payout bank account" field in WalletSection (the natural home for anchor-withdrawal-adjacent settings) using the same reject-and-show-inline-error pattern as #1584's phone validation: an invalid IBAN shows a role="alert" error and skips triggerSave(); empty is treated as valid since the field is optional.

Also adds the settings.wallet.payout_iban_invalid translation key to en.json/es.json, same scoped approach as #1584 -- not backfilling the rest of the pre-existing missing settings.* tree.

Testing

  • node node_modules/vitest/vitest.mjs run ... tests/unit/validation/iban.test.ts tests/unit/settings/WalletSection.test.tsx -- 9/9 pass (valid IBANs from 3 countries with/without spacing, case-insensitivity, empty-is-valid, bad checksum, structurally invalid, too-short, plus the component showing/clearing the error)
  • npm run test:unit:vitest -- 306 passing (was 297 on main), zero regressions
  • npx eslint on all touched files -- clean
  • npx tsc --noEmit -- no new errors in any touched file

Closes #1472

@Baskarayelu
Baskarayelu merged commit 42ef937 into Remitwise-Org:main Jul 30, 2026
7 of 12 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.

Validate: reject invalid IBAN before submit

2 participants