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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/super_good/solidus_taxjar/api_params.rb +17 -0
- data/lib/super_good/solidus_taxjar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6c82ec639ea952ed3b408e4639af086c8172e684708838edddb94d2ea27d698
|
4
|
+
data.tar.gz: 85f273541b7c561ff922ff8315e5c45600d9a19f1dd394625ecc9da8a0383375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.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-
|
11
|
+
date: 2019-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|