lipseys 6.1.1 → 6.2.1
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 +5 -5
- data/lib/lipseys/catalog.rb +1 -0
- data/lib/lipseys/order.rb +40 -8
- data/lib/lipseys/response.rb +1 -1
- data/lib/lipseys/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bf71d4ded78bc81ff80f11ee1e1731083d0b38fb12fb2aba978f015e9702d5c2
|
4
|
+
data.tar.gz: 903ac5b40b4836d1017cda24649d6dde0dec70e9f4161935038303158949ffac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1990e5889e1a24546843d7f507dba385fcdb5087454fa5d878c96cb23a08b536943222e01c053ebf6e6ba0337596db70fd4f5ba914dc1aeb4c238c9af1845845
|
7
|
+
data.tar.gz: e6d498bbde9c21672580c8d9cc6d9263c93709b4c9020a62890707741bc6d66201cc5c03c27c00790451906b79360be83871a95bc3f80a319c367e33b95e4a0b
|
data/lib/lipseys/catalog.rb
CHANGED
data/lib/lipseys/order.rb
CHANGED
@@ -7,7 +7,7 @@ module Lipseys
|
|
7
7
|
|
8
8
|
SUBMIT_TO_STORE_ATTRS = {
|
9
9
|
permitted: %i( po_number disable_email items item_no quantity note ).freeze,
|
10
|
-
required: %i( items item_no quantity ).freeze
|
10
|
+
required: %i( po_number items item_no quantity ).freeze
|
11
11
|
}
|
12
12
|
|
13
13
|
SUBMIT_TO_DROP_SHIP_ATTRS = {
|
@@ -18,15 +18,21 @@ module Lipseys
|
|
18
18
|
items item_no quantity note overnight
|
19
19
|
).freeze,
|
20
20
|
required: %i(
|
21
|
-
po_number billing_name billing_address_line_1
|
21
|
+
po_number billing_name billing_address_line_1 billing_address_city billing_address_state billing_address_zip
|
22
22
|
shipping_name shipping_address_line_1 shipping_address_city shipping_address_state shipping_address_zip
|
23
23
|
items item_no quantity
|
24
24
|
).freeze
|
25
25
|
}
|
26
26
|
|
27
|
+
SUBMIT_TO_DROP_SHIP_FIREARM_ATTRS = {
|
28
|
+
permitted: %i( ffl po name phone delay_shipping disable_email items item_no quantity note ).freeze,
|
29
|
+
required: %i( ffl po name phone items item_no quantity ).freeze
|
30
|
+
}
|
31
|
+
|
27
32
|
ENDPOINTS = {
|
28
|
-
submit_to_store:
|
29
|
-
submit_to_drop_ship:
|
33
|
+
submit_to_store: "order/apiorder".freeze,
|
34
|
+
submit_to_drop_ship: "order/dropship".freeze,
|
35
|
+
submit_to_drop_ship_firearm: "order/dropshipfirearm".freeze,
|
30
36
|
}
|
31
37
|
|
32
38
|
def initialize(client)
|
@@ -37,19 +43,45 @@ module Lipseys
|
|
37
43
|
requires!(order_data, *SUBMIT_TO_STORE_ATTRS[:required])
|
38
44
|
|
39
45
|
endpoint = ENDPOINTS[:submit_to_store]
|
46
|
+
order_data = standardize_body_data(order_data, SUBMIT_TO_STORE_ATTRS[:permitted])
|
47
|
+
|
40
48
|
headers = [
|
41
49
|
*auth_header(@client.access_token),
|
42
50
|
*content_type_header('application/json'),
|
43
51
|
].to_h
|
44
52
|
|
45
|
-
order_data = standardize_body_data(order_data, SUBMIT_TO_STORE_ATTRS[:permitted])
|
46
|
-
|
47
53
|
post_request(endpoint, order_data, headers)
|
54
|
+
|
48
55
|
end
|
49
56
|
|
50
57
|
def submit_to_drop_ship(order_data)
|
51
|
-
|
52
|
-
|
58
|
+
requires!(order_data, *SUBMIT_TO_DROP_SHIP_ATTRS[:required])
|
59
|
+
|
60
|
+
endpoint = ENDPOINTS[:submit_to_drop_ship]
|
61
|
+
order_data = standardize_body_data(order_data, SUBMIT_TO_DROP_SHIP_ATTRS[:permitted])
|
62
|
+
|
63
|
+
headers = [
|
64
|
+
*auth_header(@client.access_token),
|
65
|
+
*content_type_header('application/json'),
|
66
|
+
].to_h
|
67
|
+
|
68
|
+
post_request(endpoint, order_data, headers)
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
def submit_to_drop_ship_firearm(order_data)
|
73
|
+
requires!(order_data, *SUBMIT_TO_DROP_SHIP_FIREARM_ATTRS[:required])
|
74
|
+
|
75
|
+
endpoint = ENDPOINTS[:submit_to_drop_ship_firearm]
|
76
|
+
order_data = standardize_body_data(order_data, SUBMIT_TO_DROP_SHIP_FIREARM_ATTRS[:permitted])
|
77
|
+
|
78
|
+
headers = [
|
79
|
+
*auth_header(@client.access_token),
|
80
|
+
*content_type_header('application/json'),
|
81
|
+
].to_h
|
82
|
+
|
83
|
+
post_request(endpoint, order_data, headers)
|
84
|
+
|
53
85
|
end
|
54
86
|
|
55
87
|
end
|
data/lib/lipseys/response.rb
CHANGED
data/lib/lipseys/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lipseys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey Dill
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -116,7 +116,7 @@ homepage: ''
|
|
116
116
|
licenses:
|
117
117
|
- MIT
|
118
118
|
metadata: {}
|
119
|
-
post_install_message:
|
119
|
+
post_install_message:
|
120
120
|
rdoc_options: []
|
121
121
|
require_paths:
|
122
122
|
- lib
|
@@ -131,9 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
|
135
|
-
|
136
|
-
signing_key:
|
134
|
+
rubygems_version: 3.2.3
|
135
|
+
signing_key:
|
137
136
|
specification_version: 4
|
138
137
|
summary: Ruby library for Lipsey's API.
|
139
138
|
test_files: []
|