Ejemplo n.º 1
0
<?php

require_once 'vendor/autoload.php';
use com\realexpayments\hpp\sdk\domain\HppRequest;
use com\realexpayments\hpp\sdk\RealexHpp;
$hppRequest = (new HppRequest())->addMerchantId("demohpp")->addAccount("lightbox")->addAmount("1001")->addCurrency("EUR")->addAutoSettleFlag("1");
$realexHpp = new RealexHpp("secret");
$requestJson = $realexHpp->requestToJson($hppRequest);
echo $requestJson;
Ejemplo n.º 2
0
<?php

require "vendor/autoload.php";
use com\realexpayments\hpp\sdk\domain\HppResponse;
use com\realexpayments\hpp\sdk\RealexHpp;
use com\realexpayments\hpp\sdk\RealexValidationException;
use com\realexpayments\hpp\sdk\RealexException;
if (isset($_POST['hppResponse'])) {
    $responseJson = $_POST['hppResponse'];
    $realexHpp = new RealexHpp("secret");
    $HppResponseObject = $realexHpp->responseFromJson($responseJson, true);
    $output = array('TIMESTAMP' => $HppResponseObject->getTimeStamp(), 'ORDER_ID' => $HppResponseObject->getOrderId(), 'RESULT' => $HppResponseObject->getResult(), 'AUTHCODE' => $HppResponseObject->getAuthCode(), 'MESSAGE' => $HppResponseObject->getMessage(), 'PASREF' => $HppResponseObject->getPasRef(), 'CVNRESULT' => $HppResponseObject->getCvnResult(), 'AVSADDRESSRESULT' => $HppResponseObject->getAVSAddressResult(), 'AVSPOSTCODERESULT' => $HppResponseObject->getAVSPostCodeResult(), 'MERCHANT_ID' => $HppResponseObject->getMerchantId(), 'ACCOUNT' => $HppResponseObject->getAccount(), 'BATCHID' => $HppResponseObject->getBatchId(), 'CAVV' => $HppResponseObject->getCavv(), 'XID' => $HppResponseObject->getXid(), 'ECI' => $HppResponseObject->getEci(), 'COMMENT1' => $HppResponseObject->getCommentOne(), 'COMMENT2' => $HppResponseObject->getCommentTwo(), 'SUPPLEMENTARYDATA' => $HppResponseObject->getSupplementaryData(), 'TSSINFO' => $HppResponseObject->getTss(), 'SHA1HASH' => $HppResponseObject->getHash());
    $responseJson = json_encode($output, JSON_PRETTY_PRINT);
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="shortcut icon" href="img/favicon.png">       
        <title>Lightbox | HPP Demo Prototype</title>
        <!-- Bootstrap Core CSS -->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <!-- Custom CSS -->
        <link href='css/custom.css' rel='stylesheet'>
        <!-- Style -->
        <link id='theme' href='css/style-1.css' rel='stylesheet'>