From c371dff1fbce02e86bf1f45607f8a61f55e83b5c Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Wed, 23 Jan 2019 20:51:05 -0800 Subject: Handle situation where there are no line items TaxJar API is not keen on orders with no line items and will throw errors. --- lib/super_good/solidus_taxjar/tax_calculator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/super_good') 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 -- cgit v1.2.3