Skip to content

Validate VAT numbers by using regular expressions and the VIES (VAT Information Exchange System) service

License

Notifications You must be signed in to change notification settings

florowebdevelopment/vat-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

This package is deprecated and will not be maintained.

VAT Validator

Total Downloads Latest Stable Version License StyleCI

This library validate VAT numbers by using regular expressions and the VIES (VAT Information Exchange System) service.

Install

composer require florowebdevelopment/vat-validator

Usage

use Florowebdevelopment\VatValidator\VatValidator;
$oVatValidator = new VatValidator;

$oVatValidator->validate('NL821783981B01'); // true

if ($oVatValidator->isValid()) {
    $aMetaData = $oVatValidator->getMetaData();
    
    /*
    array(
        "name" => "FLORO WEBDEVELOPMENT B.V.",
        "address" => "WESTBLAAK 00180 3012KN ROTTERDAM"
    )
    */
}

Strict (optional)

When strict is set to FALSE, the VAT number validation returns TRUE if the VIES service is not available (CURL timeout or SoapFault).

$oVatValidator->setStrict(false); // default = true

Comments

We suggest that you cache the valid VAT numbers in your application to prevent multiple requests to the VIES service.

About

Validate VAT numbers by using regular expressions and the VIES (VAT Information Exchange System) service

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages