Skip to content

spree-contrib/spree_avior_tax

Repository files navigation

SpreeAviorTax

Spree:AviorTax is a US sales tax extension for Spree using the Avior Tax Service.

Prerequisites

  1. Create new account with Avior

  2. Once you create your account, you will have access to the following details:

    • username
    • password
    • service url
    • company name
    • seller id
    • seller location id
    • seller state
    • customer entity code

Installation

  1. Add this extension to your Gemfile with this line:

    gem 'spree_avior_tax', github: 'spree-contrib/spree_avior_tax'
  2. Install the gem using Bundler

    bundle install
  3. Copy & run migrations

    bundle exec rails g spree_avior_tax:install
  4. Restart your server

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

Setup

In order to setup Avior Tax, you need to do the following:

  1. Navigate to Avior Settings Admin Page. You can find it in the Configuration Settings Tab when you login as an admin.

  2. Once you are there, you'll need to login to your authenticate to Avior Tax and retrieve a authentication token. This can be conviniently done through the Avior Tax Settings.

    • In the Basic Settings section of the page, provide the Service URL, Username and Password and then click the Login button. If the details are correct, you'll get a token that will be visible in the Token field in the General Settings section.
    • In the General Settings section, provide the Company Name, Seller (Id), Seller Location (Id), Seller State, and Customer Entity Code.
    • That's all.
  3. Create a tax rate with Avior Tax as the calculator.

    • Go to the Tax Rates section, and click the 'New Tax Rate' button.
    • Fill in the all the required details. Note that the tax rate is required, even though Avior Tax will provide the final tax rate and amount.
    • Select Avior Tax from the list of calculators.
    • Click 'Create' button.
  4. That's all

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle update
bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_avior_tax/factories'

Releasing

bundle exec gem bump -p -t
bundle exec gem release

For more options please see gem-release README

Contributing

If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.

Copyright (c) 2023 [name of extension creator], released under the New BSD License