LaravelPackages.net
Acme Inc.
Toggle sidebar
jwohlfert23/laravel-avalara

This is my package laravel-avalara

14.676
0
0.3.5
About jwohlfert23/laravel-avalara

jwohlfert23/laravel-avalara is a Laravel package for this is my package laravel-avalara. It currently has 0 GitHub stars and 14.676 downloads on Packagist (latest version 0.3.5). Install it with composer require jwohlfert23/laravel-avalara. Discover more Laravel packages by jwohlfert23 or browse all Laravel packages to compare alternatives.

Last updated

Simple Avalara Client for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

We built this client because of problems with the existing SDK provided by Avalara:

  1. Lack of support for PHP8.
  2. No transformation of responses to PHP models/objects.
  3. Avalara only has a 99.5% SLA, and we thought built-in retries for certain endpoints would be helpful.

Installation

You can install the package via composer:

composer require jwohlfert23/laravel-avalara

You should publish the config file:

php artisan vendor:publish --tag="avalara-config"

Usage

$transaction = new CreateTransaction();

$transaction->date = now();
$transaction->type = AvalaraDocType::SALES_ORDER;
$transaction->customerCode = '[email protected]';

$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();

License

The MIT License (MIT). Please see License File for more information.

Star History Chart