Swiftpack.co - vapor-community/vatifier as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by vapor-community.
vapor-community/vatifier 1.1.0
Vapor wrapper for verifying VAT-numbers via the VIES service.
⭐️ 2
🕓 3 weeks ago
macOS linux macOS iOS
.package(url: "https://github.com/vapor-community/vatifier.git", from: "1.1.0")

Vatifier

Swift Vapor

Vatifier is a Vapor helper for verifying VAT numbers via the VIES service

Usage

Add the following line to your Package.swift

.package(url: "https://github.com/vapor-community/vatifier.git", from: "1.0.0")

.product(name: "Vatifier", package: "vatifier")

Add this line to your configure.swift file:

import Vatifier

app.vatifier.use(.VIES)

You can now verify VAT numbers from Application or Request

app.vatifier.verify("47458714", country: "DK")
req.vatifier.verify("47458714", country: "DK")

If the API request was successfull you will have a VATVerificationResponse which contains an isValid boolean and optional name and address properties. If the API request failed, the future will be in an error state and a VIESError will be returned.

GitHub

link
Stars: 2
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v1.1.0
1 year ago
  • Add public initializer to VATVerificationResponse #1

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics