Get brand, card type and country by first digits of a bank card.
The package can be installed by adding bank_card_info
to your list of dependencies in mix.exs
:
def deps do
[{:bank_card_info, "~> 0.0.2"}]
end
BankCardInfo.get "45717360"
{:ok,
%{bank: %{city: "Hjørring", logo: "", name: "Jyske Bank", phone: "+4589893300",
url: "www.jyskebank.dk"}, brand: "Visa/Dankort",
country: %{alpha2: "DK", latitude: 56, longitude: 10, name: "Denmark",
numeric: "208"}, number: %{length: 16, prefix: "45717360"}, prepaid: false,
scheme: "VISA", type: "DEBIT"}}
BankCardInfo.get! "45717360"
%{bank: %{city: "Hjørring", logo: "", name: "Jyske Bank", phone: "+4589893300",
url: "www.jyskebank.dk"}, brand: "Visa/Dankort",
country: %{alpha2: "DK", latitude: 56, longitude: 10, name: "Denmark",
numeric: "208"}, number: %{length: 16, prefix: "45717360"}, prepaid: false,
scheme: "VISA", type: "DEBIT"}
Documentation can be generated with ExDoc and published on HexDocs. The docs can be found at https://hexdocs.pm/bank_card_info.