Skip to content

Support for using TaxJar to handle tax calculations in Solidus

License

Notifications You must be signed in to change notification settings

Printavo/solidus_taxjar

 
 

Repository files navigation

Warning: This extension is under active development and not yet at a v1.0 release.

SuperGood::SolidusTaxJar Build Status

SuperGood::SolidusTaxJar is a Solidus extension that allows Solidus stores to use TaxJar for tax calculations.

This is not a fork of spree_taxjar, like solidus_taxjar. Instead, SuperGood::SolidusTaxJar uses the new configurable tax system introduced by @adammathys in Solidus 2.4.

Installation

  1. Add this line to your application's Gemfile:

    gem 'super_good-solidus_taxjar'

    And then execute:

    $ bundle
    
  2. Next, configure Solidus to use this gem:

    # Put this in config/initializers/solidus.rb
    
    Spree.config do |config|
      config.tax_calculator_class = SuperGood::SolidusTaxJar::TaxCalculator
    end
  3. Also, configure your error handling:

    # Put this in config/initializers/taxjar.rb
    
    SuperGood::SolidusTaxJar::TaxCalculator.exception_handler = ->(e) {
      # Report exceptions in here. For example, if you were using the Sentry's
      # raven-ruby gem to report errors, you might do this:
      Raven.capture_exception(e)
    }
  4. Finally, make sure that the TAXJAR_API_KEY environment variable is set to a your TaxJar API key and make sure that you have a Spree::TaxRate with the name "Sales Tax". This will be used as the source for the tax adjustments that Solidus creates.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/SuperGoodSoft/solidus_taxjar. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the SuperGood::SolidusTaxjar project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Support for using TaxJar to handle tax calculations in Solidus

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 99.7%
  • Shell 0.3%