Skip to content

Use the 22-character IBAN length for Costa Rica - #1894

Open
egbavou wants to merge 1 commit into
Respect:mainfrom
egbavou:iban-costa-rica-length
Open

egbavou wants to merge 1 commit into
Respect:mainfrom
egbavou:iban-costa-rica-length

Conversation

@egbavou

@egbavou egbavou commented Nov 14, 2026

Copy link
Copy Markdown

Fixes #1893.

COUNTRIES_LENGTHS had 21 for Costa Rica. The SWIFT IBAN registry structure went from CR2!n3!n14!n (21 characters, version 60) to CR2!n4!n14!n (22 characters, version 69), and Symfony's table, generated from the current registry, also has 22. The Banco Central de Costa Rica gives the same length.

Iban rejected every 22-character Costa Rican IBAN and accepted 21-character ones whose checksum was right. After this change, those 21-character values are rejected.

Tests

  • Valid: CR05 0152 0200 1026 2840 66, the example in version 69 of the registry.
  • Invalid: CR05 1520 2001 0262 8406 6, the example in version 60. Its checksum is right, so only the length check rejects it.

Both cases fail on main and pass with this change. composer qa passes.

This line sits between two lines that #1892 adds, so whichever of the two PRs is merged second will need a rebase. I'll do it.

The SWIFT IBAN registry gives Costa Rica 22 characters
(CR2!n4!n14!n); its version 60 had 21. Iban still expected 21, so it
rejected every 22-character Costa Rican IBAN and accepted 21-character
ones with a valid checksum.
@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.18%. Comparing base (ecccef1) to head (a782877).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1894   +/-   ##
=========================================
  Coverage     97.18%   97.18%           
  Complexity     1096     1096           
=========================================
  Files           198      198           
  Lines          2555     2555           
=========================================
  Hits           2483     2483           
  Misses           72       72           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

Iban expects 21 characters for Costa Rica instead of 22

1 participant