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 +4 -4
- data/lib/silencer_shop/order.rb +3 -3
- data/lib/silencer_shop/response.rb +6 -2
- data/lib/silencer_shop/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: f1b4f55a0e4f5832594c0c48cd59d6d58ad2f1837e33d24a8e98e3b490636eb3
|
4
|
+
data.tar.gz: c57b465f8de304a59c45313af546ee06071be5a0632e27c4dcd4198d1be71c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3518b1508009204ddbb01dd5f164968fada5af7949f693d4b1ed51cab12ecd38cdf93ecad911bee02c7518aca3754a4f3f6d395aed8b6a3fea3892927c6260f6
|
7
|
+
data.tar.gz: 6819b403ed82643d671fc2b8818d689eca04adb3b3cf0b683aafd35bc18e92dee9c154eac263444baff5a5a4c2d40183ea4199ebcf1e1574ab5545139676f18a
|
data/lib/silencer_shop/order.rb
CHANGED
@@ -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
|
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
|
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)
|
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.
|
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-
|
11
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|