Documentation ¶
Index ¶
Constants ¶
const DefaultIBANBICServiceURL = "https://www.ibanbic.be/IBANBIC.asmx"
DefaultIBANBICServiceURL is the default IBANBIC service URL to use
const DefaultIBANBICTimeout = 5 * time.Second
DefaultIBANBICTimeout is the default timeout to use when checking the bank account number
const DefaultRatesURL = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"
DefaultRatesURL defines the default URL to fetch the exchange rates from
const DefaultVATServiceURL = "http://ec.europa.eu/taxation_customs/vies/services/checkVatService"
DefaultVATServiceURL is the default VAT service URL to use
const DefaultVATTimeout = 5 * time.Second
DefaultVATTimeout is the default timeout to use when checking the VAT service
Variables ¶
var ( // ErrIBANBICServiceUnreachable is the error returned when the IBANBIC service is unreachable ErrIBANBICServiceUnreachable = errors.New("IBANBIC service is unreachable") // ErrIBANBICInvalidInput is the error returned when the bank account number is invalid ErrIBANBICInvalidInput = errors.New("Number is not a valid bank account number") // ErrIBANBICServiceError is the error returned when we get a non-standard error from the IBANBIC service ErrIBANBICServiceError = "IBANBIC service returns an error: " )
var ( // ErrVATnumberNotValid is the error returned when the VAT number is invalid ErrVATnumberNotValid = errors.New("VAT number is not valid") // ErrVATserviceUnreachable is the error returned when the VIES service is unreachable ErrVATserviceUnreachable = errors.New("VAT number validation service is unreachable") // ErrVATNumberTooShort is the error returned when the VAT number is too short ErrVATNumberTooShort = errors.New("VAT number is too short") // ErrVATserviceError is the error returned when we get a non-standard error from the VAT service ErrVATserviceError = "VAT number validation service returns an error: " )
var DefaultTimeout = 5 * time.Second
DefaultTimeout is the default tiemout for the HTTP client
var IBANBICServiceURL = DefaultIBANBICServiceURL
IBANBICServiceURL is the SOAP URL to be used when checking a bank account number
var IBANBICTimeout = DefaultIBANBICTimeout
IBANBICTimeout is the timeout to use when checking the bank account number
var RatesURL = DefaultRatesURL
RatesURL is the URL where to fetch the rates from
var VATServiceURL = DefaultVATServiceURL
VATServiceURL is the SOAP URL to be used when checking a VAT number
var VATTimeout = DefaultVATTimeout
VATTimeout is the timeout to use when checking the VAT service
Functions ¶
func ConvertRate ¶ added in v1.0.4
ConvertRate converts a value from once exchange rate to another
func ExchangeRates ¶
ExchangeRates returs the list exchange rates
Types ¶
type IBANBICInfo ¶ added in v1.0.3
type IBANBICInfo struct { BBAN string // The Belgian Bank Account Number BankName string // The name of the bank which issues the account IBAN string // The IBAN number of the bank account BIC string // The Bank Identification Code of the bank }
IBANBICInfo contains the info about a Belgian Bank Account number
func CheckIBAN ¶ added in v1.0.3
func CheckIBAN(number string) (*IBANBICInfo, error)
CheckIBAN checks the Bank Account Number and returns the IBAN and BIC information
type VATInfo ¶
type VATInfo struct { CountryCode string // The country code VATNumber string // The VAT number IsValid bool // A boolean indicating if the VAT number is valid Name string // The name linked to the VAT number Address string // The address linked to the VAT number }
VATInfo is the info returned about a VAT number