Created
February 16, 2018 18:22
-
-
Save rcubitto/82848b5d9609428b66453451022ca4a3 to your computer and use it in GitHub Desktop.
Heartland Tokenize Card
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$card = new \HpsCreditCard; | |
$card->number = '4111111111111111'; // visa testing card | |
$card->cvv = '123'; | |
$card->expMonth = '10'; | |
$card->expYear = '2010'; // expired! | |
$address = new \HpsAddress; | |
$address->address = '265 Peachtree Center Ave NE'; | |
$address->city = 'Atlanta'; | |
$address->state = 'GA'; | |
$address->country = 'US'; | |
$address->zip = '30305'; | |
$cardHolder = new \HpsCardHolder; | |
$cardHolder->address = $address; | |
$cardHolder->firstName = 'John'; | |
$cardHolder->lastName = 'Doe'; | |
$config = new \HpsServicesConfig; | |
$config->secretApiKey = '{secretKey}' | |
$config->publicApiKey = '{publicKey}'; | |
$service = new \HpsCreditService; | |
$service->setServicesConfig($config); | |
$response = $service->verify($card, $cardHolder, true); | |
return json_encode($response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment