kount_complete 1.0.7 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kount/Response.rb +457 -0
- data/lib/kount/client.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae7d7494a691a9ea03efd2d6a043989c33b9c0f515a1367ae2734ab954368594
|
4
|
+
data.tar.gz: 3e7cad56158473246054a87efeaf546c17ce3107aab07135123777741f9525d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 727537cdd538671965d3156f0b1b4b17d5028cc18e2379ec9085894420af013397c7910a019781cdec5a484be9a1cb446be277a2090ed3701aa23bcc03902274
|
7
|
+
data.tar.gz: c741315e192dd9955ccb9450f6b030c63d9e36e474c3aaefa8f56a0e2ea681262e85630b73be6730996e4400867cc4914b4a99a34931a754b9d6cff820e6a2b2
|
@@ -0,0 +1,457 @@
|
|
1
|
+
require 'json'
|
2
|
+
module Response
|
3
|
+
|
4
|
+
class Resp
|
5
|
+
def initialize(paramlist)
|
6
|
+
@paramlist = paramlist
|
7
|
+
puts @paramlist
|
8
|
+
end
|
9
|
+
|
10
|
+
def getMode
|
11
|
+
modes = @paramlist["MODE"].to_s()
|
12
|
+
if !modes.empty?
|
13
|
+
return modes
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def getVersion
|
19
|
+
vers = @paramlist["VERS"].to_s()
|
20
|
+
if !vers.empty?
|
21
|
+
return vers
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def getTransactionId
|
26
|
+
tran = @paramlist["TRAN"].to_s()
|
27
|
+
if !tran.empty?
|
28
|
+
return tran
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def getMerchantId
|
33
|
+
merchantid = @paramlist["MERC"].to_s()
|
34
|
+
if !merchantid.empty?
|
35
|
+
return merchantid
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def getSessionId
|
40
|
+
sessionid = @paramlist["SESS"].to_s()
|
41
|
+
if !sessionid.empty?
|
42
|
+
return sessionid
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def getOrderNumber
|
47
|
+
orderno = @paramlist["ORDR"].to_s()
|
48
|
+
if !orderno.empty?
|
49
|
+
return orderno
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def getSite
|
54
|
+
site = @paramlist["SITE"].to_s()
|
55
|
+
if !site.empty?
|
56
|
+
return site
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def getAuto
|
61
|
+
auto = @paramlist["AUTO"].to_s()
|
62
|
+
if !auto.empty?
|
63
|
+
return auto
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def getScore
|
68
|
+
score = @paramlist["SCOR"].to_s()
|
69
|
+
if !score.empty?
|
70
|
+
return score
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def getOmniscore
|
75
|
+
omniscore = @paramlist['OMNISCORE'].to_s()
|
76
|
+
if !omniscore.empty?
|
77
|
+
return omniscore
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def getGeox
|
82
|
+
geox = @paramlist["GEOX"].to_s()
|
83
|
+
if !geox.empty?
|
84
|
+
return geox
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def getBrand
|
89
|
+
brand = @paramlist["BRND"].to_s()
|
90
|
+
if !brand.empty?
|
91
|
+
return brand
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def getVelo
|
96
|
+
velo = @paramlist["VELO"].to_s()
|
97
|
+
if !velo.empty?
|
98
|
+
return velo
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def getVmax
|
103
|
+
vmax = @paramlist["VMAX"].to_s()
|
104
|
+
if !vmax.empty?
|
105
|
+
return vmax
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def getNetwork
|
110
|
+
network = @paramlist["NETW"].to_s()
|
111
|
+
if !network.empty?
|
112
|
+
return network
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def getRegion
|
117
|
+
region = @paramlist["REGN"].to_s()
|
118
|
+
if !region.empty?
|
119
|
+
return region
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def getKaptcha
|
124
|
+
kapt = @paramlist["KAPT"].to_s()
|
125
|
+
if !kapt.empty?
|
126
|
+
return kapt
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def getProxy
|
131
|
+
proxy = @paramlist["PROXY"].to_s()
|
132
|
+
if !proxy.empty?
|
133
|
+
return proxy
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def getEmails
|
138
|
+
email = @paramlist["EMAILS"].to_s()
|
139
|
+
if !email.empty?
|
140
|
+
return email
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def getHttpCountry
|
145
|
+
httmcountry = @paramlist["HTTP_COUNTRY"].to_s()
|
146
|
+
if !httmcountry.empty?
|
147
|
+
return httmcountry
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def getTimeZone
|
152
|
+
timezone = @paramlist["TIMEZONE"].to_s()
|
153
|
+
if !timezone.empty?
|
154
|
+
return timezone
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def getCards
|
159
|
+
cards = @paramlist["CARDS"].to_s()
|
160
|
+
if !cards.empty?
|
161
|
+
return cards
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def getPcRemote
|
166
|
+
pcremote = @paramlist["PC_REMOTE"].to_s()
|
167
|
+
if !pcremote.empty?
|
168
|
+
return pcremote
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def getDevices
|
173
|
+
devices = @paramlist["DEVICES"].to_s()
|
174
|
+
if !devices.empty?
|
175
|
+
return devices
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def getDeviceLayers
|
180
|
+
device_layers = @paramlist["DEVICE_LAYERS"].to_s()
|
181
|
+
if !device_layers.empty?
|
182
|
+
return device_layers
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def getMobileForwarder
|
187
|
+
mobile_forwarder = @paramlist["MOBILE_FORWARDER"].to_s()
|
188
|
+
if !mobile_forwarder.empty?
|
189
|
+
return mobile_forwarder
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
def getVoiceDevice
|
194
|
+
voicedevice = @paramlist["VOICE_DEVICE"].to_s()
|
195
|
+
if !voicedevice.empty?
|
196
|
+
return voicedevice
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
def getLocalTime
|
201
|
+
localtime = @paramlist["LOCALTIME"].to_s()
|
202
|
+
if !localtime.empty?
|
203
|
+
return localtime
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
def getMobileType
|
208
|
+
mobiletype = @paramlist["MOBILE_TYPE"].to_s()
|
209
|
+
if !mobiletype.empty?
|
210
|
+
return mobiletype
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def getFingerPrint
|
215
|
+
fingerprint = @paramlist["FINGERPRINT"].to_s()
|
216
|
+
if !fingerprint.empty?
|
217
|
+
return fingerprint
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
def getFlash
|
222
|
+
flash = @paramlist["FLASH"].to_s()
|
223
|
+
if !flash.empty?
|
224
|
+
return flash
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
def getLanguage
|
229
|
+
language = @paramlist["LANGUAGE"].to_s()
|
230
|
+
if !language.empty?
|
231
|
+
return language
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
def getCountry
|
236
|
+
country = @paramlist["COUNTRY"].to_s()
|
237
|
+
if !country.empty?
|
238
|
+
return country
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
def getJavaScript
|
243
|
+
javascript = @paramlist["JAVASCRIPT"].to_s()
|
244
|
+
if !javascript.empty?
|
245
|
+
return javascript
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
def getCookies
|
250
|
+
cookie = @paramlist["COOKIES"].to_s()
|
251
|
+
if !cookie.empty?
|
252
|
+
return cookie
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
def getMobileDevice
|
257
|
+
mobiledevice = @paramlist["MOBILE_DEVICE"].to_s()
|
258
|
+
if !mobiledevice.empty?
|
259
|
+
return mobiledevice
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
def getPiercedIPAddress
|
264
|
+
pip_address = @paramlist["PIP_IPAD"].to_s()
|
265
|
+
if !pip_address.empty?
|
266
|
+
return pip_address
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
def getPiercedIPAddressLatitude
|
271
|
+
pip_lat = @paramlist["PIP_LAT"].to_s()
|
272
|
+
if !pip_lat.empty?
|
273
|
+
return pip_lat
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
def getPiercedIPAddressLongitude
|
278
|
+
pip_long = @paramlist["PIP_LON"].to_s()
|
279
|
+
if !pip_long.empty?
|
280
|
+
return pip_long
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
def getPiercedIPAddressCountry
|
285
|
+
pip_country = @paramlist["PIP_COUNTRY"].to_s()
|
286
|
+
if !pip_country.empty?
|
287
|
+
return pip_country
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
def getPiercedIPAddressRegion
|
292
|
+
pip_region = @paramlist["PIP_REGION"].to_s()
|
293
|
+
if !pip_region.empty?
|
294
|
+
return pip_region
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
def getPiercedIPAddressCity
|
299
|
+
pip_city = @paramlist["PIP_CITY"].to_s()
|
300
|
+
if !pip_city.empty?
|
301
|
+
return pip_city
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
def getPiercedIPAddressOrganization
|
306
|
+
pip_org = @paramlist["PIP_ORG"].to_s()
|
307
|
+
if !pip_org.empty?
|
308
|
+
return pip_org
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
def getIPAddress
|
313
|
+
ip_ipad = @paramlist["IP_IPAD"].to_s()
|
314
|
+
if !ip_ipad.empty?
|
315
|
+
return ip_ipad
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
def getIPAddressLatitude
|
320
|
+
ip_lat = @paramlist["IP_LAT"].to_s()
|
321
|
+
if !ip_lat.empty?
|
322
|
+
return ip_lat
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
def getIPAddressLongitude
|
327
|
+
ip_long = @paramlist["IP_LON"].to_s()
|
328
|
+
if !ip_long.empty?
|
329
|
+
return ip_long
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
def getIPAddressCountry
|
334
|
+
ip_country = @paramlist["IP_COUNTRY"].to_s()
|
335
|
+
if !ip_country.empty?
|
336
|
+
return ip_country
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
def getIPAddressRegion
|
341
|
+
ip_region = @paramlist["IP_REGION"].to_s()
|
342
|
+
if !ip_region.empty?
|
343
|
+
return ip_region
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
def getIPAddressCity
|
348
|
+
ip_city = @paramlist["IP_CITY"].to_s()
|
349
|
+
if !ip_city.empty?
|
350
|
+
return ip_city
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
def getIPAddressOrganization
|
355
|
+
ip_org = @paramlist["IP_ORG"].to_s()
|
356
|
+
if !ip_org.empty?
|
357
|
+
return ip_org
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
def getDateDeviceFirstSeen
|
362
|
+
ddfs = @paramlist["DDFS"].to_s()
|
363
|
+
if !ddfs.empty?
|
364
|
+
return ddfs
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
def getUserAgentString
|
369
|
+
user_agent = @paramlist["UAS"].to_s()
|
370
|
+
if !user_agent.empty?
|
371
|
+
return user_agent
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
def getDeviceScreenResolution
|
376
|
+
dsr = @paramlist["DSR"].to_s()
|
377
|
+
if !dsr.empty?
|
378
|
+
return dsr
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
382
|
+
def getOS
|
383
|
+
os = @paramlist["OS"].to_s()
|
384
|
+
if !os.empty?
|
385
|
+
return os
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
def getBrowser
|
390
|
+
browser = @paramlist["BROWSER"].to_s()
|
391
|
+
if !browser.empty?
|
392
|
+
return browser
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
def getNumberRulesTriggered
|
397
|
+
no_rules_triggered = @paramlist["RULES_TRIGGERED"].to_s()
|
398
|
+
return no_rules_triggered
|
399
|
+
end
|
400
|
+
|
401
|
+
def getRulesTriggered
|
402
|
+
rules_count = getNumberRulesTriggered()
|
403
|
+
rules = Array.new
|
404
|
+
for i in 0..rules_count.to_i()-1
|
405
|
+
ruleid = @paramlist["RULE_ID_#{i}"]
|
406
|
+
rules[ruleid.to_i()] = @paramlist["RULE_DESCRIPTION_#{i}"]
|
407
|
+
end
|
408
|
+
return rules.compact
|
409
|
+
|
410
|
+
end
|
411
|
+
|
412
|
+
def getWarningCount
|
413
|
+
warning_count = @paramlist["WARNING_COUNT"].to_s()
|
414
|
+
return warning_count
|
415
|
+
end
|
416
|
+
|
417
|
+
def getWarnings
|
418
|
+
warnings = Array.new
|
419
|
+
warningcount = getWarningCount()
|
420
|
+
for i in 0..warningcount.to_i()-1
|
421
|
+
warnings = @paramlist["WARNING_#{i}"]
|
422
|
+
end
|
423
|
+
return warnings.compact
|
424
|
+
end
|
425
|
+
|
426
|
+
def getErrorCount
|
427
|
+
errorcount = @paramlist["ERROR_COUNT"].to_s()
|
428
|
+
return errorcount
|
429
|
+
end
|
430
|
+
|
431
|
+
def getErrors
|
432
|
+
errors = Array.new
|
433
|
+
error_count = getErrorCount()
|
434
|
+
for i in 0..error_count.to_i()-1
|
435
|
+
errors = @paramlist["ERROR_#{i}"]
|
436
|
+
end
|
437
|
+
return errors.compact
|
438
|
+
end
|
439
|
+
|
440
|
+
def getNumberCountersTriggered
|
441
|
+
count_triggered = @paramlist["COUNTERS_TRIGGERED"].to_s()
|
442
|
+
return count_triggered
|
443
|
+
end
|
444
|
+
|
445
|
+
def getCountersTriggered
|
446
|
+
counters = Array.new
|
447
|
+
numCounters = getCountersTriggered()
|
448
|
+
for i in 0..counters.to_i()-1
|
449
|
+
countername = @paramlist["COUNTER_NAME_#{i}"]
|
450
|
+
counters[countername.to_s()] = @paramlist["COUNTER_VALUE_#{i}"]
|
451
|
+
end
|
452
|
+
return counters.compact
|
453
|
+
end
|
454
|
+
|
455
|
+
end
|
456
|
+
|
457
|
+
end
|
data/lib/kount/client.rb
CHANGED
@@ -18,7 +18,7 @@ module Kount
|
|
18
18
|
RESPONSE_FORMAT = 'JSON'
|
19
19
|
|
20
20
|
# RIS Version. Can be overridden my merchant if required.
|
21
|
-
DEFAULT_VERSION = '
|
21
|
+
DEFAULT_VERSION = '0700'
|
22
22
|
|
23
23
|
# Default endpoint for production. Used by the DEFAULT_OPTIONS
|
24
24
|
ENDPOINT_PROD = 'https://risk.kount.net'
|
@@ -67,7 +67,7 @@ module Kount
|
|
67
67
|
response = RestClient::Resource.new(
|
68
68
|
endpoint,
|
69
69
|
verify_ssl: verify_ssl_option, timeout: 1).post params, x_kount_api_key: key
|
70
|
-
|
70
|
+
|
71
71
|
JSON.parse(response)
|
72
72
|
rescue
|
73
73
|
# RIS errors do not come back as JSON, so just pass them along raw.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kount_complete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kount
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -51,6 +51,7 @@ extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
53
|
- lib/kount.rb
|
54
|
+
- lib/kount/Response.rb
|
54
55
|
- lib/kount/cart.rb
|
55
56
|
- lib/kount/client.rb
|
56
57
|
- lib/kount/payment_types.rb
|