Library for authenticated encryption used with Trustpilot
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
authenticatedencryption.php

README.md

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' => 'john@doe.com',
        '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