PHP code example of ssanko / compari-trusted-shop

1. Go to this page and download the library: Download ssanko/compari-trusted-shop 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/ */

    

ssanko / compari-trusted-shop example snippets


try {
    $client = (new \Ssanko\Compari\TrustedShop('<apiKey>', new \Ssanko\Compari\Config\CompariConfig))
        ->setEmail('[email protected]')
        ->addProduct('Product name 1', 'P123456');

    echo $client->createTrustedCode();
} catch (Exception $exception) {
  die($exception->getMessage());
}

try {
    $client = (new \Ssanko\Compari\TrustedShop('<apiKey>', new \Ssanko\Compari\Config\ArukeresoConfig))
        ->setEmail('[email protected]')
        ->addProduct('Product name 1', 'P123456');

    echo $client->createTrustedCode();
} catch (Exception $exception) {
  die($exception->getMessage());
}