shopifystats

Rest-TOKENIZE

Advanced tokenization to secure your payments and protect  cardholder data.

#API </> {REST TOKENIZE}

For a sandbox account please send a request to support@paidyet.com

Overview

To use PaidYET’s RESTful api, you will need to follow these steps:
1. Generate an API key and white-list your IP address in the PayPage -> API page
2. Get Authentication Token from our REST server
3. Use token to make calls to the endpoints.

 

Sample to get Authentication Token (cURL)

  
     $postdata =   [
        'subdomain' => '[Your Subdomain]',
        'key' => '[Your API Key]',
        'nonce'   => rand(154678, 10000000),
        'time'=>time()
    ];
    $ch = curl_init();
    $url =  "https://api.paidyet.com/v2/login";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    try{
	    $output = curl_exec($ch);
    }
    catch(Exception $e) {
	    throw $e;
    }
    curl_close($ch);

 

Sample tokenize card

(this can only be done with a valid credit card.)

  
  $ch = curl_init();
  $url =  "https://api.paidyet.com/v2/tokenize";
  $postdata = ['cardnumber'=>[cardnumber],'expiration'=>[expiration], 'cvv'=>[cvv]];
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
  curl_setopt($ch, CURLOPT_HTTPHEADER,array("Authorization: Bearer ".$token  ));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  try{
    $output = curl_exec($ch);
  }
  catch(Exception $e) {
    throw $e;
  }
  curl_close($ch);
Field Name Required Type Description
cardnumber True numeric (16 characters) A valid credit card number.
expiration True numeric (4 digits) The expiration month and year of the credit card being tokenized. Expirations but be numeric and in the format MMYY.
cvv True numeric (3-4 digits) The CVV verification number for the credit card being tokenized.
email alphanumeric (optional) An email address can be passed along with the card if you’d like to attach this token to a contact. If you already have a contact with this email address, the token will be attached to them. If you do not, then a new contact will be created if an email address is passed.
fName alphanumeric The first name of the contact that you will be attaching this card to. (email address must be present to pass this field)
lName alphanumeric The last name of the contact that you will be attaching this card to. (email address must be present to pass this field)

 

Response

This is the response data you will receive back from the tokenization API endpoint.

status string OK | NOK
result Object
result.status String Success | Failure
result.contact Object
result.contact.id Int The id of the contact that you attached this card to.
result.contact.fName String The first name of the contact that you will be attached this card to. 
result.contact.lName String The last name of the contact that you will be attached this card to. 
result.contact.email String  The email of the contact that you will be attached this card to. 
result.card Object
result.card.token String The token that was generated for this card. This is the token that will be used for all processing API calls.
result.card.type String The card brand. (Visa, Mastercard, Amex, etc)
result.card.cc_last4 String The last 4 digits of the credit card that was tokenized. (prefilled with 12 X)