complyadvantage 0.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 +7 -0
- data/lib/complyadvantage.rb +43 -0
- metadata +71 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3d0df6664c128b363a3beea8782489bae8b86561
|
4
|
+
data.tar.gz: d5f694ee9365df3cd0f44dadf0621f1996682160
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f3e8c2cb3a27f7f4f6feec48ae7d486173557cb275d87a9dbca193be4ed14f0a88c169e06b4569b588a3af7d35f1662fc66760f9004c78c04b9c0d885770a634
|
7
|
+
data.tar.gz: 8523e028b9a6263b7faf4f646c8041dbed50b6f0865d6bd122bb2f6de480c3f86f00bcee2eaab39fbee84f85aaa0aa84ef1f6e6965096683eeb8bec3cdcb5642
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class ComplyAdvantage
|
5
|
+
class ComplyAdvantageError < StandardError
|
6
|
+
end
|
7
|
+
class ComplyAdvantageAuthenticationError < StandardError
|
8
|
+
end
|
9
|
+
|
10
|
+
include HTTParty
|
11
|
+
base_uri "https://api.complyadvantage.com/v1/"
|
12
|
+
|
13
|
+
def initialize(api_key)
|
14
|
+
@auth = {:username => api_key, :password => 'x'}
|
15
|
+
end
|
16
|
+
|
17
|
+
def search(names)
|
18
|
+
response = post("/search", names)
|
19
|
+
case response.code
|
20
|
+
when 200
|
21
|
+
return response.parsed_response
|
22
|
+
when 401
|
23
|
+
raise ComplyAdvantageAuthenticationError, "Invalid API Key"
|
24
|
+
when 500
|
25
|
+
raise ComplyAdvantageError, "There was an error with your input or the complyadvantage API"
|
26
|
+
end
|
27
|
+
|
28
|
+
return response
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
# Internal: Fire POST HTTP request.
|
34
|
+
# We only need POST right now
|
35
|
+
def post(path, params, auth=nil)
|
36
|
+
request(:post, path, :body => params.to_json, :basic_auth => @auth)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Internal: Does the actual requests.
|
40
|
+
def request(method, path, params)
|
41
|
+
self.class.send(method, path, params)
|
42
|
+
end
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: complyadvantage
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ComplyAdvantage
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: ComplyAdvantage sanctions API wrapper
|
42
|
+
email: jake@complyadvantage.com
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/complyadvantage.rb
|
48
|
+
homepage: http://complyadvantage.com
|
49
|
+
licenses: []
|
50
|
+
metadata: {}
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 2.2.2
|
68
|
+
signing_key:
|
69
|
+
specification_version: 4
|
70
|
+
summary: ComplyAdvantage sanctions API wrapper
|
71
|
+
test_files: []
|