credova 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/credova/api.rb +0 -2
- data/lib/credova/application.rb +2 -2
- data/lib/credova/ffl.rb +11 -19
- data/lib/credova/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: 6160ea02df46ba9763039d59ba0e830751de8a6f1690502ae2517cd088da7aa2
|
4
|
+
data.tar.gz: 1dbbac5c77a59dc687e214ee1e26c7f39056963c6de3da34f02e633f07808aba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4bc3b0004e98909c525d200e92729e13f2287b2f18b3f5311d01e1235a304194c33f07502013c95cf2f578df7b8ae1d12658a3c9efc67bf8a95be2889f26326
|
7
|
+
data.tar.gz: c356d3d1a6f1f946399e2bb03b7dd18034f02bc2cb5c55fd498e13a78fbdc15ffc9699a9a37d72dba888d089e6ef37e6bfe11c2e45874b23f6c7dcc674a66a75
|
data/lib/credova/api.rb
CHANGED
@@ -29,8 +29,6 @@ module Credova
|
|
29
29
|
uri = URI(request.path)
|
30
30
|
request.body = data.is_a?(Hash) ? data.to_json : data
|
31
31
|
|
32
|
-
puts "\n-\nREQUEST_BODY_DATA: #{request.body.inspect}\n-\n"
|
33
|
-
|
34
32
|
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
35
33
|
http.request(request)
|
36
34
|
end
|
data/lib/credova/application.rb
CHANGED
@@ -31,7 +31,7 @@ module Credova
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def create(application_data, callback_url = nil)
|
34
|
-
requires!(application_data, CREATE_ATTRS[:required])
|
34
|
+
requires!(application_data, *CREATE_ATTRS[:required])
|
35
35
|
|
36
36
|
endpoint = ENDPOINTS[:create]
|
37
37
|
headers = [
|
@@ -59,7 +59,7 @@ module Credova
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def set_delivery_information(public_id, delivery_data)
|
62
|
-
requires!(delivery_data, SET_DELIVERY_INFORMATION_ATTRS[:required])
|
62
|
+
requires!(delivery_data, *SET_DELIVERY_INFORMATION_ATTRS[:required])
|
63
63
|
|
64
64
|
endpoint = ENDPOINTS[:set_delivery_information] % public_id
|
65
65
|
headers = [
|
data/lib/credova/ffl.rb
CHANGED
@@ -5,7 +5,11 @@ module Credova
|
|
5
5
|
|
6
6
|
include Credova::API
|
7
7
|
|
8
|
-
|
8
|
+
CREATE_ATTRS = {
|
9
|
+
permitted: %i( license_number expiration address address_2 city state zip ).freeze,
|
10
|
+
required: %i( license_number expiration address city state zip ).freeze,
|
11
|
+
}
|
12
|
+
|
9
13
|
ENDPOINTS = {
|
10
14
|
create: "federallicense".freeze,
|
11
15
|
upload_document: "federallicense/%s/uploadfile".freeze,
|
@@ -15,17 +19,19 @@ module Credova
|
|
15
19
|
@client = client
|
16
20
|
end
|
17
21
|
|
18
|
-
def create(
|
19
|
-
requires!(options, REQUIRED_CREATE_ATTRS)
|
22
|
+
def create(ffl_data)
|
23
|
+
requires!(options, *REQUIRED_CREATE_ATTRS)
|
20
24
|
|
25
|
+
ffl_data[:expiration] = ffl_data[:expiration].strftime('%Y/%m/%d')
|
21
26
|
endpoint = ENDPOINTS[:create]
|
22
|
-
data = format_data_for_create(options)
|
23
27
|
headers = [
|
24
28
|
*auth_header(@client.access_token),
|
25
29
|
*content_type_header('application/json'),
|
26
30
|
].to_h
|
27
31
|
|
28
|
-
|
32
|
+
standardize_body_data!(ffl_data, CREATE_ATTRS[:permitted])
|
33
|
+
|
34
|
+
post_request(endpoint, ffl_data, headers)
|
29
35
|
end
|
30
36
|
|
31
37
|
def upload_document(ffl_public_id, ffl_document_url)
|
@@ -39,19 +45,5 @@ module Credova
|
|
39
45
|
post_request(endpoint, data, headers)
|
40
46
|
end
|
41
47
|
|
42
|
-
private
|
43
|
-
|
44
|
-
def format_data_for_create(data)
|
45
|
-
{
|
46
|
-
licenseNumber: data[:license_number],
|
47
|
-
expiration: data[:expiration].strftime('%Y/%m/%d'),
|
48
|
-
address: data[:address_one],
|
49
|
-
address2: data[:address_two],
|
50
|
-
city: data[:city],
|
51
|
-
state: data[:state],
|
52
|
-
zip: data[:zip],
|
53
|
-
}
|
54
|
-
end
|
55
|
-
|
56
48
|
end
|
57
49
|
end
|
data/lib/credova/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credova
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey Dill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|