vertex_client 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2bc8e8c69324495ed95b5e9fd9ff02f2a6cc3ac959a799fe03abf2617f8aab2
4
- data.tar.gz: 0c246581ec77e3743b2ba05a2957dc6dbbdcb765c6c6883df13268b8a3772138
3
+ metadata.gz: 2031ee6ae966cf912a46c215217042403fc9c6f6b308e4411d62d0c1afbc8142
4
+ data.tar.gz: 3b4ea87664f78d85eb3c00ef911b21e0ed8ef8c1b4f15bde26b4e4c8cece81d9
5
5
  SHA512:
6
- metadata.gz: 4bdf87b6784d5a0dc968bfedba89f532e55be49ff46a58816bbe3687b36af68af67a751f86c27a479d7815a23cc23c49f9e45a532fd9bb918f837ac1faf25b86
7
- data.tar.gz: c86f016775c33bdb129827452ba71fb50d8dd63dd59920cee1966c71456fc8538b2d6fb29c8f849f0010560f8ab8998c8654436c679b59493a21998d677af266
6
+ metadata.gz: 43e035abf1aa16e3ccb4cc07903672998153361a8feb3a36d39f194e9208881416fed2922579b6529733dbbbd527a0e577390494a62b2c723fbdb551f9c54b08
7
+ data.tar.gz: 01ba1485a519b47dce96dd3d7d97d8329c32f562a262ef44fa96eb8778dd5512bd11561624b7556715e0d16f1dbb60269ed000d33042a2c86a3610e6bf34ba07
@@ -5,7 +5,7 @@ module VertexClient
5
5
  SALE_TRANSACTION_TYPE = 'SALE'.freeze
6
6
 
7
7
  def validate!
8
- raise VertexClient::ValidationError.new('customer requires a state or postal_code') if customer_missing_location?
8
+ raise VertexClient::ValidationError.new('customer requires a state and postal_code') if customer_missing_location?
9
9
  end
10
10
 
11
11
  def body
@@ -15,7 +15,7 @@ module VertexClient
15
15
  end
16
16
 
17
17
  def line_items
18
- @line_items ||= @body[:line_item].flatten.map do |line_item|
18
+ @line_items ||= normalized_line_items.map do |line_item|
19
19
  LineItem.new(
20
20
  product: product_for_line_item(line_item[:product]),
21
21
  quantity: line_item[:quantity],
@@ -44,6 +44,10 @@ module VertexClient
44
44
  def tax_for_line_item(line_item)
45
45
  line_item[:total_tax]
46
46
  end
47
+
48
+ def normalized_line_items
49
+ [ @body[:line_item] ].flatten
50
+ end
47
51
  end
48
52
  end
49
53
  end
@@ -1,3 +1,3 @@
1
1
  module VertexClient
2
- VERSION = '0.6.4'
2
+ VERSION = '0.6.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertex_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Custom Ink
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-12 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport