Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thomaslorentsen/adyen-hpp-hmac
HMAC Generator for Adyen Hosted Payment Pages
https://github.com/thomaslorentsen/adyen-hpp-hmac
adyen adyen-hpp hmac payment-integration php
Last synced: 2 days ago
JSON representation
HMAC Generator for Adyen Hosted Payment Pages
- Host: GitHub
- URL: https://github.com/thomaslorentsen/adyen-hpp-hmac
- Owner: thomaslorentsen
- License: mit
- Created: 2017-08-25T13:44:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-05T09:34:45.000Z (about 7 years ago)
- Last Synced: 2024-08-13T22:36:11.368Z (3 months ago)
- Topics: adyen, adyen-hpp, hmac, payment-integration, php
- Language: PHP
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/thomaslorentsen/adyen-hpp-hmac.svg?branch=master)](https://travis-ci.org/thomaslorentsen/adyen-hpp-hmac)
[![Packagist](https://img.shields.io/packagist/v/thomaslorentsen/adyen-hpp-hmac.svg)](https://packagist.org/packages/thomaslorentsen/adyen-hpp-hmac)
[![Coverage Status](https://coveralls.io/repos/github/thomaslorentsen/adyen-hpp-hmac/badge.svg?branch=master)](https://coveralls.io/github/thomaslorentsen/adyen-hpp-hmac?branch=master)# Adyen HHP HMAC Generator
HMAC Generator for Adyen Hosted Payment Pages# Installation
Install with composer
```bash
composer require thomaslorentsen/adyen-hpp-hmac
```## Usage
```php
$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",
];
```
You can call the function directory to get a hash
```php
adyen_hmac($hmacKey, $params);
```
Get a hash using the class
```php
$signature = new Signature();
$hash = $signature->generate($hmacKey, $params);
```
Validate a hash
```php
$signature = new Signature($hmacKey);
$hash = $signature->validate($signature, $params);
```# Testing
```bash
vendor/bin/phpunit
```