PHP code example of tesseract / crypto-sdk

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

    

tesseract / crypto-sdk example snippets



    



return [
  
  /*
  |--------------------------------------------------------------------------
  | Default Base URL
  |--------------------------------------------------------------------------
  */
  'tesseract.crypto.baseUrl' => 'https://sandbox.tesseract.mx',
  
  /*
  |--------------------------------------------------------------------------
  | Default Access Key ID
  |--------------------------------------------------------------------------
  */
  'tesseract.crypto.access_key_id' => '[your_access_key_id]',
   
  /*
  |--------------------------------------------------------------------------
  | Default Secret Access Key
  |--------------------------------------------------------------------------
  */
  'tesseract.crypto.secret_access_key' => '[your_secret_access_key]',
   
  /*
  |--------------------------------------------------------------------------
  | Default Debug
  |--------------------------------------------------------------------------
  */
  'tesseract.crypto.debug' => false,
   
  /*
  |--------------------------------------------------------------------------
  | Default Timeout
  |--------------------------------------------------------------------------
  */
  'tesseract.crypto.timeout' => 5.000

];




esseract\Crypto\SDK\CryptoSDK;
use Tesseract\Crypto\SDK\Http\StatusCode;
use Tesseract\Crypto\SDK\Options\Config;
use Tesseract\Crypto\SDK\Options\HttpClientConfig;

$configs =   $configs[Config::TIMEOUT]);

$sdk = new CryptoSDK($httpClientConfig);

$response = $sdk->auth();

if($response->getStatusCode() == StatusCode::OK)
{
    if($response->getBody()->isReadable())
        echo $response->getBody()->getContents();
}

bash

    # Install Composer
    curl -sS https://getcomposer.org/installer | php
    
bash

    php composer.phar