1. Go to this page and download the library: Download adriaroca/rxp-hpp-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adriaroca / rxp-hpp-php example snippets
$hppRequest = new HppRequest();
$hppRequest->addMerchantId("MerchantId");
$hppRequest->addAccount("internet");
....
com\realexpayments\hpp\sdk\domain\HppRequest;
use com\realexpayments\hpp\sdk\RealexHpp;
use com\realexpayments\hpp\sdk\RealexValidationException;
use com\realexpayments\hpp\sdk\RealexException;
$hppRequest = new HppRequest();
$hppRequest->addMerchantId("MerchantId");
$hppRequest->addAccount("internet");
$hppRequest->addAmount("1001");
$hppRequest->addCurrency("EUR");
$hppRequest->addAutoSettleFlag(TRUE);
$hppRequest->addHppVersion("2");
// 3D Secure 2 Mandatory and Recommended Fields
$hppRequest->addCustomerEmailAddress("[email protected]");
$hppRequest->addCustomerMobilePhoneNumber("44|07123456789");
$hppRequest->addBillingAddressLine1("Flat 123");
$hppRequest->addBillingAddressLine2("House 456");
$hppRequest->addBillingAddressLine3("Unit 4");
$hppRequest->addBillingCity("Halifax");
$hppRequest->addBillingPostalCode("W5 9HR");
$hppRequest->addBillingCountryCode("826");
$hppRequest->addShippingAddressLine1("Apartment 825");
$hppRequest->addShippingAddressLine2("Complex 741");
$hppRequest->addShippingAddressLine3("House 963");
$hppRequest->addShippingCity("Chicago");
$hppRequest->addShippingState("IL");
$hppRequest->addShippingPostalCode("50001");
$hppRequest->addShippingCountryCode("840");
$realexHpp = new RealexHpp("Shared Secret");
try {
$requestJson = $realexHpp->requestToJson($hppRequest, false);
// TODO: pass the HPP request JSON to the JavaScript, iOS or Android Library
}
catch (RealexValidationException $e) {
// TODO: Add your error handling here
}
catch (RealexException $e) {
// TODO: Add your error handling here
}
com\realexpayments\hpp\sdk\domain\HppResponse;
use com\realexpayments\hpp\sdk\RealexHpp;
$realexHpp = new RealexHpp("mySecret");
$hppResponse = $realexHpp->responseFromJson(responseJson);
php composer.phar update
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.