incognia_api 1.3.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a57edb1d744307af54b8b03d93f7b607f919cf41a66f71d92e3df45db1569b13
4
- data.tar.gz: e572c70ff386ddb53c47a7921ff4b9ad1439a27188322c23d2098af1d2f77e03
3
+ metadata.gz: 3fb783b99b2bfd7a392bc8208308f946ad62aaf2aa538bdfa291e86ac5b86d5a
4
+ data.tar.gz: 0aa4f32696dfffe2f15deecd250d4faf4118ccd647b293d10b8fe88b3cb0ed07
5
5
  SHA512:
6
- metadata.gz: 942653d86e52ced892b20eaf9684fc0ed43535742f6d265c5b886caa5491bfdaedc56521d38c5ae8ed142d4f8196a13ee117d632c3dd7906977e8bdc3ff2687a
7
- data.tar.gz: 15f3d172105df2645d60f94850abee3e280eb5ae425431e9409fb782eb49de21f1003c8d8fe6f8b7ae19e870c9738da97e980631adf8133c12f29ff021578a59
6
+ metadata.gz: '074959772f96adda32ab81e8b21ae024d1cd820c90e2e81997e2abd878c86b50967ce6131ff44bc55764c9d1140de4ecb5b4889a0de6f862bb7f156e91b7f1e8'
7
+ data.tar.gz: 34638c23171aa08dc79b8141f036275b843286225871c2d8f138fd2abcca821594d31d9f76c03c030e9d420a30f071c96b01b03a846b0b7ad0c1a44a7856c639
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [1.3.0] - 2024-10-30
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incognia_api (1.3.0)
4
+ incognia_api (2.0.0)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.2)
7
7
 
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 `timestamp` argument should be a _Time_, _DateTime_ or an _Integer_ being the timestamp in milliseconds.
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
 
@@ -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, timestamp: nil, **ids)
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, timestamp: timestamp&.to_i, occurred_at: occurred_at, expires_at: expires_at }.compact
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Incognia
4
- VERSION = "1.3.0"
4
+ VERSION = "2.0.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: incognia_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Cavalcanti