silencer_shop 1.1.1 → 1.1.6

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: 6f99bfc0be651ead73041937cd95080a8ed289e7e8b340c68bf8adbb61976116
4
- data.tar.gz: d0a82c2282a3ea7af902995de3208bd590071468c6a0bccc214be6de9a8e2121
3
+ metadata.gz: f1b4f55a0e4f5832594c0c48cd59d6d58ad2f1837e33d24a8e98e3b490636eb3
4
+ data.tar.gz: c57b465f8de304a59c45313af546ee06071be5a0632e27c4dcd4198d1be71c59
5
5
  SHA512:
6
- metadata.gz: 28e34b7f61ca6a5651642ab9c592a6f92d1e44c051989ab114f9bde71223d05a342846f4ac44345ebd74ce250d0012146d5805d83b9e8942e2a9e5351c1af2a8
7
- data.tar.gz: 6b2d7cfcda157991cc9127f11b28f85af492042bb6454e81b33a9c86cfde476b81c895709db7a648caa1e55eb5593eb5f93a06cdcfbb80fdf0997bd5d4d96576
6
+ metadata.gz: 3518b1508009204ddbb01dd5f164968fada5af7949f693d4b1ed51cab12ecd38cdf93ecad911bee02c7518aca3754a4f3f6d395aed8b6a3fea3892927c6260f6
7
+ data.tar.gz: 6819b403ed82643d671fc2b8818d689eca04adb3b3cf0b683aafd35bc18e92dee9c154eac263444baff5a5a4c2d40183ea4199ebcf1e1574ab5545139676f18a
@@ -9,12 +9,12 @@ module SilencerShop
9
9
  permitted: %i(
10
10
  purchase_order account_number other_information notes customer_email customer_phone
11
11
  customer_name company_name address_line_1 address_line_2 ffl_information city state
12
- zip shipping_method sales_tax_collected line_items dealer_part_number quantity price
13
- universal_product_code description
12
+ zip shipping_method sales_tax_collected line_items manufacturer_part_number quantity
13
+ price universal_product_code description
14
14
  ).freeze,
15
15
  required: %i(
16
16
  purchase_order ffl_information customer_email customer_phone customer_name
17
- address_line_1 city state zip line_items dealer_part_number quantity
17
+ address_line_1 city state zip line_items manufacturer_part_number quantity
18
18
  ).freeze
19
19
  }
20
20
 
@@ -14,15 +14,19 @@ module SilencerShop
14
14
  when Net::HTTPNoContent
15
15
  SilencerShop::Error::NoContent.new(@response.body)
16
16
  when Net::HTTPOK, Net::HTTPSuccess
17
- self.success = true
18
17
  _data = (JSON.parse(@response.body) if @response.body.present?)
19
-
20
18
  @data = case
21
19
  when _data.is_a?(Hash)
22
20
  _data.deep_symbolize_keys
23
21
  when _data.is_a?(Array)
24
22
  _data.map(&:deep_symbolize_keys)
25
23
  end
24
+
25
+ if @data.is_a?(Hash) && @data.has_key?(:ErrorMessage)
26
+ raise SilencerShop::Error::RequestError.new(@data[:ErrorMessage])
27
+ end
28
+
29
+ self.success = true
26
30
  else
27
31
  if @response.body =~ /unable to verify credentials/i
28
32
  SilencerShop::Error::NotAuthorized.new(@response.body)
@@ -1,3 +1,3 @@
1
1
  module SilencerShop
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silencer_shop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Dill
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport