Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong IBAN formatting for Costa Rica #643

Closed
MrGussio opened this issue Mar 21, 2022 · 0 comments · Fixed by #646
Closed

Wrong IBAN formatting for Costa Rica #643

MrGussio opened this issue Mar 21, 2022 · 0 comments · Fixed by #646
Assignees
Labels
c: bug Something isn't working good first issue Good for newcomers p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug

Comments

@MrGussio
Copy link
Contributor

Describe the bug

@halvorv and I discovered an error in the generation of Costa Rican IBAN codes. According to multiple sources we have found online (here and here for example), a Costa Rican IBAN code should consist of in total 22 characters, following the structure like this:
CR99 0000 0000 0000 8888 88

  • first two characters are CR
  • two digit checksum
  • one reserved character
  • three digit bank code
  • fourteen digit account number

This totals up to 22 characters in total. However, in Faker, it is currently defined like this:

{
      country: 'CR',
      total: 21,
      bban: [
        {
          type: 'n',
          count: 3,
        },
        {
          type: 'n',
          count: 14,
        },
      ],
      format: 'CRkk bbbc cccc cccc cccc c',
    },

According to this source, we can include that one reserved character within the bank code.

Hence, the first object in the bban array should be defined with a count of 4 instead of 3, the total should become 22 and the formatting should become CRkk bbbb cccc cccc cccc cc

Reproduction

Generate an IBAN number for Costa Rica and it will generate an invalid one:

faker.finance.iban(false, 'CR')

Additional Info

No response

@MrGussio MrGussio added the s: pending triage Pending Triage label Mar 21, 2022
MrGussio added a commit to MrGussio/faker that referenced this issue Mar 21, 2022
@ST-DDT ST-DDT added c: bug Something isn't working good first issue Good for newcomers p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug and removed s: pending triage Pending Triage labels Mar 21, 2022
@ST-DDT ST-DDT added this to the v6.1 - First bugfixes milestone Mar 21, 2022
@ST-DDT ST-DDT moved this to Awaiting Review in Faker Roadmap Mar 21, 2022
Repository owner moved this from Awaiting Review to Done in Faker Roadmap Mar 23, 2022
@ST-DDT ST-DDT removed this from Faker Roadmap Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working good first issue Good for newcomers p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants