incognia_api 0.4.1 → 0.5.1
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 +8 -0
- data/Gemfile.lock +4 -4
- data/README.md +78 -0
- data/incognia_api.gemspec +2 -2
- data/lib/incognia_api/api.rb +13 -0
- data/lib/incognia_api/resources/payment_assessment.rb +5 -0
- data/lib/incognia_api/version.rb +1 -1
- data/lib/incognia_api.rb +1 -0
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c47d92b4d714fd3187bffb8af8b22ad6d77deb26ee45586c868f4de0c9c2ae26
|
4
|
+
data.tar.gz: 6c97b0b516d7b47fe4483436cf6c846f81619534a0148efa8088f147fa4a8924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e62f1b30c8a2c255d0e8e744e58303d7d1dc93f47e1a04f6828073c4cd8b901e531e2d86b02ae4fa9c9a4cf4a751f4df6dcd1e9aea1fcfc9987041edf93964f6
|
7
|
+
data.tar.gz: 3d4e6c2f6b6fff1c7972818a355bb5c14b6f72491b211c8ce186a83ab58631756b979f4b53699f1fd0e145e61716808a142834144fdc7ef8b8120cf2ed6182b5
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
incognia_api (0.
|
5
|
-
faraday
|
6
|
-
faraday_middleware
|
4
|
+
incognia_api (0.5.1)
|
5
|
+
faraday (~> 1.10)
|
6
|
+
faraday_middleware (~> 1.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -81,4 +81,4 @@ DEPENDENCIES
|
|
81
81
|
webmock
|
82
82
|
|
83
83
|
BUNDLED WITH
|
84
|
-
2.
|
84
|
+
2.4.13
|
data/README.md
CHANGED
@@ -125,6 +125,84 @@ assessment = api.register_login(
|
|
125
125
|
# => #<OpenStruct id="...", device_id="...", risk_assessment="..", evidence=...>
|
126
126
|
```
|
127
127
|
|
128
|
+
### Registering Payment
|
129
|
+
|
130
|
+
This method registers a new payment for the given installation and account, returning a `hash`,
|
131
|
+
containing the risk assessment and supporting evidence.
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
assessment = api.register_payment(
|
135
|
+
installation_id: 'installation-id',
|
136
|
+
account_id: 'account-id'
|
137
|
+
)
|
138
|
+
|
139
|
+
# => #<OpenStruct id="...", device_id="...", risk_assessment="..", evidence=...>
|
140
|
+
```
|
141
|
+
|
142
|
+
It also supports optional parameters, for example:
|
143
|
+
|
144
|
+
```ruby
|
145
|
+
addresses = [
|
146
|
+
{
|
147
|
+
'type': 'shipping',
|
148
|
+
'structured_address': {
|
149
|
+
'locale': 'pt-BR',
|
150
|
+
'country_name': 'Brasil',
|
151
|
+
'country_code': 'BR',
|
152
|
+
'state': 'SP',
|
153
|
+
'city': 'São Paulo',
|
154
|
+
'borough': '',
|
155
|
+
'neighborhood': 'Bela Vista',
|
156
|
+
'street': 'Av. Paulista',
|
157
|
+
'number': '1578',
|
158
|
+
'complements': 'Andar 2',
|
159
|
+
'postal_code': '01310-200'
|
160
|
+
},
|
161
|
+
'address_coordinates': {
|
162
|
+
'lat': -23.561414,
|
163
|
+
'lng': -46.6558819
|
164
|
+
}
|
165
|
+
}
|
166
|
+
]
|
167
|
+
|
168
|
+
payment_value = {
|
169
|
+
'amount': 5.0,
|
170
|
+
'currency': 'BRL'
|
171
|
+
}
|
172
|
+
|
173
|
+
payment_methods = [
|
174
|
+
{
|
175
|
+
'type': 'credit_card',
|
176
|
+
'credit_card_info': {
|
177
|
+
'bin': '123456',
|
178
|
+
'last_four_digits': '1234',
|
179
|
+
'expiry_year': '2027',
|
180
|
+
'expiry_month': '10'
|
181
|
+
}
|
182
|
+
},
|
183
|
+
{
|
184
|
+
'type': 'debit_card',
|
185
|
+
'debit_card_info': {
|
186
|
+
'bin': '123456',
|
187
|
+
'last_four_digits': '1234',
|
188
|
+
'expiry_year': '2027',
|
189
|
+
'expiry_month': '10'
|
190
|
+
}
|
191
|
+
}
|
192
|
+
]
|
193
|
+
|
194
|
+
assessment = api.register_payment(
|
195
|
+
installation_id: 'installation-id',
|
196
|
+
account_id: 'account-id',
|
197
|
+
external_id: 'external-id',
|
198
|
+
addresses: addresses,
|
199
|
+
payment_value: payment_value,
|
200
|
+
payment_methods: payment_methods
|
201
|
+
)
|
202
|
+
|
203
|
+
# => #<OpenStruct id="...", device_id="...", risk_assessment="..", evidence=...>
|
204
|
+
```
|
205
|
+
|
128
206
|
### Registering a Feedback
|
129
207
|
|
130
208
|
This method registers a feedback event for the given identifiers (optional arguments), returning true when success.
|
data/incognia_api.gemspec
CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
# Uncomment to register a new dependency of your gem
|
30
30
|
# spec.add_dependency "example-gem", "~> 1.0"
|
31
|
-
spec.add_dependency('faraday')
|
32
|
-
spec.add_dependency('faraday_middleware')
|
31
|
+
spec.add_dependency('faraday', '~> 1.10')
|
32
|
+
spec.add_dependency('faraday_middleware', '~> 1.2')
|
33
33
|
|
34
34
|
# For more information and examples about making a new gem, checkout our
|
35
35
|
# guide at: https://bundler.io/guides/creating_gem.html
|
data/lib/incognia_api/api.rb
CHANGED
@@ -69,5 +69,18 @@ module Incognia
|
|
69
69
|
|
70
70
|
response.success?
|
71
71
|
end
|
72
|
+
|
73
|
+
def register_payment(installation_id:, account_id:, **opts)
|
74
|
+
params = { installation_id: installation_id, account_id: account_id, type: :payment }
|
75
|
+
params.merge!(opts)
|
76
|
+
|
77
|
+
response = connection.request(
|
78
|
+
:post,
|
79
|
+
'v2/authentication/transactions',
|
80
|
+
params
|
81
|
+
)
|
82
|
+
|
83
|
+
PaymentAssessment.from_hash(response.body) if response.success?
|
84
|
+
end
|
72
85
|
end
|
73
86
|
end
|
data/lib/incognia_api/version.rb
CHANGED
data/lib/incognia_api.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative "incognia_api/api"
|
|
9
9
|
require_relative "incognia_api/resources/api_resource"
|
10
10
|
require_relative "incognia_api/resources/signup_assessment"
|
11
11
|
require_relative "incognia_api/resources/login_assessment"
|
12
|
+
require_relative "incognia_api/resources/payment_assessment"
|
12
13
|
require_relative "incognia_api/resources/credentials"
|
13
14
|
|
14
15
|
require_relative "incognia_api/constants/feedback_event"
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incognia_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.10'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1.2'
|
41
41
|
description: Official Ruby lib for communicating with Incognia API
|
42
42
|
email:
|
43
43
|
- guiocavalcanti@gmail.com
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/incognia_api/resources/api_resource.rb
|
68
68
|
- lib/incognia_api/resources/credentials.rb
|
69
69
|
- lib/incognia_api/resources/login_assessment.rb
|
70
|
+
- lib/incognia_api/resources/payment_assessment.rb
|
70
71
|
- lib/incognia_api/resources/signup_assessment.rb
|
71
72
|
- lib/incognia_api/util.rb
|
72
73
|
- lib/incognia_api/version.rb
|