drahosistvan / vatvalidation

A simple wrapper for VIES VAT Validation WebService.
MIT License
13 stars 6 forks source link

VAT Validation package for PHP

Build Status codecov Latest Stable Version Total Downloads StyleCI License

Installation

Simply require the package via composer: composer require drahosistvan/vatvalidation

How to use

$validation = new VatValidation();
$validation->validate('UK123321213');

if ($validation->valid) {
    print $validation->name;
    print $validation->address;
    print $validation->countryCode;
    print $validation->vatNumber;
    print $validation->valid;
}

It has a toArray method, so you can cast the validation data to an array.

$validation = new VatValidation();
$validation->validate('UK123321213');
var_dump($validation->toArray());