* @package HPS * @author Heartland Payment Systems <*****@*****.**> * @license https://github.com/hps/heartland-php/blob/master/LICENSE.txt Custom * @link https://github.com/hps/heartland-php */ require '../../Hps.php'; session_start(); error_reporting(E_ALL); // Grab parameters sent by MasterPass from query string $orderId = isset($_GET['orderId']) ? $_GET['orderId'] : ''; $orderNumber = isset($_GET['orderNumber']) ? $_GET['orderNumber'] : ''; $config = new HpsCentinelConfig(); $config->processorId = 475; $config->merchantId = 'heartland_mark'; $config->transactionPwd = '5XcypXzRAkywLxgk'; $service = new HpsMasterPassService($config); $orderData = new HpsOrderData(); $orderData->orderNumber = $orderNumber; $orderData->currencyCode = 'usd'; // Authenticate the request with the information we've gathered $result = $service->void($orderId, $orderData); error_log(print_r($result, true)); ?> <!doctype html> <html> <head> <title>MasterPass Test</title> </head> <body> <ul> <li>Error Number: <?php
* @author Heartland Payment Systems <*****@*****.**> * @license https://github.com/hps/heartland-php/blob/master/LICENSE.txt Custom * @link https://github.com/hps/heartland-php */ require '../../Hps.php'; session_start(); error_reporting(E_ALL); // Grab parameters sent by MasterPass from query string $orderId = isset($_GET['orderId']) ? $_GET['orderId'] : ''; $orderNumber = isset($_GET['orderNumber']) ? $_GET['orderNumber'] : ''; $amount = isset($_GET['amount']) ? $_GET['amount'] : ''; $config = new HpsCentinelConfig(); $config->processorId = 475; $config->merchantId = 'heartland_mark'; $config->transactionPwd = '5XcypXzRAkywLxgk'; $service = new HpsMasterPassService($config); $orderData = new HpsOrderData(); $orderData->orderNumber = $orderNumber; $orderData->currencyCode = 'usd'; // Authenticate the request with the information we've gathered $result = $service->capture($orderId, $amount, $orderData); error_log(print_r($result, true)); $refundEndpoint = '/refund.php?' . 'orderId=' . $orderId . '&' . 'amount=' . $amount; ?> <!doctype html> <html> <head> <title>MasterPass Test</title> </head> <body> <a href="<?php
$pairingVerifier = isset($_GET['pairing_verifier']) ? $_GET['pairing_verifier'] : ''; $pairingToken = isset($_GET['pairing_token']) ? $_GET['pairing_token'] : ''; // Grab parameters sent by us from the first step $payload = urldecode($_GET['mp_payload']); $orderId = $_GET['mp_orderId']; $orderNumber = $_GET['mp_orderNumber']; // Cancel request from MasterPass UI 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>
} else { if ($pairing && !$checkout) { $checkoutType = HpsCentinelCheckoutType::PAIRING; } else { if (!$pairing && $connect) { $checkoutType = HpsCentinelCheckoutType::CONNECT; } else { $checkoutType = HpsCentinelCheckoutType::LIGHTBOX; } } } $config = new HpsCentinelConfig(); $config->processorId = 475; $config->merchantId = 'heartland_mark'; $config->transactionPwd = '5XcypXzRAkywLxgk'; $service = new HpsMasterPassService($config); $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'; $payment = new HpsPaymentData(); $shipping = new HpsShippingInfo(); $shipping->firstName = 'John'; $shipping->lastName = 'Consumer';
* @package HPS * @author Heartland Payment Systems <*****@*****.**> * @license https://github.com/hps/heartland-php/blob/master/LICENSE.txt Custom * @link https://github.com/hps/heartland-php */ require '../../Hps.php'; session_start(); error_reporting(E_ALL); // Grab parameters sent by MasterPass from query string $orderId = isset($_GET['orderId']) ? $_GET['orderId'] : ''; $amount = isset($_GET['amount']) ? $_GET['amount'] : ''; $config = new HpsCentinelConfig(); $config->processorId = 475; $config->merchantId = 'heartland_mark'; $config->transactionPwd = '5XcypXzRAkywLxgk'; $service = new HpsMasterPassService($config); $orderData = new HpsOrderData(); $orderData->currencyCode = 'usd'; // Authenticate the request with the information we've gathered $result = $service->refund($orderId, false, $amount, $orderData); error_log(print_r($result, true)); ?> <!doctype html> <html> <head> <title>MasterPass Test</title> </head> <body> <ul> <li>Error Number: <?php echo $result->errorNumber;
$pairingToken = isset($_GET['pairing_token']) ? $_GET['pairing_token'] : ''; // Grab parameters sent by us from the first step $action = $_GET['mp_action']; $payload = urldecode($_GET['mp_payload']); $orderId = $_GET['mp_orderId']; $orderNumber = $_GET['mp_orderNumber']; // Cancel request from MasterPass UI if ($status == 'cancel') { 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; 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';
* @link https://github.com/hps/heartland-php */ require '../../Hps.php'; session_start(); error_reporting(E_ALL); // Grab parameters sent by MasterPass from query string $longAccessToken = isset($_GET['longAccessToken']) ? $_GET['longAccessToken'] : ''; if ($longAccessToken === '') { header('Location: /test.php?pair=true'); exit; } $config = new HpsCentinelConfig(); $config->processorId = 475; $config->merchantId = 'heartland_mark'; $config->transactionPwd = '5XcypXzRAkywLxgk'; $service = new HpsMasterPassService($config); $result = $service->preApproval($longAccessToken); error_log(print_r($result, true)); ?> <!doctype html> <html> <head> <title>MasterPass Test</title> </head> <body> <ul> <li>Transaction ID: <?php echo $result->transactionId; ?> </li> <li>Long Access Token: <?php