hospitable/avalara-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

hospitable/avalara-sdk

最新稳定版本:0.9.0

Composer 安装命令:

composer require hospitable/avalara-sdk

包简介

Interact with Avalara API

README 文档

README

Installation

composer require hospitable/avalara-sdk 

Configuration

config/services.php

return [ 'avalara' => [ 'base_url' => env('AVALARA_SANBOX', true) ? 'https://sandbox-rest.avatax.com' : 'https://rest.avatax.com', 'username' => env('AVALARA_USERNAME'), 'password' => env('AVALARA_PASSWORD'), ], ]; 

.env

AVALARA_SANBOX=true AVALARA_USERNAME= AVALARA_PASSWORD= 

Usage

$avalara = app(\Hospitable\Avalara\AvalaraConnector::class); $avalara->transaction()->create(new CreateTransaction( companyCode: 'DEFAULT', date: CarbonImmutable::parse('2022-10-26'), customerCode: 'ABC', commit: false, currencyCode: 'USD', addresses: new Addresses( singleLocation: new AddressLocationInfo( line1: '5 W 8th St', city: 'New York', region: 'NY', postalCode: '10011', country: 'US', ) ), lines: LineItemCollection::make([ new LineItem( number: '1', quantity: 7, amount: 896, taxCode: 'SL090200', taxIncluded: false, description: 'Lodging accommodation', ), new LineItem( number: '2', quantity: 1, amount: 45, taxCode: 'OF090005', taxIncluded: false, description: 'mandatory cleaning fee', ), ]), parameters: ParameterCollection::make([ new Parameter( name: 'EstablishmentType', value: 'ShortTermRental', ), new Parameter( name: 'NumberOfNights', value: 7, unit: 'Count', ), new Parameter( name: 'NumberOfRoomsInUnit', value: 3, unit: 'Count', ), new Parameter( name: 'NumberOfUnitsForRent', value: 1, unit: 'Count', ), new Parameter( name: 'AvgDailyRate', value: 128, ), ]), )); 

Testing

Copy phpunit.xml.dist to phpunit.xml and customize the AVALARA_USERNAME and AVALARA_PASSWORD.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04