PHP code example of antistatique / trustedshops-php-sdk

1. Go to this page and download the library: Download antistatique/trustedshops-php-sdk 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/ */

    

antistatique / trustedshops-php-sdk example snippets


use \Antistatique\TrustedShops\TrustedShops;

$tsid = 'abc123abc123abc123abc123abc123';
$ts = new TrustedShops();
$response = $ts->get("shops/$tsid");
print_r($response);

$tsid = 'abc123abc123abc123abc123abc123';
$ts = new TrustedShops();
$response = $ts->get("shops/$tsid/reviews");
print_r($response);

$tsid = 'abc123abc123abc123abc123abc123';
$ts = new TrustedShops('restricted');
$ts->setApiCredentials( 'SECRET_USER', 'SECRET_PASSWORD');
$response = $ts->get("shops/$tsid/quality/complaints");
print_r($response);

echo $ts->getLastError();

print_r($ts->getLastResponse());

print_r($ts->getLastRequest());

composer