incognia_api 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/incognia_api/api.rb +5 -27
- data/lib/incognia_api/constants/feedback_event.rb +8 -6
- data/lib/incognia_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: 3fb783b99b2bfd7a392bc8208308f946ad62aaf2aa538bdfa291e86ac5b86d5a
|
4
|
+
data.tar.gz: 0aa4f32696dfffe2f15deecd250d4faf4118ccd647b293d10b8fe88b3cb0ed07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '074959772f96adda32ab81e8b21ae024d1cd820c90e2e81997e2abd878c86b50967ce6131ff44bc55764c9d1140de4ecb5b4889a0de6f862bb7f156e91b7f1e8'
|
7
|
+
data.tar.gz: 34638c23171aa08dc79b8141f036275b843286225871c2d8f138fd2abcca821594d31d9f76c03c030e9d420a30f071c96b01b03a846b0b7ad0c1a44a7856c639
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [2.0.0] - 2024-11-12
|
4
|
+
|
5
|
+
- Remove support for instance usage of Incognia::Api
|
6
|
+
- Remove invalid feedback types
|
7
|
+
- Remove support for sending feedback timestamp
|
8
|
+
|
9
|
+
## [1.3.0] - 2024-11-12
|
4
10
|
|
5
11
|
- Add support for general configuration and use Incognia::Api as a static class
|
6
12
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -198,7 +198,7 @@ assessment = Incognia::Api.register_payment(
|
|
198
198
|
|
199
199
|
This method registers a feedback event for the given identifiers (optional arguments), returning true when success.
|
200
200
|
|
201
|
-
The `
|
201
|
+
The `occurred_at` argument should be a _Time_, _DateTime_ or an date in **RFC 3339** format.
|
202
202
|
|
203
203
|
The `expires_at` argument should be a _Time_, _DateTime_ or an date in **RFC 3339** format.
|
204
204
|
|
data/lib/incognia_api/api.rb
CHANGED
@@ -5,27 +5,10 @@ require 'faraday_middleware'
|
|
5
5
|
|
6
6
|
module Incognia
|
7
7
|
class Api
|
8
|
-
# business layer: uses the Client.instance to build domain objects
|
9
|
-
# raises missing parameters errors
|
10
|
-
|
11
|
-
def initialize(client_id:, client_secret:)
|
12
|
-
Incognia.configure(client_id: client_id, client_secret: client_secret)
|
13
|
-
|
14
|
-
warn("Deprecation warning: The Incognia::Api instance will be removed. " +
|
15
|
-
"Please set up with `Incognia.configure` and use class methods instead.")
|
16
|
-
end
|
17
|
-
|
18
|
-
def register_signup(**args); self.class.register_signup(**args) end
|
19
|
-
def register_login(**args); self.class.register_login(**args) end
|
20
|
-
def register_feedback(**args); self.class.register_feedback(**args) end
|
21
|
-
def register_payment(**args); self.class.register_payment(**args) end
|
22
|
-
def connection
|
23
|
-
warn("Deprecation warning: #connection and .connection are deprecated and will be private.")
|
24
|
-
|
25
|
-
self.class.connection
|
26
|
-
end
|
27
|
-
|
28
8
|
class << self
|
9
|
+
# business layer: uses the Client.instance to build domain objects
|
10
|
+
# raises missing parameters errors
|
11
|
+
|
29
12
|
def register_signup(request_token: nil, address: nil, **opts)
|
30
13
|
params = { request_token: request_token }.compact
|
31
14
|
params.merge!(opts)
|
@@ -57,16 +40,11 @@ module Incognia
|
|
57
40
|
LoginAssessment.from_hash(response.body) if response.success?
|
58
41
|
end
|
59
42
|
|
60
|
-
def register_feedback(event:, occurred_at: nil, expires_at: nil,
|
61
|
-
if !timestamp.nil?
|
62
|
-
warn("Deprecation warning: use occurred_at instead of timestamp")
|
63
|
-
end
|
64
|
-
|
65
|
-
timestamp = timestamp.strftime('%s%L') if timestamp.respond_to? :strftime
|
43
|
+
def register_feedback(event:, occurred_at: nil, expires_at: nil, **ids)
|
66
44
|
occurred_at = occurred_at.to_datetime.rfc3339 if occurred_at.respond_to? :to_datetime
|
67
45
|
expires_at = expires_at.to_datetime.rfc3339 if expires_at.respond_to? :to_datetime
|
68
46
|
|
69
|
-
params = { event: event,
|
47
|
+
params = { event: event, occurred_at: occurred_at, expires_at: expires_at }.compact
|
70
48
|
params.merge!(ids)
|
71
49
|
|
72
50
|
response = connection.request(
|
@@ -1,16 +1,13 @@
|
|
1
1
|
module Incognia
|
2
2
|
module Constants
|
3
3
|
module FeedbackEvent
|
4
|
+
ACCOUNT_ALLOWED = 'account_allowed'.freeze
|
4
5
|
ACCOUNT_TAKEOVER = 'account_takeover'.freeze
|
5
|
-
CHALLENGE_FAILED = 'challenge_failed'.freeze
|
6
|
-
CHALLENGE_PASSED = 'challenge_passed'.freeze
|
7
6
|
CHARGEBACK = 'chargeback'.freeze
|
8
7
|
CHARGEBACK_NOTIFICATION = 'chargeback_notification'.freeze
|
9
|
-
IDENTITY_FRAUD = 'identity_fraud'.freeze
|
10
|
-
MPOS_FRAUD = 'mpos_fraud'.freeze
|
11
|
-
PASSWORD_CHANGE_FAILED = 'password_change_failed'.freeze
|
12
|
-
PASSWORD_CHANGED_SUCCESSFULLY = 'password_changed_successfully'.freeze
|
13
8
|
PROMOTION_ABUSE = 'promotion_abuse'.freeze
|
9
|
+
DEVICE_ALLOWED = 'device_allowed'.freeze
|
10
|
+
IDENTITY_FRAUD = 'identity_fraud'.freeze
|
14
11
|
RESET = 'reset'.freeze
|
15
12
|
VERIFIED = 'verified'.freeze
|
16
13
|
|
@@ -18,7 +15,12 @@ module Incognia
|
|
18
15
|
SIGNUP_DECLINED = 'signup_declined'.freeze
|
19
16
|
|
20
17
|
LOGIN_ACCEPTED = 'login_accepted'.freeze
|
18
|
+
LOGIN_ACCEPTED_BY_DEVICE_VERIFICATION = 'login_accepted_by_device_verification'.freeze
|
19
|
+
LOGIN_ACCEPTED_BY_FACIAL_BIOMETRICS = 'login_accepted_by_facial_biometrics'.freeze
|
20
|
+
LOGIN_ACCEPTED_BY_MANUAL_REVIEW = 'login_accepted_by_manual_review'.freeze
|
21
21
|
LOGIN_DECLINED = 'login_declined'.freeze
|
22
|
+
LOGIN_DECLINED_BY_FACIAL_BIOMETRICS = 'login_declined_by_facial_biometrics'.freeze
|
23
|
+
LOGIN_DECLINED_BY_MANUAL_REVIEW = 'login_declined_by_manual_review'.freeze
|
22
24
|
|
23
25
|
PAYMENT_ACCEPTED = 'payment_accepted'.freeze
|
24
26
|
PAYMENT_ACCEPTED_BY_CONTROL_GROUP = 'payment_accepted_by_control_group'.freeze
|
data/lib/incognia_api/version.rb
CHANGED