{"id":21995752,"url":"https://github.com/ktor/osgi-vat-checker","last_synced_at":"2025-09-07T03:34:43.384Z","repository":{"id":88791865,"uuid":"178553582","full_name":"ktor/osgi-vat-checker","owner":"ktor","description":"OSGi bundles that provide api and implementation of EU VIES VAT number checking service","archived":false,"fork":false,"pushed_at":"2020-05-19T08:22:28.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T04:25:33.065Z","etag":null,"topics":["ds","eu","osgi","osgi-bundle","osgi-declarative-services","osgi-ds","osgi-services","vat","vat-number","vat-validation","vies","vies-soap-service"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-30T12:06:05.000Z","updated_at":"2023-04-06T16:25:24.000Z","dependencies_parsed_at":"2023-06-12T15:15:11.105Z","dependency_job_id":null,"html_url":"https://github.com/ktor/osgi-vat-checker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ktor/osgi-vat-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktor%2Fosgi-vat-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktor%2Fosgi-vat-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktor%2Fosgi-vat-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktor%2Fosgi-vat-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktor","download_url":"https://codeload.github.com/ktor/osgi-vat-checker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktor%2Fosgi-vat-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273992853,"owners_count":25203790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ds","eu","osgi","osgi-bundle","osgi-declarative-services","osgi-ds","osgi-services","vat","vat-number","vat-validation","vies","vies-soap-service"],"created_at":"2024-11-29T21:18:25.665Z","updated_at":"2025-09-07T03:34:43.359Z","avatar_url":"https://github.com/ktor.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Build Status](https://travis-ci.org/synus-org/osgi-vat-checker.svg?branch=master)](https://travis-ci.org/synus-org/osgi-vat-checker)\n[![codecov](https://codecov.io/gh/synus-org/osgi-vat-checker/branch/master/graph/badge.svg)](https://codecov.io/gh/synus-org/osgi-vat-checker)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=osgi-vat-checker\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=osgi-vat-checker)\n# OSGi VIES VAT number validation\n## About\nThe project contains two OSGi bundles that provide online EU VAT number validation with VAT Information Exchange System ([VIES][1]).\n\n1. `vat-checker-api.jar` - Java model for VIES API\n1. `vat-checker-service.jar` - service client that uses classes generated from [WSDL published][2] by VIES\n\n## API\nBundle offers simple Java service interface:\n```java\npackage org.synus.vies.api;\npublic interface VatChecker {\n    VatCheckerResult checkVat(Country country, String vatNumber);\n```\nThe implementation catches all exceptions (logs them with slf4j) and always returns a result instance of type:\n```java\n// ...\npublic class VatCheckerResult {\n\n    private final Country country;\n    private final String vatNumber;\n    private final Optional\u003cLocalDateTime\u003e requestDate;\n    private final boolean valid;\n    private final Optional\u003cString\u003e name;\n    private final Optional\u003cString\u003e address;\n    private final Optional\u003cVatCheckerError\u003e error;\n// ...\n```\n\n## Result and error handling\nReturned `VatCheckerResult` instance can be in following states:\n1. VAT valid: `valid=true`\n1. VAT invalid: `valid=false` and `error` is empty\n1. VAT checker error: `valid=false` and `error` has enum value \n    ```java\n    public enum VatCheckerError {\n        INVALID_INPUT,\n        INVALID_REQUESTER_INFO,\n        SERVICE_UNAVAILABLE,\n        MS_UNAVAILABLE,\n        TIMEOUT,\n        VAT_BLOCKED,\n        IP_BLOCKED,\n        GLOBAL_MAX_CONCURRENT_REQ,\n        GLOBAL_MAX_CONCURRENT_REQ_TIME,\n        MS_MAX_CONCURRENT_REQ,\n        MS_MAX_CONCURRENT_REQ_TIME,\n        UNEXPECTED,\n    }\n    ```\n\n# Installation\nBuild and install both api and implementation jars on your osgi container. \n\n```bash\n$ ./gradlew build # to build both jars jar\n$ cp vat-checker-api/build/libs/vat-checker-api-1.0.0.jar $MY_OSGI_CONTAINER\n$ cp vat-checker-service/build/libs/vat-checker-service-1.0.0.jar $MY_OSGI_CONTAINER\n```\n## Usage\n### Gradle project\n`build.gradle`:\n```gradle\ndependencies {\n    compileOnly 'org.synus.vies:vat-checker-api:1.0.0'\n}\n```\n### Example: Liferay's gogo shell command\n```java\n@Component(\n        property = {\"osgi.command.function=checkvat\", \"osgi.command.scope=blade\"},\n        service = Object.class\n)\npublic class ExampleCommand {\n\n    @Reference\n    private volatile VatChecker vatChecker;\n\n    public void checkvat(String country, String vatNumber) {\n        System.out.println(vatChecker.checkVat(Country.valueOf(country), vatNumber).isValid());\n    }\n\n}\n```\n\n```bash\n$ telnet localhost 11311\nWelcome to Apache Felix Gogo\n\ng! checkvat \"SK\" \"2020216748\"\ntrue\n```\n\n## Contributing\n\nWant to hack on vat-checker? See [CONTRIBUTING.md](CONTRIBUTING.md) for information on building, testing and contributing changes. \n\nThey are probably not perfect, please let me know if anything feels wrong or incomplete.\n\n## License\n\nThe contents of this repository are made available to the public under the terms of the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).\nBundles may depend on non Apache Licensed code.\n\n---\n[1]:http://ec.europa.eu/taxation_customs/vies/\n[2]:http://ec.europa.eu/taxation_customs/vies/technicalInformation.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktor%2Fosgi-vat-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktor%2Fosgi-vat-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktor%2Fosgi-vat-checker/lists"}