Skip to content

Validate a VAT number against the official European Commission VIES VAT number validation SOAP service.

Notifications You must be signed in to change notification settings

vmanchev/vat-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VAT validator

Validate a VAT number against the official European Commission VIES VAT number validation SOAP service.

Prerequisites

  1. PHP version 7 and above.
  2. php7.x-soap extension

How to install

composer require "toxicdigital/vat-validator"

How to use

use Toxic\Validator\Vat as VatValidator;

$validator = VatValidator::getInstance();

//Returns true or false
$validator->isValid("XY123456789");

//If VAT number is valid, company info is available
$validator->getCompany();

/*
 * Toxic\Validator\Vat\Company Object
 * (
 *   [name] => John Doe
 *   [address] => 123 Main St, Anytown, UK
 *   [vatNumber] => 100
 *   [countryCode] => GB
 *   [valid] => true
 * )
 */

About

Validate a VAT number against the official European Commission VIES VAT number validation SOAP service.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages