PHP code example of vleks / sdk

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

    

vleks / sdk example snippets



use Vleks\SDK\Client;
use Vleks\SDK\Requests\ListProducts as ListProductsRequest;
use Vleks\SDK\Exceptions\ClientException;
use Vleks\SDK\Exceptions\ServiceException;

 new Client($publicKey, $privateKey, $merchantId, $clusterUrl);

try {
    $request = new ListProductsRequest();
    $result  = $vleksClient->listProducts($request);

    print_r ($result->getProducts());
} catch (ClientException $clientException) {
    echo 'A Client error occurred: ' . $clientException->getMessage();
} catch (ServiceException $servicException) {
    echo 'A Service error occurred: ' . $servicException->getMessage();
}