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

Belgium BBAN check fix #136

Merged
merged 2 commits into from
Feb 28, 2023
Merged

Conversation

mhemeryck
Copy link
Contributor

The Belgian BBAN check has an issue when the checksum digits are exactly "97". This is because the BBAN calculation is done using the "account number" mod 97; normally, this would result in a checksum digit of "00", but the standard in that case uses "97" instead.

Updated the checksum calculation to handle this case, plus updated the related unit test.

Relevant links:

All Belgian financial institutions apply the same modulus-based validation method.
The check digits are calculated by dividing the first 10 digits by 97. If the
remainder is 00, then the check digits are 97. Otherwise the check digits are the
remainders.

@mhemeryck
Copy link
Contributor Author

@mdomke this was an issue we did notice ourselves. Thanks for having a look!

@mhemeryck mhemeryck force-pushed the be_bban_checksum_edge_case branch from 7489d64 to fa1aa97 Compare February 27, 2023 16:19
@mhemeryck
Copy link
Contributor Author

Relates to #51

The Belgian BBAN check has an issue when the checksum digits are exactly
"97". This is because the BBAN calculation is done using the "account
number" mod 97; normally, this would result in a checksum digit of "00",
but the standard in that case uses "97" instead.

Updated the checksum calculation to handle this case, plus updated the
related unit test.
Indicate in docs that Belgian BBAN is also checked.
@mhemeryck mhemeryck force-pushed the be_bban_checksum_edge_case branch from fa1aa97 to 90f7718 Compare February 27, 2023 16:25
@mdomke
Copy link
Owner

mdomke commented Feb 28, 2023

Thank you very much!

@mdomke mdomke merged commit 568a828 into mdomke:master Feb 28, 2023
mdomke added a commit to Krystofee/schwifty that referenced this pull request Sep 22, 2023
* master: (42 commits)
  Add missing banks (mdomke#145)
  chore(python): add Python 3.12 in test matrix (mdomke#149)
  Update all available bank registries
  Fetch the new bank registry for Germany
  Set bic to "" to avoid TypeError for Ukrainian banks
  chore: Update GitHub workflow actions
  chore: Update build badge URL
  Add changelog for 2023.03.0 release
  Update bank registry for Ukraine
  Update bank registry for Slovenia
  Update bank registry for Netherlands
  Update bank registry for Poland
  Update bank registry for Germany
  Update bank registry for Hungary
  Update bank registry for Belgium
  Update bank registry for Austria
  Add norwegian bank registry (mdomke#137)
  chore: Update generated bank registries
  chore(bank_registry): added new banks for IT, fixed codes for CY, PT (mdomke#134)
  Belgium BBAN check fix (mdomke#136)
  ...
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.

2 participants