jwohlfert23 / laravel-avalara
这是我的包 laravel-avalara
0.2.6
2024-03-19 11:39 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.4|^8.0
- illuminate/contracts: ^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- nunomaduro/collision: ^6.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-19 12:52:00 UTC
README
我们构建这个客户端是因为现有Avalara提供的SDK存在问题
- 不支持PHP8。
- 没有将响应转换为PHP模型/对象。
- Avalara的SLA只有99.5%,我们认为为某些端点内置重试功能会有帮助。
安装
您可以通过composer安装此包
composer require jwohlfert23/laravel-avalara
您应该发布配置文件
php artisan vendor:publish --tag="avalara-config"
使用方法
$transaction = new CreateTransaction(); $transaction->date = now(); $transaction->type = AvalaraDocType::SALES_ORDER; $transaction->customerCode = 'jack@gmail.com'; $transaction->addresses['ShipFrom'] = new \App\Services\Avalara\Models\AddressModel(); $transaction->addresses['ShipTo'] = new \App\Services\Avalara\Models\AddressModel(); $transaction->lines[] = new CreateLineItem( number: 0, amount: 50.00, quantity: 2, taxCode: 'P0000000' ); return AvalaraClient::createTransaction($transaction); // or return $transaction->create();
许可
MIT许可(MIT)。请参阅许可文件获取更多信息。