super_good-solidus_taxjar 0.9.1 → 0.10.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: 16994c7ead4373f228cc02f8de0b91ff952643c9440548fa8e290317c17746b0
4
- data.tar.gz: b6deaf9489b43eb4c55c39749cc0d34a16d5a1a05e199f98da64f158e1cbef29
3
+ metadata.gz: 80be38145d2165c2206c5bdd3277603644addb503a53407371e6bfadc88b02d2
4
+ data.tar.gz: ba2a05e2396e17515bcb0979291f3e1c6997c8d8d0dc2455eaeab1cb868d2ded
5
5
  SHA512:
6
- metadata.gz: 552b806398f647d3e88722f63e2afea3b12675d9b5965f4290135e57b8f7718dfe0a559c551aeb894fce57037b384973872a58a7192f0099588ad9944ea02e6d
7
- data.tar.gz: 819fa390ee35cb504650b1312611187a98bd7cc40579c87f3634c66a5e6202d585f111967cf8a61013a4195adf557dce19b0ceb16071ec593344edf0aae4208e
6
+ metadata.gz: 616500538680d8caa58649021782d96994ed79528cd51084a872965d57a388424d0c7ec3ea20a78becc8d1c730c43b97251f1d9629913d6d8f11a49eccc399cd
7
+ data.tar.gz: 9ca2bbc6c923180b1ee060fc8823a243c61c94181a5802e403da64100ef0cc286d37186665b925fa66ba2cb0fcf0528ba6ca6e0bb76d4dc7c7efc83fc5838354
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## v0.10.0
6
+
7
+ - Make shipping amounts configurable to make it easier to support order-level adjustments.
8
+
5
9
  ## v0.9.1
6
10
 
7
11
  - Fixed unreliable default cache key implementation.
@@ -16,6 +16,7 @@ module SuperGood
16
16
  attr_accessor :discount_calculator
17
17
  attr_accessor :exception_handler
18
18
  attr_accessor :line_item_tax_label_maker
19
+ attr_accessor :shipping_calculator
19
20
  attr_accessor :shipping_tax_label_maker
20
21
  attr_accessor :taxable_address_check
21
22
  attr_accessor :test_mode
@@ -28,6 +29,7 @@ module SuperGood
28
29
  Rails.logger.error "An error occurred while fetching TaxJar tax rates - #{e}: #{e.message}"
29
30
  }
30
31
  self.line_item_tax_label_maker = ->(taxjar_line_item, spree_line_item) { "Sales Tax" }
32
+ self.shipping_calculator = ->(order) { order.shipment_total }
31
33
  self.shipping_tax_label_maker = ->(shipment, shipping_tax) { "Sales Tax" }
32
34
  self.taxable_address_check = ->(address) { true }
33
35
  self.test_mode = false
@@ -29,7 +29,7 @@ module SuperGood
29
29
  transaction_id: order.number,
30
30
  transaction_date: order.completed_at.to_formatted_s(:iso8601),
31
31
  amount: order.total - order.additional_tax_total,
32
- shipping: order.shipment_total,
32
+ shipping: shipping(order),
33
33
  sales_tax: order.additional_tax_total
34
34
  )
35
35
  end
@@ -94,6 +94,10 @@ module SuperGood
94
94
  def discount(line_item)
95
95
  ::SuperGood::SolidusTaxJar.discount_calculator.new(line_item).discount
96
96
  end
97
+
98
+ def shipping(order)
99
+ SuperGood::SolidusTaxJar.shipping_calculator.(order)
100
+ end
97
101
  end
98
102
  end
99
103
  end
@@ -1,5 +1,5 @@
1
1
  module SuperGood
2
2
  module SolidusTaxJar
3
- VERSION = "0.9.1"
3
+ VERSION = "0.10.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.9.1
4
+ version: 0.10.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-24 00:00:00.000000000 Z
11
+ date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core