PHP code example of aanndryyyy / e-financials-php-client

1. Go to this page and download the library: Download aanndryyyy/e-financials-php-client 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/ */

    

aanndryyyy / e-financials-php-client example snippets




nt = EFinancials::factory()
    ->withApiKeyId('api_key_id')
    ->withApiKeyPublic('api_key_public')
    ->withApiKeyPassword('api_key_password')
    // ->withBaseUri('https://demo-rmp-api.rik.ee') // default demo
    ->make();

$currencies = $client->currencies()->all();
$clients = $client->clients()->all();

print_r($currencies->toArray());
print_r($clients->toArray());
print_r($client->salesInvoices()->all());
print_r($client->journals()->all());

$client = EFinancials::client('api_key_id', 'api_key_public', 'api_key_password');

use EFinancialsClient\Responses\Currencies\ListResponse;
use EFinancialsClient\Testing\ClientFake;

$client = new ClientFake([
    ListResponse::fake(),
]);

$response = $client->currencies()->all();
$client->assertSent('currencies');
$client->assertSentTimes('currencies', 1);