demo_api 0.1.2 → 0.1.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/lib/demo_api.rb +17 -0
- data/lib/demo_api/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: f691b8661c00573c9ddf86a725d26562261ba6aab8cb58b49ba6105c94f1c9f7
|
4
|
+
data.tar.gz: 2aaa64cb54e69fd77c667f2646bedcd53578398f1b673a76e3b2101a619ca98d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6235b1f5018c64631319a6bef61d0d149f48879c4a4b2c41acea22438f9f19cff811d62852712bcf969babe9c6235e76036f2cb80b0331ba5fd155f149207006
|
7
|
+
data.tar.gz: c84c1ecba11beb26aebe82d8d61e556cf43ebfa3788e5eb7750cbe020e9c29f88330be8c37f6f4fc7d7d614158b129ce8db7e45acaec7123c119ad0aa88612e1
|
data/lib/demo_api.rb
CHANGED
@@ -29,6 +29,21 @@ module DemoApi
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
# Verify the business profile
|
33
|
+
def verify_profile(auth_token, profile_id, api_key)
|
34
|
+
puts '33333333333333'
|
35
|
+
auth_link = SABEQ_URL + "/api/v1/verify_business"
|
36
|
+
auth_json = { auth_token: auth_token, profile_id: profile_id, api_key: api_key }
|
37
|
+
json_response = make_post_request(auth_link, auth_json)
|
38
|
+
|
39
|
+
result, the_response = get_error_or_returned_value(json_response)
|
40
|
+
if result
|
41
|
+
return true, the_response["verification_token"]
|
42
|
+
else
|
43
|
+
return false, the_response
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
32
47
|
private
|
33
48
|
def make_post_request(url_link, json_content)
|
34
49
|
uri = URI.parse(url_link)
|
@@ -37,6 +52,8 @@ module DemoApi
|
|
37
52
|
a_request = Net::HTTP::Post.new(uri.request_uri, REQUEST_HEADER)
|
38
53
|
a_request.body = json_content.to_json
|
39
54
|
a_response = http.request(a_request)
|
55
|
+
puts '4444444444444'
|
56
|
+
puts a_response.body
|
40
57
|
return a_response.body
|
41
58
|
end
|
42
59
|
|
data/lib/demo_api/version.rb
CHANGED