credova 0.1.5 → 0.1.6
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/lib/credova/api.rb +2 -0
- data/lib/credova/application.rb +5 -5
- data/lib/credova/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80073fe97fd984aba48ec683796abcfa4368b1f280f49975b7df847e497fa1b4
|
4
|
+
data.tar.gz: 7ba35135084aaf83bd2e1c18d4add4d6333d3785fcb27aa1ee55dc152abe0e1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90b51a53419f064bf8af40fe2c06e68d5451b3d3a8bbdb126f6276134a9ea6dcdfb3db0d4d3d3f244f6387ee4e2011161a58ff181c6e189eebd3ecaccd1d32ee
|
7
|
+
data.tar.gz: 5bfed31a7c3909bb610b4c13f68aa1d8ac25fa830712a71a0bb0bffce0d00dee51d4c238154459592503f33cc87d4c47e7ab5cdb964c5ec7c30e0351496ac8fb
|
data/lib/credova/api.rb
CHANGED
@@ -29,6 +29,8 @@ 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
|
+
|
32
34
|
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
33
35
|
http.request(request)
|
34
36
|
end
|
data/lib/credova/application.rb
CHANGED
@@ -30,7 +30,7 @@ module Credova
|
|
30
30
|
@client = client
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
33
|
+
def create(application_data, callback_url = nil)
|
34
34
|
requires!(application_data, CREATE_ATTRS[:required])
|
35
35
|
|
36
36
|
endpoint = ENDPOINTS[:create]
|
@@ -46,7 +46,7 @@ module Credova
|
|
46
46
|
post_request(endpoint, application_data, headers)
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
49
|
+
def check_status_by_public_id(public_id)
|
50
50
|
endpoint = ENDPOINTS[:check_status_by_public_id] % public_id
|
51
51
|
|
52
52
|
get_request(endpoint, auth_header(@client.access_token))
|
@@ -58,7 +58,7 @@ module Credova
|
|
58
58
|
get_request(endpoint, auth_header(@client.access_token))
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
61
|
+
def set_delivery_information(public_id, delivery_data)
|
62
62
|
requires!(delivery_data, SET_DELIVERY_INFORMATION_ATTRS[:required])
|
63
63
|
|
64
64
|
endpoint = ENDPOINTS[:set_delivery_information] % public_id
|
@@ -72,13 +72,13 @@ module Credova
|
|
72
72
|
post_request(endpoint, delivery_data, headers)
|
73
73
|
end
|
74
74
|
|
75
|
-
def
|
75
|
+
def request_return(public_id)
|
76
76
|
endpoint = ENDPOINTS[:request_return] % public_id
|
77
77
|
|
78
78
|
post_request(endpoint, {}, auth_header(@client.access_token))
|
79
79
|
end
|
80
80
|
|
81
|
-
def
|
81
|
+
def upload_invoice(public_id, invoice_url)
|
82
82
|
endpoint = ENDPOINTS[:upload_invoice] % public_id
|
83
83
|
data = { form_data: ['file=@', invoice_url, '; type=application/', extract_file_extension(invoice_url)].join }
|
84
84
|
headers = [
|
data/lib/credova/version.rb
CHANGED