Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.11 KB

configuration.md

File metadata and controls

38 lines (25 loc) · 1.11 KB

Configuration

The following examples demonstrate how you would add logging capabilities to your Soldo object and what is the configuration required for going live.

Adding a Logger

You can pass a PSR-3 compliant Logger to the Soldo constructor to enable the logging capabilities that came out of the box.

Supposing you are using Monolog:

require_once __DIR__ . '/vendor/autoload.php';

$logger = new \Monolog\Logger('soldo');
$logger->pushHandler(new \Monolog\Handler\StreamHandler(__DIR__ . '/soldo.log', \Monolog\Logger::INFO));

$soldo = new \Soldo\Soldo([
    'client_id' => 'Eu97aMWTV3ta9AchozCozGn15XiX6t5x',
    'client_secret' => 'msNE5I1BnSkWBHPVRJDMYqKvTKRfCS4a',
], $logger);

Going live

All the calls made currently default to the sandbox (aka demo) environment. To go live, simply add these lines:

$soldo = new \Soldo\Soldo([
    'client_id' => 'Eu97aMWTV3ta9AchozCozGn15XiX6t5x',
    'client_secret' => 'msNE5I1BnSkWBHPVRJDMYqKvTKRfCS4a',
    'environment' => 'live'
], $logger);

Next step