Skip to content

Commit

Permalink
Merge pull request #135 from spark-solutions/readme-guide
Browse files Browse the repository at this point in the history
Setup instructions
  • Loading branch information
damianlegawiec authored Oct 18, 2019
2 parents f67d203 + 3df0d08 commit 4be0acc
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 44 deletions.
108 changes: 86 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# Spree Avatax (Avalara) Official extension
# Spree Avalara AvaTax official extension

[![Build Status](https://travis-ci.com/spark-solutions/spree_avatax_official.svg?token=svVk6tYzmvo9CARDPUra&branch=master)](https://travis-ci.com/spark-solutions/spree_avatax_official)

The only officially supported Avatax (Avalara) extension for [Spree Commerce](https://spreecommerce.org/) using [Avalara REST API v2](https://developer.avalara.com/api-reference/avatax/rest/v2/).
The new officially supported Avalara AvaTax extension for [Spree Commerce](https://spreecommerce.org/) using [Avalara REST API v2](https://developer.avalara.com/api-reference/avatax/rest/v2/).
* [Introduction](#introduction)
* [Maintenance & support](#maintenance--support)
* [Features](#features)
* [Installation](#installation)
* [Setup](#setup)
* [Migrating from spree_avatax_certified](#migrating-from-spree_avatax_certified)
* [Testing](#testing)
* [Contributing](#contributing)
* [About Spark Solutions](#about-spark-solutions)

## Introduction

Avalara AvaTax is a cloud-based solution automating transaction tax calculations and the tax filing process. Avalara provides real-time tax calculation using tax content from more than 12,000 US taxing jurisdictions and over 200 countries, ensuring your transaction tax is calculated based on the most current tax rules.

The new officially certified Spree AvaTax extension helps Spree users and developers to switch from the old Avalara REST API V1 to the latest [Avalara REST API v2](https://developer.avalara.com/api-reference/avatax/rest/v2/). In the words of Avalara developers "the benefits are huge" as the new API V2 offers improved AvaTax performance, reliability and a wide range of new functionality.

And since AvaTax delivers sales and use tax calculations at the time of checkout or billing — in real time — the business benefits from implementing the new Spree AvaTax V2 extension are significant, potentially improving conversion rates and sales results.

## Maintenance & support

The new extension comes with technical support from both Spree Commerce core team and Avalara and will be maintained to keep up with the innovations introduced by Avalara in the future. The old extension will no longer be maintained or supported.

For more information, support and guidance on how to implement Spree AvaTax V2 extension feel free to:
* reach out through the [Spree contact form](https://spreecommerce.org/contact/)
* join the Spree slack channel #spree-avatax at [slack.spreecommerce.org](http://slack.spreecommerce.org)

## Features

1. Tax calculation (additional/included tax), US state tax, Canadian HST, VAT supported

2. Address validation for US & Canada

3. Commiting complete orders

4. Cancelling (voiding) orders

5. Refunding orders

6. GetByCodeService for getting SalesInvoice for order from Avatax

7. GetTaxService for getting totalTaxCalculated for order from Avatax

8. AvataxLog for logging API calls

9. Caching responses for improved performance

10. Multiple company (store) support

 

Developed and maintained by:

[![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]

## Installation

1. Add this extension to your `Gemfile` with this line:
Expand All @@ -57,10 +67,65 @@ Developed and maintained by:

If your server was running, restart it so that it can find the assets properly.

## Setup

In order to configure tax calculation you need to:
1. [Connect Spree to AvaTax](#connect-spree-to-avatax)
2. [Configure AvaTax settings](#configure-avalara-avatax)
3. [Assign an AvaTax System Tax Code to a Tax Category](#assign-an-avatax-system-tax-code-to-a-tax-category)

### Connect Spree to AvaTax

In order to use `spree_avatax_official` extension, you need to configure your
Avatax credentials. To do so, open spree admin panel and go to **Configurations**
and then **Avatax Settings**.

<img width="1053" alt="Zrzut ekranu 2019-10-15 o 12 46 14" src="https://user-images.githubusercontent.com/581569/66825661-fcd5d000-ef4a-11e9-84b1-993b1a5c1996.png">

Company code, account number and license key can be
configured in the **Avatax Credentials** section of the form.

<img width="1053" alt="Zrzut ekranu 2019-10-16 o 12 20 14" src="https://user-images.githubusercontent.com/581569/66910959-da59ba80-f00f-11e9-8b96-ad2fa45b01ae.png">

* **Account Number:** Provided during your AvaTax account activation process.
* **License Key:** Provided during your AvaTax account activation process.
* **Company Code:** Company profile identifier in the AvaTax Admin Console.

**Service URL** is an URL to connect to the Development or Production AvaTax services. It can be configured in the **Avatax Endpoint urls** section below.

<img width="1053" alt="Zrzut ekranu 2019-10-16 o 12 24 35" src="https://user-images.githubusercontent.com/581569/66911009-fa897980-f00f-11e9-8524-1c64540a9a0f.png">

You can test settings you provided using the **Ping Avatax** button under the form

<img width="1053" alt="Zrzut ekranu 2019-10-16 o 12 25 26" src="https://user-images.githubusercontent.com/581569/66911077-17be4800-f010-11e9-89e0-e1982dd84e25.png">

### Configure Avalara AvaTax

Once connected, you configure additional settings.

<img width="1053" alt="Zrzut ekranu 2019-10-16 o 12 26 54" src="https://user-images.githubusercontent.com/581569/66911217-5c49e380-f010-11e9-86e7-f6fee2f0795d.png">

* **Enable Commiting Transactions:** Enables tax document submission to **Avalara’s AvaTax** service for record keeping. With this setting enabled, transactions will be posted and committed to the **AvaTax Admin Console**.
* **Enable Address Validation:** Option to enable or disable address validation

### Assign an AvaTax System Tax Code to a Tax Category

In order to assign **AvaTax System Tax Code** to **Spree Tax Category**, you need to open **Tax Categories** settings screen (`Configurations -> Tax Categories`), pick up existing or create a new **Tax Category** and fill the **Tax Code** input with the applicable **AvaTax System Tax Code**.

<img width="1053" alt="Zrzut ekranu 2019-10-15 o 12 51 04" src="https://user-images.githubusercontent.com/581569/66825678-095a2880-ef4b-11e9-840c-0a86dbc721b4.png">

If left blank, the **Tax Code** will
default to `P0000000`.

To see a listing of all available **AvaTax System** tax codes, see http://taxcode.avatax.avalara.com

## Migrating from spree_avatax_certified

1. Remove the `spree_avatax_certified` from your `Gemfile`
2. ...
The old extension spree_avatax_certified using the old Avalara REST API V1 will no longer be maintained or supported by the Spree team.

If you need to migrate from the old spree_avatax_certified to the new spree_avatax_official, in order to take advantage of the improved AvaTax performance, reliability and new functionality, there are various ways of ensuring backwards compatibility of Orders (eg. for refund purposes) which were committed to Avatax using the old extension.

Please reach out through the [Spree contact form](https://spreecommerce.org/contact/) to discuss an optimal strategy for your use case.

## Testing

Expand Down Expand Up @@ -97,9 +162,8 @@ It is free software, and may be redistributed under the terms specified in the
[![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]

Spree Avatax Official is maintained by [Spark Solutions Sp. z o.o.](http://sparksolutions.co?utm_source=github) and
funded by [Avalara Inc.](https://www.avalara.com/us/en/index.html). The names and logos are trademarks of Avalara Inc.
supported by [Avalara Inc.](https://www.avalara.com/us/en/index.html). The names and logos are trademarks of Avalara Inc.

We are passionate about open source software.
We are [available for hire][spark].
We are passionate about open source software and [available for hire][spark].

[spark]:http://sparksolutions.co?utm_source=github
50 changes: 28 additions & 22 deletions app/views/spree/admin/avatax_settings/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,75 @@
<div class="yui-u first">
<fieldset>
<legend><%= t('spree_avatax_official.enabled') %></legend>
<p>
<label><%= t('spree_avatax_official.enabled') %></label><br />
<%= hidden_field_tag('enabled', false) %>
<%= check_box_tag('enabled', true, SpreeAvataxOfficial::Config.enabled) %>
</p>
<div class="checkbox">
<label>
<%= hidden_field_tag('enabled', false) %>
<%= check_box_tag('enabled', true, SpreeAvataxOfficial::Config.enabled) %>
<%= t('spree_avatax_official.enabled') %>
</label>
</div>
</fieldset>

<fieldset>
<legend><%= t('spree_avatax_official.avatax_credentials') %></legend>
<p>
<label><%= t('spree_avatax_official.company_code') %></label><br />
<%= text_field_tag('company_code', SpreeAvataxOfficial::Config.company_code, size: 46, maxlength: 256) %>
<%= text_field_tag('company_code', SpreeAvataxOfficial::Config.company_code, size: 46, maxlength: 256, class: 'form-control') %>
</p>

<p>
<label><%= t('spree_avatax_official.account_number') %></label><br />
<%= text_field_tag('account_number', SpreeAvataxOfficial::Config.account_number, size: 46, maxlength: 256) %>
<%= text_field_tag('account_number', SpreeAvataxOfficial::Config.account_number, size: 46, maxlength: 256, class: 'form-control') %>
</p>
<p>
<label><%= t('spree_avatax_official.license_key') %></label><br />
<%= text_field_tag('license_key', SpreeAvataxOfficial::Config.license_key, size: 46, maxlength: 256) %>
<%= text_field_tag('license_key', SpreeAvataxOfficial::Config.license_key, size: 46, maxlength: 256, class: 'form-control') %>
</p>
</fieldset>

<fieldset>
<legend><%= t('spree_avatax_official.endpoint_urls') %></legend>
<p>
<label><%= t('spree_avatax_official.endpoint') %></label><br />
<%= text_field_tag('endpoint', SpreeAvataxOfficial::Config.endpoint, size: 46, maxlength: 256) %>
<%= text_field_tag('endpoint', SpreeAvataxOfficial::Config.endpoint, size: 46, maxlength: 256, class: 'form-control') %>
</p>
</fieldset>

<fieldset>
<legend><%= t('spree_avatax_official.commit_transaction_enabled') %></legend>
<p>
<label><%= t('spree_avatax_official.commit_transaction_enabled') %></label><br />
<%= hidden_field_tag('commit_transaction_enabled', false) %>
<%= check_box_tag('commit_transaction_enabled', true, SpreeAvataxOfficial::Config.commit_transaction_enabled) %>
</p>
<div class="checkbox">
<label>
<%= hidden_field_tag('commit_transaction_enabled', false) %>
<%= check_box_tag('commit_transaction_enabled', true, SpreeAvataxOfficial::Config.commit_transaction_enabled) %>
<%= t('spree_avatax_official.commit_transaction_enabled') %>
</label>
</div>
</fieldset>

<fieldset>
<legend><%= t('spree_avatax_official.address_validation') %></legend>
<p>
<label><%= t('spree_avatax_official.enable_address_validation') %></label><br />
<%= hidden_field_tag('address_validation_enabled', false) %>
<%= check_box_tag('address_validation_enabled', true, SpreeAvataxOfficial::Config.address_validation_enabled) %>
<div class="checkbox">
<label>
<%= hidden_field_tag('address_validation_enabled', false) %>
<%= check_box_tag('address_validation_enabled', true, SpreeAvataxOfficial::Config.address_validation_enabled) %>
<%= t('spree_avatax_official.enable_address_validation') %>
</label>
</p>
</fieldset>

<fieldset>
<legend><%= t('spree_avatax_official.ship_from_address') %></legend>
<p>
<label><%= Spree.t('address1') %></label><br />
<%= text_field_tag('ship_from[line1]', @ship_from_address[:line1], size: 46, maxlength: 256) %>
<%= text_field_tag('ship_from[line1]', @ship_from_address[:line1], size: 46, maxlength: 256, class: 'form-control') %>
</p>
<p>
<label><%= Spree.t('address2') %></label><br />
<%= text_field_tag('ship_from[line2]', @ship_from_address[:line2], size: 46, maxlength: 256) %>
<%= text_field_tag('ship_from[line2]', @ship_from_address[:line2], size: 46, maxlength: 256, class: 'form-control') %>
</p>
<p>
<label><%= Spree.t('city') %></label><br />
<%= text_field_tag('ship_from[city]', @ship_from_address[:city], size: 46, maxlength: 256) %>
<%= text_field_tag('ship_from[city]', @ship_from_address[:city], size: 46, maxlength: 256, class: 'form-control') %>
</p>
<p>
<label><%= Spree.t('country') %></label><br />
Expand All @@ -82,7 +88,7 @@
<% end %>
<p>
<label><%= Spree.t('postalcode') %></label><br />
<%= text_field_tag('ship_from[postal_code]', @ship_from_address[:postalCode], size: 46, maxlength: 25) %>
<%= text_field_tag('ship_from[postal_code]', @ship_from_address[:postalCode], size: 46, maxlength: 25, class: 'form-control') %>
</p>
</fieldset>
</div>
Expand Down

0 comments on commit 4be0acc

Please sign in to comment.