Tutuka (Tutuka v1.3.0) View Source
Documentation for Tutuka
.
Welcome to Tutuka’s Elixir Documentation, where you will find everything you need to start integrating with our platform. Use our APIs to start issuing physical and virtual cards quickly and easily with just a few lines of code.
The Card and Companion API each offer a unique customer journey, so you will need to clearly understand how the two are different and what they do, to choose the one that is right for you. Our QR Payments API can be used as a standalone API or as a plugin to either the Card or Companion API.
Below is the configuration required
Configuration for the Tutuka API.
Examples
config :tutuka,
terminal_id: "0071472542",
terminal_password: "D78D9AFBE8",
remote_terminal_id: "0071472542",
remote_terminal_password: "D78D9AFBE8",
host: "https://companion.uat.tutuka.cloud/v2_0/XmlRpc.cfm"
Link to this section Summary
Functions
Activate the specified card if the card was initially created as inactive.
Change the specified card’s PIN.
Create a new, active virtual card and link it to a reference with the given bearer details
Remove a payment token linked to a card (NOT COMMISSIONED YET)
Get an array of card details of activated cards linked to the reference.
Get an array of card details of all cards (active, stopped and retired) linked to the reference.
Return the status of the specified card
Link a card to a reference with the given bearer details. Linking a card will not activate it.
Returns all the tokens linked to a card.
Order a card for a specific cardholder. A card can be printed with cardholder details by the card manufacturer.
Order a card for a specific cardholder. A card can be printed with cardholder details by the card manufacturer.
Print the specified card if the card was initially created as virtual.
Reset the specified card’s PIN. The random pin will be sent to the card bearer’s cell via text message.
Retires the specified card.
Set 3D Secure Code of the specified card.
Stop the specified card.
Update the specified card’s bearer details.
Generate a new CVV2 of the specified card
Link to this section Functions
Activate the specified card if the card was initially created as inactive.
Examples
iex> Tutuka.activate_card(%{
:card_identifier => "5368982188886000",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Change the specified card’s PIN.
Examples
iex> Tutuka.change_pin(%{
:reference => "000000/00/0",
:card_identifier => "5368982655680670",
:new_pin => "1234",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Create a new, active virtual card and link it to a reference with the given bearer details
Expiry date can be modified for weeks, months and years in respect to the date format shown below. A Third party library like Timex is optionally required for this example to work
Examples
iex> Tutuka.create_linked_card(%{
:reference => "000000/00/0",
:first_name => "John",
:last_name => "Doe",
:id_or_passport => "000000/00/0",
:cellphone_number => "260950000000",
:expiry_data => Timex.now() |> Timex.shift(months: 1) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-",""),
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"cardNumber" => "5368982697799959",
"cvv2" => "509",
"expiryDate" => "20220517T00:00:00",
"resultCode" => "1",
"resultText" => "Approved",
"trackingNumber" => "112177200000304",
"validDate" => "05/22"
}
Remove a payment token linked to a card (NOT COMMISSIONED YET)
Examples
iex> Tutuka.delete_token(%{})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Get an array of card details of activated cards linked to the reference.
Examples
iex> Tutuka.get_active_linked_cards(%{
:reference => "000000/00/0",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"cardIdentifier" => "5368982655680670",
"cardType" => "VISA",
"expiryDate" => "20220517T00:00:00",
"resultCode" => "1",
"resultText" => "Approved",
"trackingNumber" => "112177200000304",
"validDate" => "05/22"
}
Get an array of card details of all cards (active, stopped and retired) linked to the reference.
Examples
iex> Tutuka.get_all_linked_cards(%{
:reference => "000000/00/0",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"cardIdentifier" => "5368982655680670",
"cardType" => "VISA",
"expiryDate" => "20220517T00:00:00",
"resultCode" => "1",
"resultText" => "Approved",
"trackingNumber" => "112177200000304",
"validDate" => "05/22"
}
Return the status of the specified card
Expiry date can be modified for weeks, months and years in respect to the date format shown below. A Third party library like Timex is optionally required for this example to work
Examples
iex> Tutuka.get_card_status(%{
:reference => "260950773797",
:tracking_number => "739477200000568",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"activated" => "1",
"cancelled" => "0",
"empty" => "1",
"expired" => "0",
"loaded" => "0",
"lost" => "0",
"pinBlocked" => "0",
"redeemed" => "0",
"resultCode" => "1",
"resultText" => "Approved",
"retired" => "0",
"stolen" => "0",
"stopped" => "0",
"valid" => "1"
}
Link a card to a reference with the given bearer details. Linking a card will not activate it.
Examples
iex> Tutuka.link_card(%{
:reference => "341565/43/1",
:card_identifier => "5368982188886000",
:first_name => "John",
:last_name => "Doe",
:id_or_passport => "000000/00/0",
:cellphone_number => "260950000000",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Returns all the tokens linked to a card.
Examples
iex> Tutuka.list_tokens(%{
:reference => "341565/43/1",
:card_identifier => "5368982188886000",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"tokenIdentifier" => "5368982188886000",
"tokenType" => "VISA",
"expiryDate" => "20220517T00:00:00",
"resultCode" => "1",
"resultText" => "Approved",
"trackingNumber" => "112177200000304",
"validDate" => "05/22"
}
Order a card for a specific cardholder. A card can be printed with cardholder details by the card manufacturer.
Examples
iex> Tutuka.order_card(%{
:title => :string,
:initials => :string,
:last_name => :string,
:address_1 => :string,
:address_2 => :string,
:address_3 => :string,
:address_4 => :string,
:address_5 => :string,
:additional_data => :string,
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Order a card for a specific cardholder. A card can be printed with cardholder details by the card manufacturer.
Examples
iex> Tutuka.order_card_with_pin_block(%{
:title => :string,
:initials => :string,
:last_name => :string,
:address_1 => :string,
:address_2 => :string,
:address_3 => :string,
:address_4 => :string,
:address_5 => :string,
:additional_data => :string,
:pin_block => :string,
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Print the specified card if the card was initially created as virtual.
Examples
iex> Tutuka.print_linked_card(%{
:card_identifier => "5368982188886000",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Reset the specified card’s PIN. The random pin will be sent to the card bearer’s cell via text message.
Examples
iex> Tutuka.reset_pin(%{
:reference => "341565/43/1",
:card_identifier => "5368982188886000",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Retires the specified card.
Examples
iex> Tutuka.retire_card(%{
:reference => "341565/43/1",
:card_identifier => "5368982694847710",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Set 3D Secure Code of the specified card.
Examples
iex> Tutuka.set_3d_secure_code(%{
:reference => "341565/43/1",
:card_identifier => "5368982694847710",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Stop the specified card.
Examples
iex> Tutuka.stop_card(%{
:reference => "341565/43/1",
:card_identifier => "5368982188886000",
:reason => "6",
:note => "",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Update the specified card’s bearer details.
Examples
iex> Tutuka.update_bearer( %{
:reference => "341565/43/1",
:card_identifier => "5368982188886000",
:first_name => "Chileya",
:last_name => "Chani",
:id_or_passport => "341565/43/1",
:cellphone_number => "260950773797",
:transaction_id => UUID.uuid4(:strong),
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}
Generate a new CVV2 of the specified card
Examples
iex> Tutuka.update_bearer(%{
:reference => "341565/43/1",
:card_identifier => "5368982188886000",
:transaction_id => UUID.uuid4(:strong),
:transaction_date => Timex.now() |> Timex.shift(hours: 2, minutes: 0) |> DateTime.truncate(:second) |> DateTime.to_iso8601() |> String.replace("Z", "") |> String.replace("-","")
})
%{
"resultCode" => "1",
"resultText" => "Approved"
}