summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar
diff options
context:
space:
mode:
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r--lib/super_good/solidus_taxjar/api_params.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/super_good/solidus_taxjar/api_params.rb b/lib/super_good/solidus_taxjar/api_params.rb
index ca346ff..53b2c81 100644
--- a/lib/super_good/solidus_taxjar/api_params.rb
+++ b/lib/super_good/solidus_taxjar/api_params.rb
@@ -85,7 +85,7 @@ module SuperGood
product_tax_code: line_item.tax_category&.tax_code,
unit_price: line_item.price,
discount: discount(line_item),
- sales_tax: line_item.additional_tax_total
+ sales_tax: line_item_sales_tax(line_item)
}
end
}
@@ -112,6 +112,12 @@ module SuperGood
order.additional_tax_total
end
+
+ def line_item_sales_tax(line_item)
+ return 0 if line_item.order.total.zero?
+
+ line_item.additional_tax_total
+ end
end
end
end