Skip to content

Commit

Permalink
Merge pull request #2 from evertharmeling/develop
Browse files Browse the repository at this point in the history
Added README
  • Loading branch information
Evert Harmeling committed Jun 11, 2017
2 parents eb82c6d + 0c5415d commit 6d3a109
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 7 deletions.
24 changes: 24 additions & 0 deletions README.md
@@ -1,4 +1,28 @@
VATClient
===================

[![Latest Stable Version](https://img.shields.io/packagist/v/evertharmeling/vat-client.svg?style=flat-square)](https://packagist.org/packages/evertharmeling/vat-client)
[![Build Status](https://travis-ci.org/evertharmeling/vat-client.png?branch=master)](https://travis-ci.org/evertharmeling/vat-client)

This libray supports validating a vat number and getting the info about a taxable object. The library uses the `http://www.controleerbtwnummer.nl/` API to retrieve the info and validation.
The `http://www.controleerbtwnummer.nl/` API relies on the [VIES/EU](http://ec.europa.eu/taxation_customs/vies/?locale=en) service and thus supports VAT numbers from all EU-countries.

## Installation

`composer install evertharmeling/vat-client`

## Usage

It's required to use a PSR-7 supported HTTPClient like `guzzle` (^6.0) to inject in the `Client`.

```php
$client = new VIESApi\Client\Client(new GuzzleHttp\Client(), VIESApi\Parser\VATParser());

try {
$taxableObject = $client->getInfo('<VATNumber>');

var_dump($taxableObject);
catch (TaxableObjectNotFoundException $e) {
// VAT number not found
}
```
2 changes: 1 addition & 1 deletion src/VIESApi/Client/Client.php
Expand Up @@ -11,7 +11,7 @@
use VIESApi\Parser\VATParser;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
class Client
{
Expand Down
2 changes: 1 addition & 1 deletion src/VIESApi/Exception/InvalidResponseException.php
Expand Up @@ -3,7 +3,7 @@
namespace VIESApi\Exception;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
class InvalidResponseException extends \Exception implements VIESApiExceptionInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/VIESApi/Exception/TaxableObjectNotFoundException.php
Expand Up @@ -3,7 +3,7 @@
namespace VIESApi\Exception;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
class TaxableObjectNotFoundException extends \Exception implements VIESApiExceptionInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/VIESApi/Exception/VIESApiExceptionInterface.php
Expand Up @@ -3,7 +3,7 @@
namespace VIESApi\Exception;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
interface VIESApiExceptionInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/VIESApi/Model/TaxableObject.php
Expand Up @@ -3,7 +3,7 @@
namespace VIESApi\Model;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
class TaxableObject
{
Expand Down
2 changes: 1 addition & 1 deletion src/VIESApi/Parser/VATParser.php
Expand Up @@ -5,7 +5,7 @@
use VIESApi\Model\TaxableObject;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
class VATParser
{
Expand Down
2 changes: 1 addition & 1 deletion tests/VIESApi/Client/ClientTest.php
Expand Up @@ -8,7 +8,7 @@
use VIESApi\Parser\VATParser;

/**
* @author Evert Harmeling <evert@freshheads.com>
* @author Evert Harmeling <evertharmeling@gmail.com>
*/
class ClientTest extends \PHPUnit_Framework_TestCase
{
Expand Down

0 comments on commit 6d3a109

Please sign in to comment.