Class: Credova::FFL
Constant Summary
collapse
- REQUIRED_CREATE_ATTRS =
i( license_number expiration address_one city state zip )
- ENDPOINTS =
{
create: "federallicense".freeze,
upload_document: "federallicense/%s/uploadfile".freeze,
}
Constants included
from API
API::API_VERSION, API::DEVELOPMENT_URL, API::PRODUCTION_URL, API::USER_AGENT
Instance Method Summary
collapse
Methods included from API
#get_request, #post_request
Constructor Details
#initialize(client) ⇒ FFL
14
15
16
|
# File 'lib/credova/ffl.rb', line 14
def initialize(client)
@client = client
end
|
Instance Method Details
#create(options = {}) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/credova/ffl.rb', line 18
def create(options = {})
requires!(options, REQUIRED_CREATE_ATTRS)
endpoint = ENDPOINTS[:create]
data = format_data_for_create(options)
= [
*(@client.access_token),
*('application/json'),
].to_h
post_request(endpoint, data, )
end
|
#upload_document(ffl_public_id, ffl_document_url) ⇒ Object
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/credova/ffl.rb', line 31
def upload_document(ffl_public_id, ffl_document_url)
endpoint = ENDPOINTS[:upload_document] % ffl_public_id
data = { form_data: ['file=@', ffl_document_url, '; type=application/', (ffl_document_url)].join }
= [
*(@client.access_token),
*('multipart/form-data'),
].to_h
post_request(endpoint, data, )
end
|