PHP code example of reportei / gerencianet-sdk-php-fork

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

    

reportei / gerencianet-sdk-php-fork example snippets




use Gerencianet\Gerencianet;

try {
  /* code */
} catch(GerencianetException $e) {
  /* Gerencianet's api errors will come here */
} catch(Exception $ex) {
  /* Other errors will come here */
}

$options = [
  'client_id' => 'client_id',
  'client_secret' => 'client_secret',
  'sandbox' => true,
  'timeout' => 30
];

$api = new Gerencianet($options);

$options = [
  'client_id' => 'client_id',
  'client_secret' => 'client_secret',
  'sandbox' => false
  'timeout' => 30
];

$api = new Gerencianet($options);

$ phpunit -c config.xml

php -S localhost:9000

$ composer 

...
"erencianet/gerencianet-sdk-php": "2.*"
},
...

php 5.5, 5.6, 7.0 and 7.1