PHP code example of advans / php-api-validador

1. Go to this page and download the library: Download advans/php-api-validador 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/ */

    

advans / php-api-validador example snippets


$config = new \Advans\Api\ValidadorCFDI\Config([
    'base_url' => '*************************',
    'key' => '**********************'
]);
$service_validador_cfdi = new \Advans\Api\ValidadorCFDI\ValidadorCFDI($config);

$response = $service_validador_cfdi->validar('...xml...');
if (!$response->valido) {
    echo $response->error['message'];
}