summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar/tax_calculator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/super_good/solidus_taxjar/tax_calculator.rb')
-rw-r--r--lib/super_good/solidus_taxjar/tax_calculator.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/super_good/solidus_taxjar/tax_calculator.rb b/lib/super_good/solidus_taxjar/tax_calculator.rb
index e8e12f4..0ddd50f 100644
--- a/lib/super_good/solidus_taxjar/tax_calculator.rb
+++ b/lib/super_good/solidus_taxjar/tax_calculator.rb
@@ -116,20 +116,17 @@ module SuperGood
def cache
if !Rails.env.test?
- Rails.cache.fetch(cache_key, expires_in: 3.hours) { yield }
+ Rails.cache.fetch(
+ cache_key,
+ expires_in: SuperGood::SolidusTaxJar.cache_duration
+ ) { yield }
else
yield
end
end
def cache_key
- APIParams.order_params(order).transform_values do |value|
- case value
- when Array, Hash then value.hash
- else
- value
- end
- end
+ SuperGood::SolidusTaxJar.cache_key.(order)
end
def exception_handler