CardToken

One time use token representing card details that can be used to create a payment.

CardToken / Create

Create | Find

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", 19)
        .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" => {
           "addressState" => "MO",
           "expMonth" => "11",
           "expYear" => "19",
           "addressCity" => "OFallon",
           "cvc" => "123",
           "number" => "5105105105105100"
        }
})

puts cardToken.inspect
import simplify

simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"

cardToken = simplify.CardToken.create({
        "card" : {
           "addressState" : "MO",
           "expMonth" : "11",
           "expYear" : "19",
           "addressCity" : "OFallon",
           "cvc" : "123",
           "number" : "5105105105105100"
        }

})

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(
           'addressState' => 'MO',
           'expMonth' => '11',
           'expYear' => '19',
           'addressCity' => 'OFallon',
           'cvc' => '123',
           'number' => '5105105105105100'
        )
));

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 => {
       addressState => "MO",
       expMonth => "11",
       expYear => "19",
       addressCity => "OFallon",
       cvc => "123",
       number => "5105105105105100"
    }
});

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 = 19;
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 : {
       addressState : "MO",
       expMonth : "11",
       expYear : "19",
       addressCity : "OFallon",
       cvc : "123",
       number : "5105105105105100"
    }
}, 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
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.
[min length: 2, max length: 50]
optional
card.addressCountry Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder.
[min length: 2, max 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]
required
card.expYear Expiration year of the card. Format is YY. Example: 2013 = 13
[min value: 0, max value: 99]
required
card.name Name as appears on the card.
[min length: 2, max length: 50]
optional
card.number Card number as it appears on the card.
[min length: 13, max length: 19]
required
key Key used to create the card token. optional
OUTPUT
card.customer.id Customer ID
card.id Unique ID of the card associated with the payment
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.type Type of credit or debit card
used Shows if the token has been used or not.

CardToken / Find

Create | Find

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
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.type Type of credit or debit card
used Shows if the token has been used or not.