CardToken
One time use token representing card details that can be used to create a payment.
Examples
Create CardToken
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
CardToken cardToken = CardToken.create(new PaymentsMap()
.set("card.addressCity", "OFallon")
.set("card.addressState", "MO")
.set("card.cvc", "123")
.set("card.expMonth", 11)
.set("card.expYear", 35)
.set("card.number", "5105105105105100")
);
System.out.println(cardToken);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
cardToken = Simplify::CardToken.create({
"card" => {
"number" => "5105105105105100",
"expMonth" => "11",
"cvc" => "123",
"expYear" => "35",
"addressState" => "MO",
"addressCity" => "OFallon"
}
})
puts cardToken.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
cardToken = simplify.CardToken.create({
"card" : {
"number" : "5105105105105100",
"expMonth" : "11",
"cvc" : "123",
"expYear" : "35",
"addressState" : "MO",
"addressCity" : "OFallon"
}
})
print(cardToken)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$cardToken = Simplify_CardToken::createCardToken(array(
'card' => array(
'number' => '5105105105105100',
'expMonth' => '11',
'cvc' => '123',
'expYear' => '35',
'addressState' => 'MO',
'addressCity' => 'OFallon'
)
));
print_r($cardToken);
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
my $cardToken = Net::Simplify::CardToken->create({
card => {
number => "5105105105105100",
expMonth => "11",
cvc => "123",
expYear => "35",
addressState => "MO",
addressCity => "OFallon"
}
});
print "CardToken ID ", $cardToken->{id}, "\n";
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
CardToken cardToken = new CardToken();
Card card = new Card();
card.AddressCity = "OFallon";
card.AddressState = "MO";
card.Cvc = "123";
card.ExpMonth = 11;
card.ExpYear = 35;
card.Number = "5105105105105100";
cardToken.Card = card;
try
{
cardToken = (CardToken)api.Create(cardToken);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.cardtoken.create({
card : {
number : "5105105105105100",
expMonth : "11",
cvc : "123",
expYear : "35",
addressState : "MO",
addressCity : "OFallon"
}
}, function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
secure3DRequestData.id
3D Secure data ID.
optional
callback
The URL callback for the cardtoken
optional
card
Credit or debit card being used to apply the payment to.
required
card.addressCity
City of the cardholder.
[max length: 50, min length: 2]
optional
card.addressCountry
Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder.
[max length: 2, min length: 2]
optional
card.addressLine1
Address of the cardholder.
[max length: 255]
optional
card.addressLine2
Address of the cardholder if needed.
[max length: 255]
optional
card.addressState
State of residence of the cardholder. State abbreviations should be used.
[max length: 255]
optional
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters.
[max length: 32]
optional
card.cvc
CVC security code of the card. This is the code on the back of the card. Example: 123
optional
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01
[min value: 1, max value: 12]
optional
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13
[min value: 0, max value: 99]
optional
card.name
Name as appears on the card.
[max length: 50, min length: 2]
optional
card.number
Card number as it appears on the card.
[max length: 19, min length: 13]
optional
key
Key used to create the card token.
optional
secure3DRequestData
3D Secure data structure for checking card enrolment.
optional
secure3DRequestData.amount
Amount of the subsequent transaction in the smallest unit of your currency. Example: 100 = $1.00
[min value: 50, max value: 9999900]
required
secure3DRequestData.authOnly
Specifies if the subsequent transaction is going to be a Payment or an Authorization (to be Captured later). If false or not specified, it refers to a Payment, otherwise it refers to an Authorization.
optional
secure3DRequestData.currency
Currency code (ISO-4217). Must match the currency associated with your account.
required
secure3DRequestData.description
A description of the transaction.
[max length: 256]
required
OUTPUT
card.customer.id
Customer ID
card.id
Unique ID of the card associated with the payment
card.secure3DData.id
3DS Identifier for the transaction.
id
Unique id associated with the card token
card
Credit or debit card being used to apply the payment to.
card.addressCity
City of the cardholder.
card.addressCountry
Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder.
card.addressLine1
Address of the cardholder.
card.addressLine2
Address of the cardholder if needed.
card.addressState
State of residence of the cardholder. State abbreviations should be used.
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters.
card.customer
Customer associated with the card
card.customer.email
Email address of the customer
card.customer.name
Name of the customer
card.dateCreated
Creation date in UTC millis of the card in the system
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13
card.indicator
Card indicator, i.e. DEBIT, CREDIT or CHARGE CARD.
card.indicatorSource
Card indicator source.
card.last4
Last 4 digits of the card number
card.name
Name as appears on the card.
card.secure3DData
3DS object
card.secure3DData.acsUrl
The URL of the card issuer's Access Control Server (ACS) where the cardholder can be authenticated
card.secure3DData.isEnrolled
3DS flag indicating if the card is enrolled or not.
card.secure3DData.md
A key used to identify the token and user on the 3DSecure response callback
card.secure3DData.paReq
Payer Authentication Request, message that is sent to the card Issuer's Access Control Server (ACS) to initiate authentication of the cardholder
card.secure3DData.sessionID
Test
card.secure3DData.termUrl
Redirect endpoint that the Access Control Server (ACS) sends the challenge result
card.type
Type of credit or debit card
used
Shows if the token has been used or not.
Examples
Find CardToken
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
CardToken cardToken = CardToken.find("4TR6Bc");
System.out.println (cardToken);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
cardToken = Simplify::CardToken.find('4TR6Bc')
puts cardToken.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
cardToken = simplify.CardToken.find('4TR6Bc')
print(cardToken)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$obj = Simplify_CardToken::findCardToken('4TR6Bc');
print_r($obj);
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$cardToken = Net::Simplify::CardToken->find('4TR6Bc');
print $cardToken->{id}, "\n";
using SimplifyCommerce.Payments;
using Newtonsoft.Json;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
try
{
String id = "1234";
CardToken cardToken = (CardToken)api.Find(typeof(CardToken), id);
// output all properties
Console.WriteLine(JsonConvert.SerializeObject(cardToken).ToString());
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.cardtoken.find("4TR6Bc", function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
None
OUTPUT
card.customer.id
Customer ID
card.id
Unique ID of the card associated with the payment
card.secure3DData.id
3DS Identifier for the transaction.
id
Unique id associated with the card token
card
Credit or debit card being used to apply the payment to.
card.addressCity
City of the cardholder.
card.addressCountry
Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder.
card.addressLine1
Address of the cardholder.
card.addressLine2
Address of the cardholder if needed.
card.addressState
State of residence of the cardholder. State abbreviations should be used.
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters.
card.customer
Customer associated with the card
card.customer.email
Email address of the customer
card.customer.name
Name of the customer
card.dateCreated
Creation date in UTC millis of the card in the system
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13
card.indicator
Card indicator, i.e. DEBIT, CREDIT or CHARGE CARD.
card.indicatorSource
Card indicator source.
card.last4
Last 4 digits of the card number
card.name
Name as appears on the card.
card.secure3DData
3DS object
card.secure3DData.acsUrl
The URL of the card issuer's Access Control Server (ACS) where the cardholder can be authenticated
card.secure3DData.isEnrolled
3DS flag indicating if the card is enrolled or not.
card.secure3DData.md
A key used to identify the token and user on the 3DSecure response callback
card.secure3DData.paReq
Payer Authentication Request, message that is sent to the card Issuer's Access Control Server (ACS) to initiate authentication of the cardholder
card.secure3DData.sessionID
Test
card.secure3DData.termUrl
Redirect endpoint that the Access Control Server (ACS) sends the challenge result
card.type
Type of credit or debit card
used
Shows if the token has been used or not.