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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a8273559cc0083cb3373809d8ecf76edd3f843cb40b49b450e6ec2fc2de4455
4
- data.tar.gz: 598e1eeb493b7f9eba3882b032e33803d472181bfbb61a9e9b7e60f2fbf67512
3
+ metadata.gz: f17e031979fde13ac3ac30d9cc3ebf9369da407eef0aec67e0313dcfa9c1ecd3
4
+ data.tar.gz: ecbd6959f1546fa24d5d85d5f7e95e8980539ab2fddca46838e46076571bc8b4
5
5
  SHA512:
6
- metadata.gz: f7bb01031ef75a1dc426bff6ef8fec7d17dd9d0a7022db6c0ccac7a8bc1c2a552b30ebd779fe094eeed45b57d8d60f922fffb1ccae72430c992fd290118af627
7
- data.tar.gz: 63e398c7600a573d4cbcf742953944a63e2c116382c976e7dcc819bc4e6908ea7d0fa42e98d0fadea2753bc2e187d2e198613e534be019ace70f176f8101c4cf
6
+ metadata.gz: 0f9945bb733db1fb2015636f85b3342684635a027ff70d8bd493887365085b893877ca4ea77d3f8c4e937cccfd2c4cf580bcf8223505bbfdebf5b61ada4684fe
7
+ data.tar.gz: 4f85f0ab80d4f9ca47509a6ff9edf78514990de7d0d25a3cd6c8e2a90fdbc904516d554189ad29651aae120b20ee5afe61e7ecfa80bb3f0b511c0882664d0cdb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.2.0] - 2024-08-26
4
+
5
+ - Removes the requirement to send installation id to register signup, login and payment
6
+
3
7
  ## [1.1.0] - 2024-07-24
4
8
 
5
9
  - Add support to passing request_token and occurred_at to #register_feedback
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incognia_api (1.1.0)
4
+ incognia_api (1.2.0)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.2)
7
7
 
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 installation and address, returning a signup assessment, containing the risk assessment and supporting evidence:
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
- installation_id = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
56
+ request_token = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
57
57
 
58
58
  assessment = api.register_signup(
59
- installation_id: installation_id,
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
- installation_id = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
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
- installation_id: installation_id,
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 installation and account, returning a login assessment, containing the risk assessment and supporting evidence:
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
- installation_id = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
88
+ request_token = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
89
89
  account_id = 'account-identifier-123'
90
90
 
91
91
  assessment = api.register_login(
92
- installation_id: installation_id,
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
- installation_id = "WlMksW+jh5GPhqWBorsV8yDihoSHHpmt+DpjJ7eYxpHhuO/5tuHTuA..."
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
- installation_id: installation_id,
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 installation and account, returning a `hash`,
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
- installation_id: 'installation-id',
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
- installation_id: 'installation-id',
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
- installation_id = 'installation-id'
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
- installation_id: installation_id,
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
- installation_id: installation_id,
225
+ request_token: request_token,
226
226
  account_id: account_id
227
227
  )
228
228
 
@@ -15,8 +15,8 @@ module Incognia
15
15
  host: "https://api.incognia.com/api")
16
16
  end
17
17
 
18
- def register_signup(installation_id:, address: nil, **opts)
19
- params = { installation_id: installation_id }
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(installation_id:, account_id:, **opts)
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(installation_id:, account_id:, **opts)
71
- params = { installation_id: installation_id, account_id: account_id, type: :payment }
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(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Incognia
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
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.1.0
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-07-25 00:00:00.000000000 Z
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.4.19
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