if ($pairingVerifier === '' && $pairingToken === '') {
    header('Location: /index.php');
    exit;
}
$config = new HpsCentinelConfig();
$config->processorId = 475;
$config->merchantId = 'heartland_mark';
$config->transactionPwd = '5XcypXzRAkywLxgk';
$service = new HpsMasterPassService($config);
$orderData = new HpsOrderData();
$orderData->transactionStatus = $status;
$orderData->checkoutType = HpsCentinelCheckoutType::PAIRING;
$orderData->pairingToken = $pairingToken;
$orderData->pairingVerifier = $pairingVerifier;
// Authenticate the request with the information we've gathered
$result = $service->authenticate($orderId, null, null, $payload, null, $orderData);
error_log(print_r($result, true));
?>
<!doctype html>
<html>
<head>
  <title>MasterPass Test</title>
</head>
<body>
  <a href="/connect.php?longAccessToken=<?php 
echo $result->longAccessToken;
?>
">Checkout</a>
  <ul>
    <li>Long Access Token: <?php 
echo $result->longAccessToken;
    exit;
}
$config = new HpsCentinelConfig();
$config->processorId = 475;
$config->merchantId = 'heartland_mark';
$config->transactionPwd = '5XcypXzRAkywLxgk';
$service = new HpsMasterPassService($config);
$orderData = new HpsOrderData();
$orderData->transactionStatus = $status;
if ($pairingToken !== '' && $pairingVerifier !== '') {
    $orderData->pairingToken = $pairingToken;
    $orderData->pairingVerifier = $pairingVerifier;
    $orderData->checkoutType = HpsCentinelCheckoutType::PAIRING_CHECKOUT;
}
// Authenticate the request with the information we've gathered
$result = $service->authenticate($orderId, $oauthToken, $oauthVerifier, $payload, $resourceUrl, $orderData);
error_log(print_r($result, true));
$buyer = new HpsBuyerData();
$buyer->firstName = 'John';
$buyer->lastName = 'Consumer';
$address = new HpsAddress();
$address->address = '123 Main Street';
$address->city = 'Cleveland';
$address->state = 'OH';
$address->zip = '44111';
$buyer->address = $address;
$buyer->countryCode = 'US';
$buyer->phoneNumber = '2162162116';
$shipping = new HpsShippingInfo();
$shipping->firstName = 'John';
$shipping->lastName = 'Consumer';