承接 alxdorosenco/vatlayer-for-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

alxdorosenco/vatlayer-for-laravel

最新稳定版本:v1.0.1

Composer 安装命令:

composer require alxdorosenco/vatlayer-for-laravel

包简介

This package helps working with VatLayer service on the Laravel framework

README 文档

README

This is a package of the service Vatlayer adapted for Laravel framework. You can find additional information in the documentation via this link

https://vatlayer.com/documentation

How to install?

  1. First of all you need to install the package:
    composer require alxdorosenco/vatlayer-for-laravel
    
  2. Next, you need to put access key in your .env file:
    VATLAYER_ACCESS_KEY=<vatlayer access key>
    
  3. Also, you can export config file of the package
    php artisan vendor:publish --provider="AlxDorosenco\VatlayerForLaravel\VatlayerServiceProvider" --tag="config"
    

Endpoint 1: Simple VAT number validation

"validate" endpoint

Vatlayer::validate()->setVatNumber('LU26375245')->toArray();
Vatlayer::validate()->setVatNumber('LU26375245')->setFormat(1)->toJson();
Vatlayer::validate()
                ->setVatNumber('LU26375245')
                ->setCallback('CALLBACK_FUNCTION')
                ->setFormat(1)
                ->toJson();

Endpoint 2: VAT rate for single EU member state

"rate" endpoint - via country code

Vatlayer::rate()->setCountryCode('GB')->toArray();
Vatlayer::rate()->setCountryCode('GB')->setFormat(1)->toJson();

"rate" endpoint - via custom IP address

Vatlayer::rate()->setIpAddress('176.249.153.36')->toArray();
Vatlayer::rate()->setIpAddress('176.249.153.36')->setFormat(1)->toJson();

"rate" - get EU VAT rate for a specific country - via client IP address

Vatlayer::rate()->setCountryCode('GB')->setClientIp(1)->toArray();
Vatlayer::rate()->setCountryCode('GB')->setClientIp(1)->toJson();

Endpoint 3: VAT rates for all EU member states

"rate_list" endpoint

Vatlayer::rateList()->toArray();
Vatlayer::rateList()->setFormat(1)->toJson();

Endpoint 4: Price calculation

"price" endpoint

Vatlayer::price()->setAmount(100)
                ->setCountryCode('GB')
                ->setType('medical')
                ->setIncl(1)
                ->toArray();
                
Vatlayer::price()->setAmount(100)
                ->setCountryCode('GB')
                ->setType('medical')
                ->setIncl(1)
                ->setFormat(1)
                ->toJson();

Endpoint 5: Reduced VAT Rates - Types of Goods

"types" endpoint

Vatlayer::types()->toArray();
Vatlayer::types()->setFormat(1)->toJson();

License

Released under the MIT License, see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-11