Giter Club home page Giter Club logo

ex_vatcheck's Introduction

ExVatcheck

An Elixir Package for verifying VAT identification numbers using the VIES service.

Usage

To validate a VAT identification number, simply run:

iex(1)> ExVatcheck.check("GB333289454")
%ExVatcheck.VAT{
  exists: true,
  valid: true,
  vies_available: true,
  vies_response: %{
    address: "BC0 B1 D1 BROADCAST CENTRE\nWHITE CITY PLACE\n201 WOOD LANE\nLONDON\n\nW12 7TP",
    country_code: "GB",
    name: "BRITISH BROADCASTING CORPORATION",
    request_date: "2019-04-06",
    valid: true,
    vat_number: "333289454"
  }
}

Installation

If available in Hex, the package can be installed by adding ex_vatcheck to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_vatcheck, "~> 0.3.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_vatcheck.

Development

Testing

To run the full test suite, run:

$ mix test

To run the test suite with a code coverage report, run:

$ mix test --cover

Linting

To run the linter, run:

$ mix credo

Type Analysis

To run static type analysis on the project using Dialyzer, run the following command:

$ mix dialyzer

The first time this command is run, it will first generate the PLT for the Elixir standard library. It can take a little while, but subsequent Dialyzer runs should be take a fraction of the time. The compiled PLT is saved at ~/.dialyxir_core_${OTP_VERSION}_${ELIXIR_VERSION}.plt. More information about the PLT can be found here: https://github.com/jeremyjh/dialyxir#plt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.