thomaslorentsen / adyen-hpp-hmac
Adyen Hosted Payment Pages 的 HMAC 生成器
v0.3.1
2017-09-07 11:41 UTC
Requires
- sarciszewski/php-future: dev-master
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is not auto-updated.
Last update: 2024-09-25 02:21:31 UTC
README
Adyen HHP HMAC 生成器
Adyen Hosted Payment Pages 的 HMAC 生成器
安装
使用 composer 安装
composer require thomaslorentsen/adyen-hpp-hmac
使用方法
$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" => "test@adyen.com", "shopperReference" => "123", ];
通过调用函数目录获取哈希值
adyen_hmac($hmacKey, $params);
使用类获取哈希值
$signature = new Signature(); $hash = $signature->generate($hmacKey, $params);
验证哈希值
$signature = new Signature($hmacKey); $hash = $signature->validate($signature, $params);
测试
vendor/bin/phpunit