<?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 {
    $id = isset($_GET['id']) ? (int) $_GET['id'] : 0;

    if ($id <= 0) {
        die('298');
    }

    $client = new FactoClient();
    $response = $client->getCustomerSupplier($id);

    print_r($response);

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