项目作者: boomerdigital

项目描述 :
Improve your Solidus store's sales tax decision automation with Avalara AvaTax
高级语言: Ruby
项目地址: git://github.com/boomerdigital/solidus_avatax_certified.git
创建时间: 2016-06-27T17:45:48Z
项目社区:https://github.com/boomerdigital/solidus_avatax_certified

开源协议:BSD 3-Clause "New" or "Revised" License

下载


solidus_avatax_certified

CircleCI

solidus_avatax_certified is the only officially certified AvaTax solution
that integrates with Solidus. With this extension, you can add instantaneous sales tax decisions to
your store.

From Avalara’s own explanation of the certification program:

Relax. It’s certified.

Our “Certified for AvaTax” Program features integrations that perform at the highest level,
providing the best possible customer experience.

Avalara’s partners who have created certified integrations for AvaTax have demonstrated that those
integrations contain elements which are essential to providing customers with easy-to-use software
that gives accurate sales tax calculations. The certification criteria used to demonstrate these
elements are based on Avalara’s years of experience integrating into ERP, ecommerce and
point-of-sale applications.

For Installation and Setup instructions, please visit our wiki.

Installation

1. Install the gem

First of all, install the gem:

  1. $ gem 'solidus_avatax_certified', github: 'boomerdigital/solidus_avatax_certified'
  2. $ bundle install
  3. $ bundle exec rails g solidus_avatax_certified:install

2. Configure the gem

Once you’re done with the setup, you have to configure the gem. You can do this via an initializer
or, for some option, via environment variables. The defaults are shown below:

  1. # config/initializers/avatax.rb
  2. Spree::Avatax::Config.configure do |config|
  3. config.company_code = ENV['AVATAX_COMPANY_CODE']
  4. config.license_key = ENV['AVATAX_LICENSE_KEY']
  5. config.account = ENV['AVATAX_ACCOUNT']
  6. config.environment = ENV['AVATAX_ENVIRONMENT'].presence || (Rails.env.production? ? :production : :sandbox)
  7. config.log = true
  8. config.log_to_stdout = false
  9. config.address_validation = true
  10. config.address_validation_enabled_countries = ['United States', 'Canada']
  11. config.tax_calculation = true
  12. config.document_commit = true
  13. # The origin MUST be a JSON string. An example is shown below:
  14. # { line1: '915 S Jackson St', line2: '', city: 'Montgomery', region: 'AL', postalCode: 36104, country: 'US' }.to_json
  15. config.origin = '{}'
  16. config.refuse_checkout_address_validation_error = false
  17. config.customer_can_validate = false
  18. config.raise_exceptions = false
  19. end

3. Seed the DB

Then, load all seeds:

  1. $ bundle exec rake solidus_avatax_certified:load_seeds

The line above will:

  • Create the entity use codes given to us by Avalara
  • Destroy the Default tax category
  • Create the Clothing and Shipping tax categories
  • Add the Shipping tax category to all shipping methods
  • Add the Clothing tax category to all products
  • Destroy the North America tax rate
  • Create tax rates for Clothing and Shipping
  • Populate the default stock location with a random address

You can also run the following if you only want to load Avalara entity use codes:

  1. $ bundle exec rake solidus_avatax_certified:load_use_codes

4. Adjust your tax categories

AvaTax has a list of tax codes. You should create a tax
category for each tax code used by your store.

The solidus_avatax_certified:load_seeds tax creates two tax categories: Clothing and Shipping.
We invite you to check that the tax categories make sense for your store and that they have the
appropriate tax codes.

If you need to adjust the tax categories or create new ones, the process is:

  1. Create a new tax category, using the appropriate tax code
  2. Create a tax rate for the tax category, use 0.0 as the rate and the Spree/Avalara Transaction
    calculator
  3. Assign products (or shipping methods) to the tax category

Usage

solidus_avatax_certified will automatically calculate sales taxes for any products that belong to
an AvaTax-backed tax category.

Assigning entity use codes to users

If any of your clients require a special entity use code, you can assign it to them from their
profile page in the Solidus backend.

Testing

To run the tests, install the bundle and run rake, which will generate a test app and run all
tests against it:

  1. $ bundle
  2. $ bundle exec rake

License

Copyright (c) 2016-∞ Boomer Digital LLC, released under the New BSD License.