oreilly_api 1.0.2 → 1.0.3
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 +4 -4
- data/.rspec_status +5 -5
- data/Gemfile.lock +1 -1
- data/README.md +0 -1
- data/lib/oreilly_api/version.rb +1 -1
- data/lib/oreilly_api.rb +10 -11
- 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: c9f5038e7928719e445cdd07449a7d88f1dfe2bf82cdf47db6d51d31dd5ba081
|
|
4
|
+
data.tar.gz: f2a09c91d003feb1774df8b3a6dae3de07d618689f7ba75b5ff76799da9d322f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '038a777daaddf9708f22a84afa6fa0d830283868ca26ac2ff15df3ccb433b66157a98284f0d5f6b172fa4b81a3482b58a84730d2215ffa9b3d049b58552941d3'
|
|
7
|
+
data.tar.gz: 8fcedc483cbb2e88cd2ce74e8e40f196f977a049294639cddf7c32c9185d304f80a2b48e7bc7c87c81bc2381125d05972938f4501692dc536a6f9428380f64f5
|
data/.rspec_status
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
example_id | status | run_time |
|
|
2
2
|
------------------------------- | ------- | --------------- |
|
|
3
|
-
./spec/oreilly_api_spec.rb[1:1] | passed | 0.
|
|
4
|
-
./spec/oreilly_api_spec.rb[1:2] | passed | 0.
|
|
5
|
-
./spec/oreilly_api_spec.rb[1:3] | passed | 0.
|
|
3
|
+
./spec/oreilly_api_spec.rb[1:1] | passed | 0.00108 seconds |
|
|
4
|
+
./spec/oreilly_api_spec.rb[1:2] | passed | 0.0281 seconds |
|
|
5
|
+
./spec/oreilly_api_spec.rb[1:3] | passed | 0.00814 seconds |
|
|
6
6
|
./spec/oreilly_api_spec.rb[1:4] | pending | 0.00002 seconds |
|
|
7
|
-
./spec/oreilly_api_spec.rb[1:5] | passed | 0.
|
|
8
|
-
./spec/oreilly_api_spec.rb[1:6] | passed | 0.
|
|
7
|
+
./spec/oreilly_api_spec.rb[1:5] | passed | 0.01212 seconds |
|
|
8
|
+
./spec/oreilly_api_spec.rb[1:6] | passed | 0.01094 seconds |
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/oreilly_api/version.rb
CHANGED
data/lib/oreilly_api.rb
CHANGED
|
@@ -14,7 +14,7 @@ require 'redis_utility'
|
|
|
14
14
|
module OreillyApi
|
|
15
15
|
TOKEN = 'oreilly_api_token'
|
|
16
16
|
class << self
|
|
17
|
-
attr_accessor :domain, :version, :client_id, :client_secret, :identity, :
|
|
17
|
+
attr_accessor :domain, :version, :client_id, :client_secret, :identity, :device_id
|
|
18
18
|
|
|
19
19
|
def config
|
|
20
20
|
yield self
|
|
@@ -24,22 +24,21 @@ module OreillyApi
|
|
|
24
24
|
RedisUtility.redis_config = redis_config
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def payload_id
|
|
28
|
-
"YM#{
|
|
27
|
+
def payload_id(account_number)
|
|
28
|
+
"YM#{account_number}#{DateTime.now.strftime('%Y%m%d%l%S%M')}"
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def place_order(po_number,
|
|
31
|
+
def place_order(po_number, account_number, vehicles_with_items, stop_order: false)
|
|
32
32
|
payload = {
|
|
33
33
|
'header' => {
|
|
34
34
|
'identity' => OreillyApi.identity,
|
|
35
|
-
'payloadId' => OreillyApi.payload_id,
|
|
35
|
+
'payloadId' => OreillyApi.payload_id(account_number),
|
|
36
36
|
'timestamp' => Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
37
37
|
},
|
|
38
38
|
'orderHeader' => {
|
|
39
39
|
'poNumber' => po_number,
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'comments' => "test"
|
|
40
|
+
'accountNumber' => account_number,
|
|
41
|
+
'comments' => "comments"
|
|
43
42
|
},
|
|
44
43
|
'vehicles' => vehicles_with_items
|
|
45
44
|
}.to_json
|
|
@@ -50,12 +49,12 @@ module OreillyApi
|
|
|
50
49
|
[res.code, place_order_response]
|
|
51
50
|
end
|
|
52
51
|
|
|
53
|
-
def fetch_quote(items)
|
|
52
|
+
def fetch_quote(items, account_number)
|
|
54
53
|
payload = {
|
|
55
|
-
'accountNumber' =>
|
|
54
|
+
'accountNumber' => account_number,
|
|
56
55
|
'header' => {
|
|
57
56
|
'identity' => OreillyApi.identity,
|
|
58
|
-
'payloadId' => OreillyApi.payload_id,
|
|
57
|
+
'payloadId' => OreillyApi.payload_id(account_number),
|
|
59
58
|
'timestamp' => Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
60
59
|
},
|
|
61
60
|
'items' => items
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oreilly_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TruptiHosmani
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-04-
|
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|