gringotts v1.1.1-rc Gringotts.CreditCard View Source

Defines a struct for (credit) cards and some utilities.

Link to this section Summary

Types

t()

Represents a Credit Card

Functions

Returns the full name of the card holder

Link to this section Types

Link to this type t() View Source
t() :: %Gringotts.CreditCard{
  brand: String.t(),
  first_name: String.t(),
  last_name: String.t(),
  month: 1..12,
  number: String.t(),
  verification_code: String.t(),
  year: non_neg_integer()
}

Represents a Credit Card.

FieldTypeDescription
numberstringThe card number.
monthintegerMonth of expiry (a number in the 1..12 range).
yearintegerYear of expiry.
first_namestringFirst name of the card holder (as on card).
last_namestringLast name of the card holder (as on card).
verification_codestringThe Card Verification Code, usually a 3-4 digit number on the back of the card.
brandstringThe brand name of the card network (in some cases also the card issuer) in UPPERCASE. Some popular card networks are Visa, MasterCard, Maestro, Diner’s Club etc.

Link to this section Functions

Link to this function full_name(card) View Source
full_name(t()) :: String.t()

Returns the full name of the card holder.

Joins first_name and last_name with a space in between.