super_good-solidus_taxjar 0.16.0 → 0.17.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11bc18ca6b156d505c9327b733da737feb0712f55daf51d014c43e67a94f17b
|
4
|
+
data.tar.gz: 20143b4baa4080ca6eb57375459d9918fbaf8964e11e0169134029b7ffb8559a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b95355ed63090f876d59814c9a4ecfb94681c156a2880775b4c14d897527479b675d9c1a864a3e0f9ca08e6c3e6d0581f6375c445d33c021595d640aabba132c
|
7
|
+
data.tar.gz: 79c294c8ed4b6207c1f493fdc22243d288e5da5d2bcfe9d0194f15abf734ee4df31bba0f48996f7695718638af590f8c91ce9d9c4d35ad485421401c8c233e44
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,26 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## v0.17.0
|
6
|
+
|
7
|
+
- Added `SuperGood::SolidusTaxJar.custom_order_params` to allow for custom overrides to the parameters sent to TaxJar when calculating order taxes. For example, if you needed to send a custom nexus address you could do:
|
8
|
+
```ruby
|
9
|
+
SuperGood::SolidusTaxJar.custom_order_params = ->(order) {
|
10
|
+
{
|
11
|
+
nexus_addresses: [
|
12
|
+
{
|
13
|
+
id: 'Main Location',
|
14
|
+
country: 'AU',
|
15
|
+
zip: 'NSW 2000',
|
16
|
+
city: 'Sydney',
|
17
|
+
street: '483 George St',
|
18
|
+
}
|
19
|
+
]
|
20
|
+
}
|
21
|
+
}
|
22
|
+
```
|
23
|
+
The callback receives the `Spree::Order` that the params are for and the return value can override existing values like the order's ID.
|
24
|
+
|
5
25
|
## v0.16.0
|
6
26
|
|
7
27
|
- Fix `#incomplete_address?` method to be friendly also to completely blank addresses.
|
@@ -15,6 +15,7 @@ module SuperGood
|
|
15
15
|
class << self
|
16
16
|
attr_accessor :cache_duration
|
17
17
|
attr_accessor :cache_key
|
18
|
+
attr_accessor :custom_order_params
|
18
19
|
attr_accessor :discount_calculator
|
19
20
|
attr_accessor :exception_handler
|
20
21
|
attr_accessor :line_item_tax_label_maker
|
@@ -31,6 +32,7 @@ module SuperGood
|
|
31
32
|
record_type = record.class.name.demodulize.underscore
|
32
33
|
APIParams.send("#{record_type}_params", record).to_json
|
33
34
|
}
|
35
|
+
self.custom_order_params = ->(order) { {} }
|
34
36
|
self.discount_calculator = ::SuperGood::SolidusTaxJar::DiscountCalculator
|
35
37
|
self.exception_handler = ->(e) {
|
36
38
|
Rails.logger.error "An error occurred while fetching TaxJar tax rates - #{e}: #{e.message}"
|
@@ -8,6 +8,7 @@ module SuperGood
|
|
8
8
|
.merge(order_address_params(order.tax_address))
|
9
9
|
.merge(line_items_params(order.line_items))
|
10
10
|
.merge(shipping: order.shipment_total)
|
11
|
+
.merge(SuperGood::SolidusTaxJar.custom_order_params.(order))
|
11
12
|
.tap do |params|
|
12
13
|
next unless SuperGood::SolidusTaxJar.logging_enabled
|
13
14
|
|
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.17.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: 2020-02-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|