jwohlfert23 / laravel-avalara

A simple Avalara client for modern laravel apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 = '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();

License

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

About

A simple Avalara client for modern laravel apps

License:MIT License


Languages

Language:PHP 100.0%