super_good-solidus_taxjar 0.10.0 → 0.11.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: 80be38145d2165c2206c5bdd3277603644addb503a53407371e6bfadc88b02d2
4
- data.tar.gz: ba2a05e2396e17515bcb0979291f3e1c6997c8d8d0dc2455eaeab1cb868d2ded
3
+ metadata.gz: d5c894c77b9759569d51ee5f1e8812e87141354365db29a5dc7d901b1daf7bd5
4
+ data.tar.gz: 523521443feeb3ce517fda157af541e9b08d2d1c0c2c458066e7fd761dea3bf7
5
5
  SHA512:
6
- metadata.gz: 616500538680d8caa58649021782d96994ed79528cd51084a872965d57a388424d0c7ec3ea20a78becc8d1c730c43b97251f1d9629913d6d8f11a49eccc399cd
7
- data.tar.gz: 9ca2bbc6c923180b1ee060fc8823a243c61c94181a5802e403da64100ef0cc286d37186665b925fa66ba2cb0fcf0528ba6ca6e0bb76d4dc7c7efc83fc5838354
6
+ metadata.gz: 1cf54bcbf49aec4cf143d1353d6025d1acd2350b3432fd071d5a27ac309f366e634a84cc6774f35172638afba8fd2e04c77494dbdcca511dc2894d78f8f03a39
7
+ data.tar.gz: 359013164861393434349aaee5c02632f1c5d10665402222572921cf5fa22d1a67b455d78502cd79183bc83e8f4f7d2fb2d94c163e82c6e966bc8646f6d4d536
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## v0.11.0
6
+
7
+ - Avoid sending 0 quantity line items. TaxJar doesn't like them.
8
+
5
9
  ## v0.10.0
6
10
 
7
11
  - Make shipping amounts configurable to make it easier to support order-level adjustments.
@@ -63,7 +63,7 @@ module SuperGood
63
63
 
64
64
  def line_items_params(line_items)
65
65
  {
66
- line_items: line_items.map do |line_item|
66
+ line_items: valid_line_items(line_items).map do |line_item|
67
67
  {
68
68
  id: line_item.id,
69
69
  quantity: line_item.quantity,
@@ -77,7 +77,7 @@ module SuperGood
77
77
 
78
78
  def transaction_line_items_params(line_items)
79
79
  {
80
- line_items: line_items.map do |line_item|
80
+ line_items: valid_line_items(line_items).map do |line_item|
81
81
  {
82
82
  id: line_item.id,
83
83
  quantity: line_item.quantity,
@@ -91,6 +91,14 @@ module SuperGood
91
91
  }
92
92
  end
93
93
 
94
+ def valid_line_items(line_items)
95
+ # The API appears to error when sent line items with no quantity...
96
+ # but why would you do that anyway.
97
+ line_items.reject do |line_item|
98
+ line_item.quantity.zero?
99
+ end
100
+ end
101
+
94
102
  def discount(line_item)
95
103
  ::SuperGood::SolidusTaxJar.discount_calculator.new(line_item).discount
96
104
  end
@@ -1,5 +1,5 @@
1
1
  module SuperGood
2
2
  module SolidusTaxJar
3
- VERSION = "0.10.0"
3
+ VERSION = "0.11.0"
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.10.0
4
+ version: 0.11.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-04-05 00:00:00.000000000 Z
11
+ date: 2019-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core