Better Error Reasons


Dropping Work in Progress

SimpleCardBrand version 0.3.0 changes the :error reason from a String.t to a tuple: {:atom, String.t}. This allows simple programmatic decision making based off the atom along with detailed error messages. Example:

{:error, {:pan_too_short,"Minimum PAN length is 12, found 10."}}
{:error, {:pan_unknown,"Unknown card brand."}}
{:error, {:pan_too_long, "Maximum PAN length is 19, found 20."}}

Added a (NOT PCI COMPLIANT) command-line interface. Use only with test credit card account numbers.

$ ./simplecardbrand 4111111111111111
PAN: 4111111111111111 -> Brand: visa

Dropped the “Work in Progress” flag after adding:

  • README.md and CHANGELOG.md to the Hex documentation
  • pre-commit tasks

Next Steps

  1. Add CLI for card_brand/2.

  2. GitHub CI.

  3. Publish.