incognia_api 1.1.0 → 1.2.0
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +16 -16
- data/lib/incognia_api/api.rb +11 -7
- data/lib/incognia_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f17e031979fde13ac3ac30d9cc3ebf9369da407eef0aec67e0313dcfa9c1ecd3
|
4
|
+
data.tar.gz: ecbd6959f1546fa24d5d85d5f7e95e8980539ab2fddca46838e46076571bc8b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f9945bb733db1fb2015636f85b3342684635a027ff70d8bd493887365085b893877ca4ea77d3f8c4e937cccfd2c4cf580bcf8223505bbfdebf5b61ada4684fe
|
7
|
+
data.tar.gz: 4f85f0ab80d4f9ca47509a6ff9edf78514990de7d0d25a3cd6c8e2a90fdbc904516d554189ad29651aae120b20ee5afe61e7ecfa80bb3f0b511c0882664d0cdb
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -49,14 +49,14 @@ For sandbox credentials, refer to the [API testing guide]().
|
|
49
49
|
|
50
50
|
### Registering a Signup
|
51
51
|
|
52
|
-
This method registers a new signup for the given
|
52
|
+
This method registers a new signup for the given request token and address, returning a signup assessment, containing the risk assessment and supporting evidence:
|
53
53
|
|
54
54
|
```ruby
|
55
55
|
address = Incognia::Address.new(line: "West 34th Street, New York City, NY 10001")
|
56
|
-
|
56
|
+
request_token = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
|
57
57
|
|
58
58
|
assessment = api.register_signup(
|
59
|
-
|
59
|
+
request_token: request_token,
|
60
60
|
address: address
|
61
61
|
)
|
62
62
|
|
@@ -68,11 +68,11 @@ It also supports optional parameters, for example:
|
|
68
68
|
|
69
69
|
```ruby
|
70
70
|
address = Incognia::Address.new(line: "West 34th Street, New York City, NY 10001")
|
71
|
-
|
71
|
+
request_token = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
|
72
72
|
external_id = "7b02736a-7718-4b83-8982-f68fb6f501fa"
|
73
73
|
|
74
74
|
assessment = api.register_signup(
|
75
|
-
|
75
|
+
request_token: request_token,
|
76
76
|
address: address,
|
77
77
|
external_id: external_id
|
78
78
|
)
|
@@ -82,14 +82,14 @@ assessment = api.register_signup(
|
|
82
82
|
|
83
83
|
### Registering a Login
|
84
84
|
|
85
|
-
This method registers a new login for the given
|
85
|
+
This method registers a new login for the given request token and account, returning a login assessment, containing the risk assessment and supporting evidence:
|
86
86
|
|
87
87
|
```ruby
|
88
|
-
|
88
|
+
request_token = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
|
89
89
|
account_id = 'account-identifier-123'
|
90
90
|
|
91
91
|
assessment = api.register_login(
|
92
|
-
|
92
|
+
request_token: request_token,
|
93
93
|
account_id: account_id,
|
94
94
|
)
|
95
95
|
|
@@ -100,12 +100,12 @@ assessment = api.register_login(
|
|
100
100
|
It also supports optional parameters, for example:
|
101
101
|
|
102
102
|
```ruby
|
103
|
-
|
103
|
+
request_token = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
|
104
104
|
account_id = 'account-identifier-123'
|
105
105
|
external_id = 'some-external-identifier'
|
106
106
|
|
107
107
|
assessment = api.register_login(
|
108
|
-
|
108
|
+
request_token: request_token,
|
109
109
|
account_id: account_id,
|
110
110
|
external_id: external_id,
|
111
111
|
eval: false # can be used to register a new login without evaluating it
|
@@ -116,12 +116,12 @@ assessment = api.register_login(
|
|
116
116
|
|
117
117
|
### Registering Payment
|
118
118
|
|
119
|
-
This method registers a new payment for the given
|
119
|
+
This method registers a new payment for the given request token and account, returning a `hash`,
|
120
120
|
containing the risk assessment and supporting evidence.
|
121
121
|
|
122
122
|
```ruby
|
123
123
|
assessment = api.register_payment(
|
124
|
-
|
124
|
+
request_token: 'request-token',
|
125
125
|
account_id: 'account-id'
|
126
126
|
)
|
127
127
|
|
@@ -181,7 +181,7 @@ payment_methods = [
|
|
181
181
|
]
|
182
182
|
|
183
183
|
assessment = api.register_payment(
|
184
|
-
|
184
|
+
request_token: 'request-token',
|
185
185
|
account_id: 'account-id',
|
186
186
|
external_id: 'external-id',
|
187
187
|
addresses: addresses,
|
@@ -202,14 +202,14 @@ The `expires_at` argument should be a _Time_, _DateTime_ or an date in **RFC 333
|
|
202
202
|
|
203
203
|
|
204
204
|
```ruby
|
205
|
-
|
205
|
+
request_token = 'request-token'
|
206
206
|
account_id = 'account-id'
|
207
207
|
occurred_at = DateTime.parse('2024-07-22T15:20:00Z')
|
208
208
|
|
209
209
|
success = api.register_feedback(
|
210
210
|
event: Incognia::Constants::FeedbackEvent::ACCOUNT_TAKEOVER,
|
211
211
|
occurred_at: occurred_at,
|
212
|
-
|
212
|
+
request_token: request_token,
|
213
213
|
account_id: account_id
|
214
214
|
)
|
215
215
|
|
@@ -222,7 +222,7 @@ For custom fraud, set the value of `event` with the corresponding code:
|
|
222
222
|
success = api.register_feedback(
|
223
223
|
event: 'custom_fraud_name',
|
224
224
|
occurred_at: occurred_at,
|
225
|
-
|
225
|
+
request_token: request_token,
|
226
226
|
account_id: account_id
|
227
227
|
)
|
228
228
|
|
data/lib/incognia_api/api.rb
CHANGED
@@ -15,8 +15,8 @@ module Incognia
|
|
15
15
|
host: "https://api.incognia.com/api")
|
16
16
|
end
|
17
17
|
|
18
|
-
def register_signup(
|
19
|
-
params = {
|
18
|
+
def register_signup(request_token: nil, address: nil, **opts)
|
19
|
+
params = { request_token: request_token }.compact
|
20
20
|
params.merge!(opts)
|
21
21
|
params.merge!(address&.to_hash) if address
|
22
22
|
|
@@ -29,12 +29,12 @@ module Incognia
|
|
29
29
|
SignupAssessment.from_hash(response.body) if response.success?
|
30
30
|
end
|
31
31
|
|
32
|
-
def register_login(
|
32
|
+
def register_login(account_id:, request_token: nil, **opts)
|
33
33
|
params = {
|
34
34
|
type: :login,
|
35
|
-
installation_id: installation_id,
|
36
35
|
account_id: account_id,
|
37
|
-
|
36
|
+
request_token: request_token
|
37
|
+
}.compact
|
38
38
|
params.merge!(opts)
|
39
39
|
|
40
40
|
response = connection.request(
|
@@ -67,8 +67,12 @@ module Incognia
|
|
67
67
|
response.success?
|
68
68
|
end
|
69
69
|
|
70
|
-
def register_payment(
|
71
|
-
params = {
|
70
|
+
def register_payment(account_id:, request_token: nil, **opts)
|
71
|
+
params = {
|
72
|
+
type: :payment,
|
73
|
+
account_id: account_id,
|
74
|
+
request_token: request_token
|
75
|
+
}.compact
|
72
76
|
params.merge!(opts)
|
73
77
|
|
74
78
|
response = connection.request(
|
data/lib/incognia_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incognia_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.1.6
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Official Ruby lib for communicating with Incognia API
|