定制 billingserv/uk-vat-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

billingserv/uk-vat-validator

最新稳定版本:v1.0.3

Composer 安装命令:

composer require billingserv/uk-vat-validator

包简介

A Composer package to validate UK VAT numbers using the HMRC API.

README 文档

README

BillingServ

VAT Validator is a Composer package developed by BillingServ that allows UK businesses to verify VAT numbers using the HMRC VAT API. This package supports both live and sandbox environments.

Features

  • Verify UK VAT numbers.
  • Obtain a consultation number when a business needs to verify a customer's VAT number.
  • Supports live and sandbox environments.
  • Fully open-source and free to use.

Installation

Requirements

  • PHP 8.0+
  • Composer
  • Laravel

Install via Composer

composer require billingserv/uk-vat-validator

Publish Configuration (Laravel Only)

php artisan vendor:publish --tag=config

Configuration

After installation, add your HMRC API credentials to your .env file:

HMRC_CLIENT_ID=your-client-id
HMRC_CLIENT_SECRET=your-client-secret
HMRC_GRANT_TYPE=client_credentials
HMRC_SCOPE=read:vat
HMRC_USE_SANDBOX=true  # Set to false for live mode

Usage

1. Verify a VAT Number

use VatValidator\VatValidatorService;

$vatService = app(VatValidatorService::class);
$result = $vatService->verifyVatNumber('553557881');
print_r($result);

2. Obtain a Consultation Number

$consultation = $vatService->getConsultationNumber('553557881', '948561936944');
print_r($consultation);

Live and Sandbox Mode

Set HMRC_USE_SANDBOX=true in the .env file to enable sandbox mode. If set to false, the package will use live mode automatically.

Testing

To run tests, use PHPUnit:

vendor/bin/phpunit

License

This package is open-source and available for everyone to use under the MIT License.

Credits

Developed by BillingServ. Contributions are welcome!

Support

For issues, please open an issue on GitHub or contact support@billingserv.com.

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-04