ExVatcheck.VIESClient (ExVatcheck v0.3.1) View Source

The ExVatcheck.Vies module provides a client for the VIES VAT identification number service.

Link to this section Summary

Functions

Queries the VIES service to determine whether or not the provided VAT identification number is valid.

Returns a new VIES client struct which can be used to make requests in check_vat/3. If the VIES service times out, or if invalid WSDL is returned and the checkVat service URL cannot be parsed, an error is returned.

Link to this section Types

Specs

t() :: %ExVatcheck.VIESClient{url: binary()}

Link to this section Functions

Link to this function

check_vat(client, country_code, vat_number)

View Source

Specs

check_vat(t(), binary(), binary()) ::
  {:ok, map()} | {:error, binary()} | {:error, HTTPoison.Error.t()}

Queries the VIES service to determine whether or not the provided VAT identification number is valid.

Returns {:ok, response} in the case of a successful call to the service, and {:error, error} in the case that the service could not be reached or the XML response could not be parsed.

Specs

new() :: {:ok, t()} | {:error, any()}

Returns a new VIES client struct which can be used to make requests in check_vat/3. If the VIES service times out, or if invalid WSDL is returned and the checkVat service URL cannot be parsed, an error is returned.