Sha256: d2565fa313062b2ee70602d7c6ac9b6e5accc4bee0f4bd3017194697150475c4

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

== valvat

Validates european vat numbers. Supports simple syntax verification and lookup via the VIES web service.

== Installation

  gem install valvat

== Basic Usage

To verify the syntax of a vat number:

  Valvat::Syntax.validate("DE345789003")
  => true or false
  
To check if the given vat number exists:

  Valvat::Lookup.validate("DE345789003")
  => true or false or nil
  
Keep in mind that the VIES webservice might be offline at some time for some countries. If this happens Valvat::Lookup.validate returns nil.

See http://ec.europa.eu/taxation_customs/vies/viesspec.do for more accurate information at what time the service for a specific country will be down.

== Utilities

To split a vat number into the ISO country code and the remaining chars:

  Valvat::Utils.split("ATU345789003")
  => ["AT", "U345789003"]
  
_split_ always returns an array. If it can not detect the country it returns [nil, nil].

To normalize a vat number:

  Valvat::Utils.normalize("atu345789003")
  => "ATU345789003"
  
This basically just removes trailing spaces and ensures all chars are upcase.

== Links

* http://ec.europa.eu/taxation_customs/vies
* http://www.bzst.de/DE/Steuern_International/USt_Identifikationsnummer/Merkblaetter/Aufbau_USt_IdNr.html (german)
* http://en.wikipedia.org/wiki/European_Union_Value_Added_Tax

== BlaBla

Copyright (c) 2011 Yolk Sebastian Munz & Julia Soergel GbR

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
valvat-0.0.2 README.rdoc