PhoenixKit.Modules.Billing.IbanData (phoenix_kit v1.7.33)

Copy Markdown View Source

IBAN specifications by country.

Provides IBAN length and SEPA membership data for banking validation. Data sourced from IBAN.com/structure.

Examples

iex> IbanData.get_iban_length("EE")
20

iex> IbanData.sepa_member?("EE")
true

iex> IbanData.country_uses_iban?("US")
false

Summary

Functions

Get all IBAN specifications.

Check if a country uses IBAN.

Get IBAN length for a country.

Check if a country is a SEPA member.

Functions

all_specs()

Get all IBAN specifications.

Returns a map of country codes to their IBAN specifications.

country_uses_iban?(country_code)

Check if a country uses IBAN.

Examples

iex> IbanData.country_uses_iban?("EE")
true

iex> IbanData.country_uses_iban?("US")
false

get_iban_length(country_code)

Get IBAN length for a country.

Returns the expected IBAN length for the country code, or nil if the country does not use IBAN.

Examples

iex> IbanData.get_iban_length("EE")
20

iex> IbanData.get_iban_length("DE")
22

iex> IbanData.get_iban_length("US")
nil

sepa_member?(country_code)

Check if a country is a SEPA member.

Examples

iex> IbanData.sepa_member?("EE")
true

iex> IbanData.sepa_member?("TR")
false

iex> IbanData.sepa_member?("US")
false