super_good-solidus_taxjar 0.6.0 → 0.6.1

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
- SHA1:
3
- metadata.gz: 4fabc8235afd3cc52046d35cf5d88ec0cd17d8e7
4
- data.tar.gz: 52067151ebe53c704c9e9afb168919a2438f064c
2
+ SHA256:
3
+ metadata.gz: 6563c176335daae605e2b63add3f10d670509486f31de788687b3fadfce537c0
4
+ data.tar.gz: 391562433aaa5a9a91be498f91c7b9dbaec899dc793ad37c942b4a7d809ead59
5
5
  SHA512:
6
- metadata.gz: 9df52cfcec3b89302cf1b652172a7fa9f3545554d6ddb448f4a901dd681cdc0a15b8a710027e620078a9c2620ffe6bfee52b059a5cdb719b85e8a53579e3750d
7
- data.tar.gz: 7d33b0dd569cde3c71e8b0bc390d406a6ba7c04200f206b45ab531f6ed5fae8a6e825c2cf0876887243197ca3b9b39589efa7d684721b9d5136f47362326c4ba
6
+ metadata.gz: 6de73f35b8304608e370039d5e5c9d4f62ee21f756cee5ef68df8ed17b48b5c612b74e88014bcdc36ebe8eaee02670e27f118b2ab8b2e78f8e2b85a3f10a524a
7
+ data.tar.gz: ec6978c44dfc0cd05a9d4683ef66c50b773bc4599f173776dca589833a6da6c5c76816d1b486fa620597c785d5734c63f9337ea58a713d3b8f78de7d6a2f630f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.6.1
4
+
5
+ - Stopped using the deprecated method `Spree::Address#empty?` in favour of simply checking that we have all of the fields on the address required for doing a TaxJar lookup.
6
+
3
7
  ## v0.6.0
4
8
 
5
9
  - Added `SuperGood::SolidusTaxJar.shipping_tax_label_maker` for customizing the labels on the tax adjustments on shipments.
@@ -12,7 +12,7 @@ module SuperGood
12
12
 
13
13
  def calculate
14
14
  return no_tax if SuperGood::SolidusTaxJar.test_mode
15
- return no_tax if order.tax_address.empty? || order.line_items.none?
15
+ return no_tax if incomplete_address?(order.tax_address) || order.line_items.none?
16
16
  return no_tax unless taxable_address? order.tax_address
17
17
 
18
18
  cache do
@@ -150,6 +150,16 @@ module SuperGood
150
150
  def line_item_tax_label(taxjar_line_item, spree_line_item)
151
151
  SuperGood::SolidusTaxJar.line_item_tax_label_maker.(taxjar_line_item, spree_line_item)
152
152
  end
153
+
154
+ def incomplete_address?(tax_address)
155
+ [
156
+ tax_address.address1,
157
+ tax_address.city,
158
+ tax_address&.state&.abbr || tax_address.state_name,
159
+ tax_address.zipcode,
160
+ tax_address.country.iso
161
+ ].any?(&:blank?)
162
+ end
153
163
  end
154
164
  end
155
165
  end
@@ -1,5 +1,5 @@
1
1
  module SuperGood
2
2
  module SolidusTaxJar
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
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.6.0
4
+ version: 0.6.1
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-02-07 00:00:00.000000000 Z
11
+ date: 2019-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.5.2.3
198
+ rubygems_version: 2.7.6
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: Support for using TaxJar to handle tax calculations in Solidus