jwohlfert23/laravel-avalara

This is my package laravel-avalara

Downloads

3329

Stars

0

Version

0.2.6

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.

jwohlfert23

Author

jwohlfert23