summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-01-21 20:57:29 -0800
committerJared Norman <jared@super.gd>2019-01-21 21:08:50 -0800
commit40b63f8f069b6d869619bbfcb1554a7e7cbcbe57 (patch)
tree32a576e4f61e59a36111912b232622fd4f094780 /README.md
parentd5b84c70cfad6bcb98bee422ce2865dbf8ae386f (diff)
Handle errors gracefully
Diffstat (limited to 'README.md')
-rw-r--r--README.md36
1 files changed, 30 insertions, 6 deletions
diff --git a/README.md b/README.md
index ad11782..3e2c0a7 100644
--- a/README.md
+++ b/README.md
@@ -6,15 +6,39 @@ This is not a fork of [spree_taxjar](https://github.com/vinsol-spree-contrib/spr
## Installation
-Add this line to your application's Gemfile:
+1. Add this line to your application's Gemfile:
-```ruby
-gem 'super_good-solidus_taxjar'
-```
+ ```ruby
+ gem 'super_good-solidus_taxjar'
+ ```
-And then execute:
+ And then execute:
- $ bundle
+ $ bundle
+
+2. Next, configure Solidus to use this gem:
+
+ ```ruby
+ # 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:
+
+ ```ruby
+ # 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(exception)
+ }
+ ```
+
+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