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

National bank code #5

Closed
mfirry opened this issue Jun 19, 2015 · 6 comments
Closed

National bank code #5

mfirry opened this issue Jun 19, 2015 · 6 comments

Comments

@mfirry
Copy link

mfirry commented Jun 19, 2015

Hi is there anyway to add a functionality to discover the National bank code?

@barend
Copy link
Owner

barend commented Jun 19, 2015

There's no support for that in the library at this time.

At face value, decoding the bank code should be fairly easy. However, doing so opens up the requirement for adding all the other country-specific features in the various IBANs. Most of these exist for a few countries but not for most others, where you'd have to return Optionals (which don't exist in the Android runtime) or nulls (which are awful for all kinds of reasons) or throw exceptions (equally awful) and it all becomes complicated and messy.

I'm intentionally keeping the IBAN class as simple as it now is.

I would accept a separate utility class with static methods that take an IBAN and extract the requested data.

@mfirry
Copy link
Author

mfirry commented Jul 3, 2015

Thanks a lot for your answer. I'm actually using java-iban inside my Scala projects so Options would be just great in my case. I'll try and find the time to develop that utility and let you know if I manage. Sounds like lots of different things to consider and many different cases. Thanks again

barend pushed a commit that referenced this issue Jul 4, 2015
I'm not completely sure about the class name `IBANExtras`, I find it a bit
clunky and may rename it before releasing a new version of this library.
@barend
Copy link
Owner

barend commented Jul 4, 2015

@mfirry I gave it a go and implemented the bank code / branch code extraction based on the SWIFT spec. I'm not entirely happy with the class naming, would love to hear if you have something better.

The reasoning is this:

  • Helps discoverability if it sits next to IBAN in an IDE's autocompletion window.
  • BankCodes or something along those lines implies there never will be something else queryable through that class.
  • Can't be Extras because that's already something in Android.

Basically, I'm now going to update my test code. If the autocompletion in the various IDE's puts IBANExtras before IBAN I'll ditch the name and come up with something else.

I'm also quite ambivalent to IBAN versus Iban. Both are problematic in different ways, but that's a breaking change, so I get to just leave it be and not worry about it :).

@barend
Copy link
Owner

barend commented Jul 4, 2015

@ikanters I know you're using this library – any thoughts on the above? Thanks :).

@ikanters
Copy link

ikanters commented Jul 4, 2015

@barend, I do use this library, but mainly for validation (so far). It would be nice to have simple access to the IBAN fields. Working with Optionals is perfect. My only suggestion would be to rename the IBANExtras to IBANFields, because Wikipedia uses that terminology.

@barend barend closed this as completed in c00069e Jul 5, 2015
@barend
Copy link
Owner

barend commented Jul 5, 2015

I had considered IBANUtils, but it's equally meh. IBANFields it is.

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

No branches or pull requests

3 participants