PHP code example of wdo / vatidverify

1. Go to this page and download the library: Download wdo/vatidverify 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/ */

    

wdo / vatidverify example snippets


$vatValidate = new \VatValidate\VatValidate(\VatValidate\VatValidate::PROVIDER_VIES_REST); 

$vatValidate = new \VatValidate\VatValidate(\VatValidate\VatValidate::PROVIDER_EVATR);
$response = $vatValidate->simpleValidate('DE123456789', 'DE987654321', true);
echo $response->isValid();
echo $response->getArray();

$vatValidate = new \VatValidate\VatValidate(\VatValidate\VatValidate::PROVIDER_VIES_REST, true);
$valid = $vatValidate->simpleValidate('DE100', '', false, true); // should always return true

$statusArray = (new \VatValidate\Provider\ViesRest())->checkStatus();