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

Function for returning the country code should validate #6

Open
railsmechanic opened this issue Jul 18, 2019 · 0 comments
Open

Function for returning the country code should validate #6

railsmechanic opened this issue Jul 18, 2019 · 0 comments
Assignees

Comments

@railsmechanic
Copy link
Owner

The function which returns the country code for a given IBAN should check whether the given country code of the IBAN is within the list of supported countries:

def country_code(iban) do
iban
|> format_default()
|> String.slice(0..1)
end

Change from returning a simple string to
{:ok, "DE"} or {:error, :invalid_country}

This is a breaking change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant