smile-identity-core 2.2.2 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/release.yml +1 -1
- data/.rubocop.yml +181 -8
- data/CHANGELOG.md +72 -52
- data/Gemfile.lock +5 -3
- data/README.md +7 -7
- data/examples/aml_check.rb +3 -2
- data/examples/biometric_kyc.rb +7 -7
- data/examples/business_verification.rb +3 -3
- data/examples/document_verification.rb +9 -9
- data/examples/enhanced_document_verification.rb +74 -0
- data/examples/enhanced_kyc.rb +4 -4
- data/examples/example-project/README.md +1 -1
- data/examples/example-project/smart_bank.rb +26 -25
- data/examples/get_web_token.rb +2 -2
- data/examples/smart_selfie_authentication.rb +6 -6
- data/lib/smile-identity-core/aml_check.rb +5 -3
- data/lib/smile-identity-core/business_verification.rb +2 -2
- data/lib/smile-identity-core/constants/env.rb +4 -4
- data/lib/smile-identity-core/constants/job_type.rb +4 -0
- data/lib/smile-identity-core/id_api.rb +11 -11
- data/lib/smile-identity-core/signature.rb +1 -1
- data/lib/smile-identity-core/utilities.rb +4 -6
- data/lib/smile-identity-core/validations.rb +2 -2
- data/lib/smile-identity-core/version.rb +1 -1
- data/lib/smile-identity-core/web_api.rb +50 -48
- data/smile-identity-core.gemspec +12 -11
- metadata +11 -8
@@ -58,7 +58,7 @@ module SmileIdentityCore
|
|
58
58
|
%i[user_id job_id job_type].each do |key|
|
59
59
|
if partner_params[key].to_s.empty?
|
60
60
|
raise ArgumentError,
|
61
|
-
|
61
|
+
"Please make sure that #{key} is included in the partner params"
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -85,16 +85,18 @@ module SmileIdentityCore
|
|
85
85
|
updated_id_info[:entered] = 'false' if !updated_id_info.key?(:entered) || id_info[:entered].empty?
|
86
86
|
|
87
87
|
# if it's a boolean
|
88
|
-
updated_id_info[:entered] = id_info[:entered].to_s
|
88
|
+
updated_id_info[:entered] = id_info[:entered].to_s
|
89
89
|
|
90
90
|
is_jt6 = @partner_params[:job_type].to_i == JobType::DOCUMENT_VERIFICATION
|
91
|
-
|
91
|
+
is_jt11 = @partner_params[:job_type].to_i == JobType::ENHANCED_DOCUMENT_VERIFICATION
|
92
|
+
keys = if is_jt6 || is_jt11
|
92
93
|
%i[country]
|
93
94
|
else
|
94
95
|
%i[country id_type id_number]
|
95
96
|
end
|
97
|
+
keys.push(:id_type) if is_jt11
|
96
98
|
|
97
|
-
if updated_id_info[:entered] == 'true' || is_jt6
|
99
|
+
if updated_id_info[:entered] == 'true' || is_jt6 || is_jt11
|
98
100
|
keys.each do |key|
|
99
101
|
raise ArgumentError, "Please make sure that #{key} is included in the id_info" if id_info[key].to_s.empty?
|
100
102
|
end
|
@@ -133,18 +135,18 @@ module SmileIdentityCore
|
|
133
135
|
|
134
136
|
def request_web_token(request_params)
|
135
137
|
request_params = request_params
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
138
|
+
.merge(SmileIdentityCore::Signature.new(@partner_id, @api_key).generate_signature(Time.now.to_s))
|
139
|
+
.merge(
|
140
|
+
{ partner_id: @partner_id,
|
141
|
+
source_sdk: SmileIdentityCore::SOURCE_SDK,
|
142
|
+
source_sdk_version: SmileIdentityCore::VERSION },
|
143
|
+
)
|
142
144
|
url = "#{@url}/token"
|
143
145
|
|
144
146
|
response = Typhoeus.post(
|
145
147
|
url,
|
146
148
|
headers: { 'Content-Type' => 'application/json' },
|
147
|
-
body: request_params.to_json
|
149
|
+
body: request_params.to_json,
|
148
150
|
)
|
149
151
|
|
150
152
|
return response.body if response.code == 200
|
@@ -202,7 +204,7 @@ module SmileIdentityCore
|
|
202
204
|
model_parameters: {}, # what is this for
|
203
205
|
callback_url: @callback_url,
|
204
206
|
source_sdk: SmileIdentityCore::SOURCE_SDK,
|
205
|
-
source_sdk_version: SmileIdentityCore::VERSION
|
207
|
+
source_sdk_version: SmileIdentityCore::VERSION,
|
206
208
|
).to_json
|
207
209
|
end
|
208
210
|
|
@@ -212,7 +214,7 @@ module SmileIdentityCore
|
|
212
214
|
url,
|
213
215
|
method: 'POST',
|
214
216
|
headers: { 'Content-Type' => 'application/json' },
|
215
|
-
body: configure_prep_upload_json
|
217
|
+
body: configure_prep_upload_json,
|
216
218
|
)
|
217
219
|
|
218
220
|
request.on_complete do |response|
|
@@ -224,7 +226,7 @@ module SmileIdentityCore
|
|
224
226
|
info_json = configure_info_json(prep_upload_response)
|
225
227
|
|
226
228
|
file_upload_response = upload_file(prep_upload_response['upload_url'], info_json,
|
227
|
-
|
229
|
+
prep_upload_response['smile_job_id'])
|
228
230
|
return file_upload_response
|
229
231
|
end
|
230
232
|
|
@@ -235,38 +237,38 @@ module SmileIdentityCore
|
|
235
237
|
|
236
238
|
def configure_info_json(server_information)
|
237
239
|
{
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
240
|
+
package_information: {
|
241
|
+
apiVersion: {
|
242
|
+
buildNumber: 0,
|
243
|
+
majorVersion: 2,
|
244
|
+
minorVersion: 0,
|
243
245
|
},
|
244
|
-
|
246
|
+
language: 'ruby',
|
245
247
|
},
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
248
|
+
misc_information: SmileIdentityCore::Signature.new(@partner_id, @api_key)
|
249
|
+
.generate_signature(Time.now.to_s)
|
250
|
+
.merge(
|
251
|
+
retry: 'false',
|
252
|
+
partner_params: @partner_params,
|
253
|
+
file_name: 'selfie.zip', # figure out what to do here
|
254
|
+
smile_client_id: @partner_id,
|
255
|
+
callback_url: @callback_url,
|
256
|
+
userData: { # TO ASK what goes here
|
257
|
+
isVerifiedProcess: false,
|
258
|
+
name: '',
|
259
|
+
fbUserID: '',
|
260
|
+
firstName: 'Bill',
|
261
|
+
lastName: '',
|
262
|
+
gender: '',
|
263
|
+
email: '',
|
264
|
+
phone: '',
|
265
|
+
countryCode: '+',
|
266
|
+
countryName: '',
|
267
|
+
},
|
268
|
+
),
|
269
|
+
id_info: @id_info,
|
270
|
+
images: configure_image_payload,
|
271
|
+
server_information: server_information,
|
270
272
|
}
|
271
273
|
end
|
272
274
|
|
@@ -276,13 +278,13 @@ module SmileIdentityCore
|
|
276
278
|
{
|
277
279
|
image_type_id: i[:image_type_id],
|
278
280
|
image: '',
|
279
|
-
file_name: File.basename(i[:image])
|
281
|
+
file_name: File.basename(i[:image]),
|
280
282
|
}
|
281
283
|
else
|
282
284
|
{
|
283
285
|
image_type_id: i[:image_type_id],
|
284
286
|
image: i[:image],
|
285
|
-
file_name: ''
|
287
|
+
file_name: '',
|
286
288
|
}
|
287
289
|
end
|
288
290
|
end
|
@@ -302,7 +304,7 @@ module SmileIdentityCore
|
|
302
304
|
@images.each do |img|
|
303
305
|
if (img[:image_type_id]).zero? || img[:image_type_id] == 1
|
304
306
|
zos.put_next_entry(File.basename(img[:image]))
|
305
|
-
zos.print
|
307
|
+
zos.print File.read(img[:image])
|
306
308
|
end
|
307
309
|
end
|
308
310
|
end
|
@@ -317,7 +319,7 @@ module SmileIdentityCore
|
|
317
319
|
url,
|
318
320
|
method: 'PUT',
|
319
321
|
headers: { 'Content-Type' => 'application/zip' },
|
320
|
-
body: file.read
|
322
|
+
body: file.read,
|
321
323
|
)
|
322
324
|
|
323
325
|
request.on_complete do |response|
|
data/smile-identity-core.gemspec
CHANGED
@@ -5,21 +5,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'smile-identity-core/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
8
|
+
spec.name = 'smile-identity-core'
|
9
|
+
spec.version = SmileIdentityCore::VERSION
|
10
|
+
spec.authors = ['Smile Identity']
|
11
|
+
spec.email = ['support@usesmileid.com']
|
12
12
|
|
13
|
-
spec.summary
|
13
|
+
spec.summary = 'The Smile Identity Web API allows the user to access\
|
14
14
|
most of the features of the Smile Identity system through direct server to server queries.'
|
15
|
-
spec.description
|
16
|
-
spec.homepage
|
17
|
-
spec.required_ruby_version = '>= 2.
|
15
|
+
spec.description = 'The Official Smile Identity gem'
|
16
|
+
spec.homepage = 'https://www.usesmileid.com/'
|
17
|
+
spec.required_ruby_version = '>= 2.6'
|
18
18
|
spec.license = 'MIT'
|
19
19
|
|
20
20
|
spec.metadata['homepage_uri'] = spec.homepage
|
21
21
|
spec.metadata['source_code_uri'] = 'https://github.com/smileidentity/smile-identity-core-ruby'
|
22
|
-
spec.metadata['documentation_uri'] = 'https://docs.
|
22
|
+
spec.metadata['documentation_uri'] = 'https://docs.usesmileid.com'
|
23
23
|
spec.metadata['changelog_uri'] = 'https://github.com/smileidentity/smile-identity-core-ruby/blob/master/CHANGELOG.md'
|
24
24
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
28
28
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
29
|
end
|
30
|
-
spec.bindir
|
31
|
-
spec.executables
|
30
|
+
spec.bindir = 'exe'
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ['lib']
|
33
33
|
|
34
34
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
@@ -41,4 +41,5 @@ Gem::Specification.new do |spec|
|
|
41
41
|
|
42
42
|
spec.add_dependency 'rubyzip', '~> 1.2', '>= 1.2.3'
|
43
43
|
spec.add_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
44
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
44
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smile-identity-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Smile Identity
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,11 +150,12 @@ dependencies:
|
|
150
150
|
version: 1.0.1
|
151
151
|
description: The Official Smile Identity gem
|
152
152
|
email:
|
153
|
-
- support@
|
153
|
+
- support@usesmileid.com
|
154
154
|
executables: []
|
155
155
|
extensions: []
|
156
156
|
extra_rdoc_files: []
|
157
157
|
files:
|
158
|
+
- ".github/dependabot.yml"
|
158
159
|
- ".github/workflows/release.yml"
|
159
160
|
- ".github/workflows/test.yml"
|
160
161
|
- ".gitignore"
|
@@ -172,6 +173,7 @@ files:
|
|
172
173
|
- examples/biometric_kyc.rb
|
173
174
|
- examples/business_verification.rb
|
174
175
|
- examples/document_verification.rb
|
176
|
+
- examples/enhanced_document_verification.rb
|
175
177
|
- examples/enhanced_kyc.rb
|
176
178
|
- examples/example-project/Gemfile
|
177
179
|
- examples/example-project/Gemfile.lock
|
@@ -193,14 +195,15 @@ files:
|
|
193
195
|
- lib/smile-identity-core/version.rb
|
194
196
|
- lib/smile-identity-core/web_api.rb
|
195
197
|
- smile-identity-core.gemspec
|
196
|
-
homepage: https://www.
|
198
|
+
homepage: https://www.usesmileid.com/
|
197
199
|
licenses:
|
198
200
|
- MIT
|
199
201
|
metadata:
|
200
|
-
homepage_uri: https://www.
|
202
|
+
homepage_uri: https://www.usesmileid.com/
|
201
203
|
source_code_uri: https://github.com/smileidentity/smile-identity-core-ruby
|
202
|
-
documentation_uri: https://docs.
|
204
|
+
documentation_uri: https://docs.usesmileid.com
|
203
205
|
changelog_uri: https://github.com/smileidentity/smile-identity-core-ruby/blob/master/CHANGELOG.md
|
206
|
+
rubygems_mfa_required: 'true'
|
204
207
|
post_install_message:
|
205
208
|
rdoc_options: []
|
206
209
|
require_paths:
|
@@ -209,14 +212,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
212
|
requirements:
|
210
213
|
- - ">="
|
211
214
|
- !ruby/object:Gem::Version
|
212
|
-
version: '2.
|
215
|
+
version: '2.6'
|
213
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
217
|
requirements:
|
215
218
|
- - ">="
|
216
219
|
- !ruby/object:Gem::Version
|
217
220
|
version: '0'
|
218
221
|
requirements: []
|
219
|
-
rubygems_version: 3.
|
222
|
+
rubygems_version: 3.5.9
|
220
223
|
signing_key:
|
221
224
|
specification_version: 4
|
222
225
|
summary: The Smile Identity Web API allows the user to access\ most of the features
|