super_good-solidus_taxjar 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: c94c89aed7fedb7bf993044795baf0f4961660ec
4
- data.tar.gz: c3ad014b0c820991a5f867e4fc2e81a1f6968da2
3
+ metadata.gz: 8bc661ee30099bf70150ecf4e6083ae6293c3994
4
+ data.tar.gz: 2c38d9ed9143af58dad4a893b5d3ef14f1f94372
5
5
  SHA512:
6
- metadata.gz: 6a4834ef76e50add7b9492a6530febdd040e7814754b40c9365a05d51416492dc1d44c0b3eb8c7e161583c085361743a3793208fbca2c06ffb54234c5e576e75
7
- data.tar.gz: a75020c9c7635163bd1ca5ddadc5ac094cbbd43f5a616a8ebf7928cb7608f5f22b39c98bc5141334737c678aba3d63d354b5df08289869d9feb0e86ce206fa0f
6
+ metadata.gz: 20f64a1f7b1e3faf4ddc7dc9217d89acc03ad17b659faea1a28902fdb842ee78d98c8048137c99a1a56672e1aad2b8ee1507d2ac79cb7a1e2e063ef087648094
7
+ data.tar.gz: fe9232c21b0f4ee1006bb9823434a89ce7fb24be7d402ad0f28ce824cf7c97780f4f81741ee39c1472121f112a31d080bf013b69c4a7a04088c9c85418482a11
@@ -16,6 +16,16 @@ module SuperGood
16
16
  taxjar_client.tax_for_order order_params(order)
17
17
  end
18
18
 
19
+ def tax_rates_for(address)
20
+ taxjar_client.rates_for_location(
21
+ address.zipcode,
22
+ street: address.address1,
23
+ city: address.city,
24
+ state: address&.state&.abbr || address.state_name,
25
+ country: address.country.iso
26
+ )
27
+ end
28
+
19
29
  private
20
30
 
21
31
  attr_reader :taxjar_client
@@ -16,7 +16,7 @@ module SuperGood
16
16
  end
17
17
 
18
18
  def calculate
19
- return no_tax if order.tax_address.empty?
19
+ return no_tax if order.tax_address.empty? || order.line_items.none?
20
20
 
21
21
  cache do
22
22
  next no_tax unless taxjar_breakdown
@@ -1,5 +1,5 @@
1
1
  module SuperGood
2
2
  module SolidusTaxJar
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  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.1.2
4
+ version: 0.1.3
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-01-22 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core