Mon, 01/18/2016 - 05:10
#1
Tokenize Credit/Debit cards and store permanently.
Hi,
I am building a website in PHP script and as such I tried to save token after performing authorize transaction of credit card as I couldn't directly hit the API and create a token out of it.
I guess we can create token in Payeezy-Js only.
Now my question is that can i store tokens and if yes then, how can i preserve them permanently for future transactions.
What is the procedure for that ?
And let me know if there is another way of creating tokens in PHP.
Please guide me with complete details.
Thanks !
Regards,
Sanjay Chaudhary.
Hi Sanjay,
Tokenization is not limited to Payeezy JS. You should be able to call the tokenization method from any programming language (including PHP) that is capable of executing a REST call. You would simply call the URL for tokenization that includes the card info as query parameters from your PHP code. Here is an example.
<?php
$curl = curl_init('https://api-cert.payeezy.com/v1/securitytokens?apikey=y6pWAJNyJyjGv66IsVuWnklkKUPFbb0a&js_security_key=js-6125e57ce5c46e10087a545b9e9d7354c23e1a1670d9e9c7&ta_token=NOIW&auth=true&callback=Payeezy.callback&type=FDToken&credit_card.type=visa&credit_card.cardholder_name=JohnSmith&credit_card.card_number=4788250000028291&credit_card.exp_date=1030&credit_card.cvv=123');
curl_exec($curl);
curl_close($curl);
?>
Saving the tokens is completely upto you.
Regards,
Payeezy team
Hi,
I tried your code and it is giving me this error.
-------------------------------------------------
Error Number:60
Error String:SSL certificate problem: self signed certificate in certificate chain
------------------------------------------------------
Here is my code...
***************************************
<?php
$curl = curl_init('https://api-cert.payeezy.com/v1/securitytokens?apikey=y6pWAJNyJyjGv66IsVuWnklkKUPFbb0a&js_security_key=js-6125e57ce5c46e10087a545b9e9d7354c23e1a1670d9e9c7&ta_token=NOIW&auth=true&callback=Payeezy.callback&type=FDToken&credit_card.type=visa&credit_card.cardholder_name=JohnSmith&credit_card.card_number=4788250000028291&credit_card.exp_date=1030&credit_card.cvv=123');
$output = curl_exec($curl);
if ($output === false) {
echo "Error Number:" . curl_errno($curl) . "";
echo "Error String:" . curl_error($curl);
}else{
echo '';
print_r($output);
}
curl_close($curl);
?>
*************************************
I am not getting it, what kind of error is this.
So let me know what could be the possible cause of it and the solution as well.
Thanks !
Regards,
Sanjay Chaudhary.
Hi Sanjay,
I tried your code and it works fine for me. Can you try running it here - http://goo.gl/YeDC4J?
The error message you are getting is not coming from our server.
Regards,
Payeezy team
Hey,
Thanks ! The code is working fine now.
Regards,
Sanjay Chaudhary