super_good-solidus_taxjar 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a82704376f8b817673d0c0565ec13285644b4317a9b303615c82584aebb226a
|
4
|
+
data.tar.gz: 0f033f36b7a588b8363af52917ccb58bc95379f3be780dd1f78a5f512bf082db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 695e4267b668489ad5c0a9f9a18000093cdb94e5ae53be5cfc95ea7024ea25dc8cb5a291404dfafd634942bd921524da94d05341f624cdf484c31193026daa70
|
7
|
+
data.tar.gz: 4aa9373711d1d614f0a188db24fffe4f329d43b069677d272aff3b2caf82a9eb4e3333a90d3b64a90d5931104fad8952673628c371aad34a270335935089bd96
|
data/CHANGELOG.md
CHANGED
@@ -116,20 +116,17 @@ module SuperGood
|
|
116
116
|
|
117
117
|
def cache
|
118
118
|
if !Rails.env.test?
|
119
|
-
Rails.cache.fetch(
|
119
|
+
Rails.cache.fetch(
|
120
|
+
cache_key,
|
121
|
+
expires_in: SuperGood::SolidusTaxJar.cache_duration
|
122
|
+
) { yield }
|
120
123
|
else
|
121
124
|
yield
|
122
125
|
end
|
123
126
|
end
|
124
127
|
|
125
128
|
def cache_key
|
126
|
-
|
127
|
-
case value
|
128
|
-
when Array, Hash then value.hash
|
129
|
-
else
|
130
|
-
value
|
131
|
-
end
|
132
|
-
end
|
129
|
+
SuperGood::SolidusTaxJar.cache_key.(order)
|
133
130
|
end
|
134
131
|
|
135
132
|
def exception_handler
|
@@ -11,21 +11,33 @@ require "super_good/solidus_taxjar/discount_calculator"
|
|
11
11
|
module SuperGood
|
12
12
|
module SolidusTaxJar
|
13
13
|
class << self
|
14
|
+
attr_accessor :cache_duration
|
15
|
+
attr_accessor :cache_key
|
14
16
|
attr_accessor :discount_calculator
|
15
|
-
attr_accessor :test_mode
|
16
17
|
attr_accessor :exception_handler
|
17
|
-
attr_accessor :taxable_address_check
|
18
|
-
attr_accessor :shipping_tax_label_maker
|
19
18
|
attr_accessor :line_item_tax_label_maker
|
19
|
+
attr_accessor :shipping_tax_label_maker
|
20
|
+
attr_accessor :taxable_address_check
|
21
|
+
attr_accessor :test_mode
|
20
22
|
end
|
21
23
|
|
24
|
+
self.cache_duration = 3.hours
|
25
|
+
self.cache_key = ->(order) {
|
26
|
+
APIParams.order_params(order).transform_values do |value|
|
27
|
+
case value
|
28
|
+
when Array, Hash then value.hash
|
29
|
+
else
|
30
|
+
value
|
31
|
+
end
|
32
|
+
end
|
33
|
+
}
|
22
34
|
self.discount_calculator = ::SuperGood::SolidusTaxJar::DiscountCalculator
|
23
|
-
self.test_mode = false
|
24
35
|
self.exception_handler = ->(e) {
|
25
36
|
Rails.logger.error "An error occurred while fetching TaxJar tax rates - #{e}: #{e.message}"
|
26
37
|
}
|
27
|
-
self.taxable_address_check = ->(address) { true }
|
28
|
-
self.shipping_tax_label_maker = ->(shipment, shipping_tax) { "Sales Tax" }
|
29
38
|
self.line_item_tax_label_maker = ->(taxjar_line_item, spree_line_item) { "Sales Tax" }
|
39
|
+
self.shipping_tax_label_maker = ->(shipment, shipping_tax) { "Sales Tax" }
|
40
|
+
self.taxable_address_check = ->(address) { true }
|
41
|
+
self.test_mode = false
|
30
42
|
end
|
31
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_good-solidus_taxjar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Norman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|