summaryrefslogtreecommitdiff
path: root/lib/super_good
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-01-23 20:51:05 -0800
committerJared Norman <jared@super.gd>2019-01-23 20:51:05 -0800
commitc371dff1fbce02e86bf1f45607f8a61f55e83b5c (patch)
treee1cbf49cbb1d130b3fa91372f2b483024d1b7968 /lib/super_good
parent8c1df35a32722bf654a7428bed4a868b90dfce4e (diff)
Handle situation where there are no line items
TaxJar API is not keen on orders with no line items and will throw errors.
Diffstat (limited to 'lib/super_good')
-rw-r--r--lib/super_good/solidus_taxjar/tax_calculator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/super_good/solidus_taxjar/tax_calculator.rb b/lib/super_good/solidus_taxjar/tax_calculator.rb
index 474f762..0b02569 100644
--- a/lib/super_good/solidus_taxjar/tax_calculator.rb
+++ b/lib/super_good/solidus_taxjar/tax_calculator.rb
@@ -16,7 +16,7 @@ module SuperGood
end
def calculate
- return no_tax if order.tax_address.empty?
+ return no_tax if order.tax_address.empty? || order.line_items.none?
cache do
next no_tax unless taxjar_breakdown