skwasjer / IbanNet

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

Possible support for swedish Branch ID #140

Closed WilliamWirsen closed 4 months ago

WilliamWirsen commented 1 year ago

Hello! Are there any plans for adding support for Swedish branch id when using the IbanBuilder?

Here's some related documentation on the clearing number, that might help (unfortunately in Swedish): bankernaskontonummeruppbyggnad_anvandarmanual_sv.pdf

Best regards, William

NiKiZe commented 1 year ago

Data related to this https://github.com/Bankinfrastruktur/BankData (The pdf you provided is actually dual language) Another resource for IBAN is at (this one Swedish only) https://www.bankinfrastruktur.se/framtidens-betalningsinfrastruktur/iban-och-svenskt-nationellt-kontonummer

Keeping track of all possible national BBAN validation is probably out of scope of a IBAN validation library.

Also, you might not want to limit any input to "known banks" since there is infrequent changes to that list.

skwasjer commented 1 year ago

Haha thanks @NiKiZe, beat me again. It is a similar discussion idd as #139

What we can do is consider these use cases and come up with an abstraction, but the actual implementations would have to live elsewhere (for example here https://github.com/skwasjer/IbanNet.Extensions.Bban).

eg. the BbanBuilder could accept an ICheckDigitCalculator and for example a custom factory method to 'extract' anything not part of the registry (in this case the clearing number).

I could help facilitate this, but the community would have to supply concrete implementations per country and/or bank.

NiKiZe commented 1 year ago

@WilliamWirsen any chance you can expand on what you had in mind here?

Several of the clearing numbers is not relevant in IBAN at all. examples being clearing 3300 and 6000-6999, you also need "ibanid" which is not always same as clearing.

So what I think you are looking for is a Swedish BBAN generator. But I would like to get that confirmed with an example