💰 A PHP package to grab up-to-date VAT rates for any European Union member state
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
src
tests
.gitignore
.travis.yml
LICENSE
README.md
composer.json

README.md

European VAT rates

A PHP package to grab up-to-date VAT rates for any European Union member state.

This package uses http://jsonvat.com to obtain its data for the VAT rates.

Installation

Install using Composer :

$ composer require cba85/eu-vat-rates dev-master

Usage

$rates = new Rates;

/**
 * Get VAT rate of a country
 */
$rate = $rates->getRate('FR');

/**
 * Get specific VAT rate of a country
 */
$rate = $rates->getRate('FR', 'reduced2');

You'll find more examples in the example folder.

Tests

If VAT rates evolve, change the results expected.

phpunit --bootstrap vendor/autoload.php tests/RatesTest