<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require_once __DIR__ . '/../services/facto/FactoClient.php';

header('Content-Type: text/plain; charset=utf-8');

try {
    echo "Iniciando test FACTO DOCUMENTS..." . PHP_EOL;

    $client = new FactoClient();

    $response = $client->getDocuments(array(
        'page' => 1,
        'per_page' => 5,
        'received_issued_flag' => 1,
        'document_status' => 1,
        'order_by' => 'desc'
    ));

    echo "OK DOCUMENTS" . PHP_EOL;
    echo "Respuesta:" . PHP_EOL;
    print_r($response);

} catch (Exception $e) {
    echo "ERROR DOCUMENTS" . PHP_EOL;
    echo $e->getMessage() . PHP_EOL;
}