https://github.com/aksiksi/checkvat
A simple Scala library that checks EU VAT numbers.
https://github.com/aksiksi/checkvat
java scala vat vat-validator
Last synced: 4 months ago
JSON representation
A simple Scala library that checks EU VAT numbers.
- Host: GitHub
- URL: https://github.com/aksiksi/checkvat
- Owner: aksiksi
- Archived: true
- Created: 2017-05-22T03:19:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-03T10:40:48.000Z (almost 8 years ago)
- Last Synced: 2025-01-29T05:46:27.287Z (5 months ago)
- Topics: java, scala, vat, vat-validator
- Language: Scala
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```scala
import me.assil.checkvat.CheckVATclass 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](https://twitter.com/aksiksi).