PHP code example of thomaslorentsen / adyen-hpp-hmac

1. Go to this page and download the library: Download thomaslorentsen/adyen-hpp-hmac 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/ */

    

thomaslorentsen / adyen-hpp-hmac example snippets


$hmacKey = 'YOUR_HMAC_KEY'
$params = [
    "merchantReference" => "SKINTEST-123456789",
    "merchantAccount"   => "merchantAccount",
    "currencyCode"      => "GBP",
    "paymentAmount"     => "2000",
    "sessionValidity"   => "2020-12-25T10:31:06Z",
    "shipBeforeDate"    => "2017-08-25",
    "shopperLocale"     => "en_GB",
    "skinCode"          => "skinCode",
    "brandCode"         => "paypal_ecs",
    "shopperEmail"      => "[email protected]",
    "shopperReference"  => "123",
];

adyen_hmac($hmacKey, $params);

$signature = new Signature();
$hash = $signature->generate($hmacKey, $params);

$signature = new Signature($hmacKey);
$hash = $signature->validate($signature, $params);