super_good-solidus_taxjar 0.6.2 → 0.7.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: 3bd45137c03f2ef0e98fc82b6c1e3e9685fa42b22560caf432ed428ae5ce9a3d
4
- data.tar.gz: f7686d33b2d6f34d50a5f5e3307192ee7dbe1bb31c4276886fea695662d1e244
3
+ metadata.gz: f6c82ec639ea952ed3b408e4639af086c8172e684708838edddb94d2ea27d698
4
+ data.tar.gz: 85f273541b7c561ff922ff8315e5c45600d9a19f1dd394625ecc9da8a0383375
5
5
  SHA512:
6
- metadata.gz: 844f20af4104c36eefc4c95dd4771a5b73a770ad41cfa23b08e9765e8d3dd362b8690caeb96fdab7689bccd42000067bc920ef996964cec477220db225f98fd6
7
- data.tar.gz: 2a39bf8402ebba2397ff0a9467754fdfc94b23d7e9b443021ab36eda7ccc6531f0fc6d3a5ff5582e2d012ca1a3db229e7dccd1caca540bb3c31bca89cf35ec6d
6
+ metadata.gz: e298bbf6b101af799b7e012c719ac7a370157ad1122cf4c9a7168120e19f1377d6b441a31294a782abc7b2193439c31675988e80ed58a4fb69b3a18bffb9ac68
7
+ data.tar.gz: cf982be3271a0aa26bef80c29b3541bf30641de8c0cd5ed016589cb8c6aa9b76479fff0fc29b24b5c934da159276e303f70f23a38c396b08f69bcdd08a7d22ee
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.7.0
4
+
5
+ - Switched to sending the full list of line items when creating/updating transactions in TaxJar.
6
+
3
7
  ## v0.6.2
4
8
 
5
9
  - Fixed issued where orders without tax address would cause errors because `Spree::Order#tax_address` will return a `Spree::Tax::TaxLocation` when called on an order without a tax address. `Spree::Tax::TaxLocation` isn't enough like a real address and this was causing exceptions.
@@ -24,6 +24,7 @@ module SuperGood
24
24
  def transaction_params(order)
25
25
  {}
26
26
  .merge(order_address_params(order.tax_address))
27
+ .merge(transaction_line_items_params(order.line_items))
27
28
  .merge(
28
29
  transaction_id: order.number,
29
30
  transaction_date: order.completed_at.to_formatted_s(:iso8601),
@@ -74,6 +75,22 @@ module SuperGood
74
75
  }
75
76
  end
76
77
 
78
+ def transaction_line_items_params(line_items)
79
+ {
80
+ line_items: line_items.map do |line_item|
81
+ {
82
+ id: line_item.id,
83
+ quantity: line_item.quantity,
84
+ product_identifier: line_item.sku,
85
+ product_tax_code: line_item.tax_category&.tax_code,
86
+ unit_price: line_item.price,
87
+ discount: discount(line_item),
88
+ sales_tax: line_item.additional_tax_total
89
+ }
90
+ end
91
+ }
92
+ end
93
+
77
94
  def discount(line_item)
78
95
  ::SuperGood::SolidusTaxJar.discount_calculator.new(line_item).discount
79
96
  end
@@ -1,5 +1,5 @@
1
1
  module SuperGood
2
2
  module SolidusTaxJar
3
- VERSION = "0.6.2"
3
+ VERSION = "0.7.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.6.2
4
+ version: 0.7.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-14 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core