Skip to content

trustpilot/php-authenticated-encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Trustpilot authenticated encryption for PHP

Library for authenticated encryption used with Trustpilot.

Usage

Include the Trustpilot class, and invoke it:

    // To get the keys, base64 decode the keys you copy from the Trustpilot site:
    $encrypt_key = base64_decode('dfkkdfj....');
    $auth_key = base64_decode('dj83lshi....');
    // The payload should be a JSON object with your order data:
    $payload = [
        'email' => '[email protected]',
        'name' => 'John Doe',
        'ref' => '1234'
    ];
    $payload = json_encode($payload);
    $trustpilot = new Trustpilot; 
    $encryptedData = $trustpilot-> {'encryptPayload'}($payload, $encrypt_key, $auth_key);
    $trustpilot_invitation_link = "https://www.trustpilot.com/evaluate-bgl/<domainName>?p=" . $encryptedData

About

Library for authenticated encryption used with Trustpilot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages