Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
/ checkvat Public archive

A simple Scala library that checks EU VAT numbers.

Notifications You must be signed in to change notification settings

aksiksi/checkvat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CheckVAT

A Scala library that checks for the validity of a given EU VAT as defined by the VIES specification.

Build

Install the latest version of sbt, then run: sbt compile.

Test

Simply run: sbt test.

Usage

Below is a fully working Scala snippet that demonstrates how to use the library:

import me.assil.checkvat.CheckVAT

class Main extends App {
  // Create new instance for checking
  val checker = new CheckVAT
  
  // Let's check a Swedish VAT number
  val c1 = checker.check("556188840401", "SE")
  
  // We can also check the same number without specifying the ISO country code
  val c2 = checker.check("556188840401")
  
  assert(c1 == c2 == true)
}

Commercial Use

If you would like a more permissive license for use in a commercial project, feel free to contact me.

About

A simple Scala library that checks EU VAT numbers.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages