Open dbourguignon opened 5 years ago
Hi @dbourguignon - sorry for the slow reply.
I'm afraid I can't really tell you much either - I wrote this a long time ago, and haven't actively used it since.
My guess is the problem here is the account number being 7 digits long - I would usually expect it to be 8, although I do recall there being some exceptions. If the sort code was invalid, the code might not take the correct exception (an overloaded word here... 🙄), so we've ended up trying to multiply by the 8th account number (which is nil).
If you fancy putting together a PR that tests for this case, I believe the correct behaviour would be to prefix the account number with a 0 (but it may be that this is already correctly handled when the sort code is correct - I'm afraid I forget).
I don't think I'd be comfortable merging anything without also testing a valid 7 digit account number though - I believe these are typically Lloyds or TSB.
@ball-hayden thanks for answering … I'll see if I can get more time for digging into it then
Hi,
With last version, trying to validate:
UkAccountValidator::Validator.new("6833861", "779136").valid?
Give this error:
I looked a bit into it, but I don't know enough how this is suppose to work. I checked on https://www.sortcodes.co.uk/ and apparently this is an invalid code.
Any clue?