juspay_expresscheckout v0.1.0 Juspay.Cards
Represents a credit or debit card belonging to a customer.
Summary
Functions
Add a credit card or debit card of a customer to JusPay Locker. customer_id parameter identifies the customer to whom this card belongs to
Delet a credit card or debit card of a customer from JusPay Locker. card_token parameter identifies the card to be deleted
List all the cards stored for a customer. This API gives back only tokens and other metadata relevant to the cards stored in JusPay Locker
Functions
Specs
create(list | map) :: map
Add a credit card or debit card of a customer to JusPay Locker. customer_id parameter identifies the customer to whom this card belongs to.
Examples
# input in the form of list
iex>Juspay.Cards.create([merchant_id: "vasu2795", customer_id: "user_108", name_on_card: "Sindbad",
card_exp_year: 2015, card_exp_month: 7, customer_email: "customer@mail.com",
nickname: "Visa card", card_number: "4123567890123456"])
# input in the form of map (works with both string keyed map and atom keyed map)
iex>Juspay.Cards.create(%{:merchant_id => "vasu2795", :customer_id => "user_108", :name_on_card => "Sindbad",
:card_exp_year => 2015, :card_exp_month => 7, :customer_email => "customer@mail.com",
:nickname => "Visa card", :card_number => "4123567890123456"})
# response
%{
"card_fingerprint" => "2bp6l17bhqm700ktnv7h28q4qi",
"card_reference" => "80fec25769da85bae1a5565dabea9a5b",
"card_token" => "1a1ea67b-9ec2-41db-8413-a0ddd8b3c5f6"
}
Specs
delete(list | map) :: map
Delet a credit card or debit card of a customer from JusPay Locker. card_token parameter identifies the card to be deleted.
Examples
# input in the form of list
iex>Juspay.Cards.delete([card_token: "1a1ea67b-9ec2-41db-8413-a0ddd8b3c5f6"])
# input in the form of map (works with both string keyed map and atom keyed map)
iex>Juspay.Cards.delete(%{:card_token => "1a1ea67b-9ec2-41db-8413-a0ddd8b3c5f6"}) orJuspay.Cards.delete(%{"card_token" => "1a1ea67b-9ec2-41db-8413-a0ddd8b3c5f6"})
%{
"card_reference" => "80fec25769da85bae1a5565dabea9a5b",
"card_token" => "1a1ea67b-9ec2-41db-8413-a0ddd8b3c5f6",
"deleted" => true
}
Specs
list(list | map) :: list
List all the cards stored for a customer. This API gives back only tokens and other metadata relevant to the cards stored in JusPay Locker.
Examples
# input in the form of list
iex>Juspay.Cards.list([customer_id: "guest_user"])
# input in the form of map (works with both string keyed map and atom keyed map)
iex>Juspay.Cards.list(%{"customer_id": "guest_user"})
[
%{"card_brand" => "MASTERCARD", "card_exp_month" => "10",
"card_exp_year" => "2020",
"card_fingerprint" => "7f6c126utindhjun5kbr83rim3", "card_isin" => "526419",
"card_issuer" => "HDFCBANK.LTD.", "card_number" => "5264-XXXXXXXX-3394",
"card_reference" => "092e71cfd88cba9f52e1b07ea9cf08a6",
"card_token" => "02f909f0-85a5-49c7-8802-85bce97a7935",
"card_type" => "DEBIT", "expired" => false, "name_on_card" => "Real Card",
"nickname" => ""},
%{"card_brand" => "VISA", "card_exp_month" => "10", "card_exp_year" => "2020",
"card_fingerprint" => "2v0jk4e6lr8etrovtr5omh5ime", "card_isin" => "462986",
"card_issuer" => "ICICIBANK.LTD.", "card_number" => "4629-XXXXXXXX-5678",
"card_reference" => "b1da83d322d35cacbf3f75dcdca40cca",
"card_token" => "e0bd01da-ee75-4ad6-9d6e-9c604039d25a",
"card_type" => "CREDIT", "expired" => false, "name_on_card" => "Test Card",
"nickname" => ""}
.... ]