iyzico v1.6.5 Iyzico.Card

A module representing cards used in monetary transactions.

Link to this section Summary

Types

Represents supplier association of a card

Represents family of a card

Represents type of a card

t()

Represents a card to perform the checkout

Functions

Converts a card association string into existing atom

Converts given card family string to existing atom

Converts a card type string into existing atom

Link to this section Types

Link to this type card_assoc()
card_assoc() :: :mastercard | :visa | :amex | :troy

Represents supplier association of a card.

Caveats

:troy is a Turkish supplier and only available in Turkey.

Link to this type card_family()
card_family() ::
  :bonus |
  :axess |
  :world |
  :maximum |
  :paraf |
  :cardfinans |
  :advantage |
  :neo |
  :denizbank |
  :cardfinans |
  :halkbank |
  :is_bank |
  :vakifbank |
  :yapi_kredi |
  :hsbc |
  :garanti

Represents family of a card.

Link to this type card_type()
card_type() :: :credit | :debit | :prepaid

Represents type of a card.

Card types

  • :credit: A credit card performs a transaction by borrowing money made available to a individual, who is a customer of a financial institution. The transferred funds are payed as a debt from the supplier bank to the vendor, which is ultimately paid by the credit card user.

  • :debit: A debit card performs a transaction by directly withdrawing the funds from its coupled bank account.

  • :prepaid: A reloadable card which performs a transaction by using pre-deposited funds.

Reference: YoungMoney.

Link to this type t()
t() :: %Iyzico.Card{cvc: integer(), exp_month: integer(), exp_year: integer(), holder_name: binary(), number: binary(), registration_alias: binary()}

Represents a card to perform the checkout.

Fields

  • :holder_name: Name of the holder of the card.
  • :number: Number of the card.
  • :exp_year: Latest two digits of expiration year of the card, (e.g.: 21 for 2021).
  • :exp_month: Index of the expiration month starting form 1, (e.g.: 1 for January).
  • :cvc: CVC or CVV number of the card, typically three to four digits.
  • :registration_alias: Alias of the card if it needs to be registered with ongoing transaction, optional.

Link to this section Functions

Link to this function get_card_assoc(assoc)
get_card_assoc(String.t()) :: card_assoc()

Converts a card association string into existing atom.

Examples

iex> Iyzico.Card.get_card_assoc "MASTER_CARD"
:mastercard

iex> Iyzico.Card.get_card_assoc "VISA"
:visa

iex> Iyzico.Card.get_card_assoc "AMERICAN_EXPRESS"
:amex

iex> Iyzico.Card.get_card_assoc "TROY"
:troy
Link to this function get_card_family(family)
get_card_family(String.t()) :: card_family()

Converts given card family string to existing atom.

Examples

iex> Iyzico.Card.get_card_family "Bonus"
:bonus

iex> Iyzico.Card.get_card_family "Axess"
:axess

iex> Iyzico.Card.get_card_family "World"
:world

iex> Iyzico.Card.get_card_family "Maximum"
:maximum

iex> Iyzico.Card.get_card_family "Paraf"
:paraf

iex> Iyzico.Card.get_card_family "Cardfinans"
:cardfinans

iex> Iyzico.Card.get_card_family "Advantage"
:advantage

iex> Iyzico.Card.get_card_family "Neo"
:neo

iex> Iyzico.Card.get_card_family "Denizbank DC"
:denizbank

iex> Iyzico.Card.get_card_family "Cardfinans DC"
:cardfinans

iex> Iyzico.Card.get_card_family "Halkbank DC"
:halkbank

iex> Iyzico.Card.get_card_family "Bankamatik"
:is_bank

iex> Iyzico.Card.get_card_family "Vakıfbank DC"
:vakifbank

iex> Iyzico.Card.get_card_family "Tlcard"
:yapi_kredi

iex> Iyzico.Card.get_card_family "Advantage DC"
:hsbc

iex> Iyzico.Card.get_card_family "Paracard"
:garanti

iex> Iyzico.Card.get_card_family "Miles&Smiles"
:miles_smiles
Link to this function get_card_type(type)
get_card_type(String.t()) :: card_type()

Converts a card type string into existing atom.

Examples

iex> Iyzico.Card.get_card_type "CREDIT_CARD"
:credit

iex> Iyzico.Card.get_card_type "DEBIT_CARD"
:debit

iex> Iyzico.Card.get_card_type "PREPAID_CARD"
:prepaid