oscar-team/avatax-laravel
最新稳定版本:v1.4
Composer 安装命令:
composer require oscar-team/avatax-laravel
包简介
A Laravel package for Avalara AvaTax SDK integration
README 文档
README
This package provides an integration with Avalara's AvaTax API for Laravel applications. It includes services for handling transactions, tax codes, tax rules, and more.
Installation
Step 1: Install the Package
You can install the package via Composer:
composer require oscar-team/avatax-laravel
Step 2: Publish the Configuration
Publish the package configuration using the following Artisan command:
php artisan vendor:publish --provider="OscarTeam\AvaTax\AvaTaxServiceProvider"
Step 3: Configure AvaTax
Add your Avalara credentials to the .env file:
AVATAX_APP_NAME=demo AVATAX_APP_VERSION=1 AVATAX_MACHINE_NAME=localhost AVATAX_ACCOUNT_ID=your_account_id AVATAX_LICENSE_KEY=your_license_key AVATAX_ENVIRONMENT=sandbox # or production
Usage
Example 1: Creating a Simple Transaction
use OscarTeam\AvaTax\Facades\AvaTax; use Avalara\DocumentType; // Create a new transaction $transaction = AvaTax::createTransaction([ 'companyCode' => 'DEFAULT', 'type' => DocumentType::C_SALESINVOICE, 'customerCode' => 'ABC', 'addresses' => [ 'SingleLocation' => [ 'line1' => '123 Main Street', 'city' => 'Irvine', 'region' => 'CA', 'postalCode' => '92615', 'country' => 'US' ] ], 'lines' => [ [ 'amount' => 100.0, 'quantity' => 1, 'itemCode' => 'P0000000' ] ] ]); echo '<pre>' . json_encode($transaction, JSON_PRETTY_PRINT) . '</pre>';
统计信息
- 总下载量: 1.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-07