skwasjer / IbanNet

C# .NET IBAN validator, parser, builder and generator
Apache License 2.0
126 stars 31 forks source link

BBAN national check digit validation #7

Closed Greybird closed 4 years ago

Greybird commented 5 years ago

Hello,

Thanks for this library!

Can you tell me if you plan to integrate BBAN validation (for countries having a national validation key) into this library ? https://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country lists around 17 countries having a national key.

It would be great to have this additional layer of validation!

Arnaud

skwasjer commented 5 years ago

I have considered this because it would be a nice addition, and have done some initial research about 4 months ago. However, there are some concerns:

There are no concrete plans yet. But I don't mind leaving this issue open for a while to see if more people are interested.

Pieter-1337 commented 5 years ago

I would be interested in the package if BBAN was supported for instance some IBAN numbers like following "BG80BNBG96611020345678" are valid on iban.com, yet need BBAN validation. Currently I am using IBAN4NET as nuget package but that seems to have been abandoned...

skwasjer commented 5 years ago

@Pieter-1337 This package does actually verify BBAN structures for valid characters in the specific places (bank, branch, etc), provided the SWIFT registry has this info (which is what IbanNet relies on). What it does not verify is national check digits for specific countries, because it is not very easy to find info on national or sometimes even bank specific check digit algorithms - and I believe it was this what OP was asking for.

Can you tell me what in BG80BNBG96611020345678 is considered wrong then? I am interested to find out.

Pieter-1337 commented 5 years ago

@skwasjer I was bit to fast, you are correct it get's validated correctly, already implemented your package in my solution. But forgot to remove my comment ! Thx for the good package :)

skwasjer commented 5 years ago

@Greybird renaming to be more specific. If it does not fully cover your initial request, please let me know

Greybird commented 5 years ago

@Greybird renaming to be more specific. If it does not fully cover your initial request, please let me know It covers my initial request perfectly. I'm interested in the validation part, but far less with the structure of the BBAN. What is of interest for me is to be able to detect entry mistakes at the earliest.

skwasjer commented 4 years ago

@Greybird Over the next period, whenever I have some time I will probably work on just the abstraction part (excluding any BBAN specific logic), and perhaps start iterating on a new v4 version that f.ex. gets rid of the IbanValidationResult enum.

I also think it is wise to move the BBAN project to a dedicated repository, because it will be less stable/fully fleshed out at the start. This does allow it to be deployed to Nuget faster without the need for version bumps of the main packages. If you want I can make you a collaborator on that repo too then if you are interested, with direct repo access.

Greybird commented 4 years ago

I totally agree with the fact that the level of stability will not be the same on the two libs. Your proposal is a good way to go forward ; count me in !

skwasjer commented 4 years ago

Moved to separate repo (still WIP at time of writing): https://github.com/skwasjer/IbanNet.Extensions.Bban

I've also started iterating on extensibility feature in a different branch that this will have a dependency on.

skwasjer commented 4 years ago

Closing, see https://github.com/skwasjer/IbanNet.Extensions.Bban for status/progress