Skip to content

Instantly share code, notes, and snippets.

@rcubitto
Created February 16, 2018 18:22
Show Gist options
  • Save rcubitto/82848b5d9609428b66453451022ca4a3 to your computer and use it in GitHub Desktop.
Save rcubitto/82848b5d9609428b66453451022ca4a3 to your computer and use it in GitHub Desktop.
Heartland Tokenize Card
<?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