vat-0.1.0 doesn't have any documentation.
VAT
Introduction
This a module to validate the format and the existence of a VAT number. It queries the VIES api which is terribly unstable and will often have one of the country not available.
It also contains the current VAT rates of the EU countries. It doesn't contain any historical data or the reduced rates.
TODO: see what the api returns when country db is down
Installation
Add the following to Cargo.toml:
= "0.1"
Usage
VAT number validation
use ;
// vat_number should contian the country code
// it can contain spaces or dashes, those will be stripped by `vat`
Look at src/errors.rs
for the kind of error that could happen.
In the case above we are only doing verification but the validate_vat_number
function will return
the information for that company as the following struct:
Get VAT rates
use ;
// casing is not important
let fr_rate = get_rate.unwrap;
let all_rates = get_all_rates;