kount_complete 2.0.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89d6e66be40078e26b18861dbd0bb99ff427acfa1ff0717d1f9092efadc0250a
4
- data.tar.gz: '086b6abb447bb81459b6ad933213e81e6a9e690e9a945d4c4cd6aed8774973ca'
3
+ metadata.gz: e78ba40ade6af05b00f647e187aa66351ca6cd67472b5de0b84f39b2008326a9
4
+ data.tar.gz: 8a149dffc64cf06e1e00f96765ce004ab2df2c44465f51853e353882581bef7a
5
5
  SHA512:
6
- metadata.gz: 211dc77e3326c05bcd7fb27cfa173c3eba9f733dd3943004110b7e85b8a206ed06180b045fb3652597eba54145a58690b0bc92f4469d83a38bda9d447e0fa79b
7
- data.tar.gz: 0f34dec4c5891478ed8c0cc57d60809476d90a74438c59469fd90232bb973e839ec6e4cbcdfda1b6b07be946792f8548552ed11eb6b3b45f57d540a1d6ddc8fe
6
+ metadata.gz: fb98d21ba72460bcc18c5b7581110566969755c1bc476e6b6e834c34928b626b16a92fca128a36ac99d2de82928877ee55275650b91d698607fb843ed84c1b56
7
+ data.tar.gz: f7e0937dda76d2919e20487a34d8c51a337b79745c7b72d5ec5527e1bfd1a76e5ffbeabdc8e590693c9e935266305015507c6f9b93c1481c17e54167ca711f50
@@ -233,6 +233,16 @@ module Response
233
233
  return ip_lat unless ip_lat.empty?
234
234
  end
235
235
 
236
+ def get_previous_whitelisted
237
+ whitelisted = @paramlist['PREVIOUSLY_WHITELISTED'].to_s
238
+ return whitelisted unless whitelisted.empty?
239
+ end
240
+
241
+ def get_secure_merchant_response
242
+ merchant_response = @paramlist['THREE_DS_MERCHANT_RESPONSE'].to_s
243
+ return merchant_response unless merchant_response.empty?
244
+ end
245
+
236
246
  def get_ipaddress_longitude
237
247
  ip_long = @paramlist['IP_LON'].to_s
238
248
  return ip_long unless ip_long.empty?
@@ -284,8 +294,8 @@ module Response
284
294
  end
285
295
 
286
296
  def get_numberrules_triggered
287
- no_rules_triggered = @paramlist['RULES_TRIGGERED'].to_s
288
- no_rules_triggered
297
+ # changed due to rubocop styling rules for ruby
298
+ @paramlist['RULES_TRIGGERED'].to_s
289
299
  end
290
300
 
291
301
  def get_rules_triggered
@@ -299,8 +309,8 @@ module Response
299
309
  end
300
310
 
301
311
  def get_warning_count
302
- warning_count = @paramlist['WARNING_COUNT'].to_s
303
- warning_count
312
+ # changed due to rubocop styling rules for ruby
313
+ @paramlist['WARNING_COUNT'].to_s
304
314
  end
305
315
 
306
316
  def get_warnings
@@ -313,8 +323,8 @@ module Response
313
323
  end
314
324
 
315
325
  def get_error_count
316
- errorcount = @paramlist['ERROR_COUNT'].to_s
317
- errorcount
326
+ # changed due to rubocop styling rules for ruby
327
+ @paramlist['ERROR_COUNT'].to_s
318
328
  end
319
329
 
320
330
  def geterrors
@@ -327,8 +337,8 @@ module Response
327
337
  end
328
338
 
329
339
  def get_numbercounters_triggered
330
- count_triggered = @paramlist['COUNTERS_TRIGGERED'].to_s
331
- count_triggered
340
+ # changed due to rubocop styling rules for ruby
341
+ @paramlist['COUNTERS_TRIGGERED'].to_s
332
342
  end
333
343
 
334
344
  def get_counters_triggered
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 = '0700'
21
+ DEFAULT_VERSION = '0720'
22
22
 
23
23
  # Default endpoint for production. Used by the DEFAULT_OPTIONS
24
24
  ENDPOINT_PROD = 'https://risk.kount.net'
@@ -0,0 +1,14 @@
1
+ module Kount
2
+ # This class contains version specifications
3
+ class Config
4
+
5
+ # Which SDK is this
6
+ SDK = 'RUBY'
7
+
8
+ # SDK release version
9
+ # Set the sdk release version which will be used for git tagging in github
10
+ # This will be set by the build process
11
+ SDK_VERSION = '2.2.0'
12
+
13
+ end
14
+ end
@@ -1,3 +1,5 @@
1
+ require_relative '../config'
2
+
1
3
  module Kount
2
4
  ##
3
5
  # This class extends the Request class.
@@ -16,6 +18,8 @@ module Kount
16
18
  # We want Request to default to MODE Q unless a different mode has
17
19
  # been passed.
18
20
  add_params(MODE: 'Q') unless initial_params.key?(:MODE)
21
+ sdkVersionStructure = "Sdk-Ris-Ruby-"
22
+ add_params(SDK: Kount::Config::SDK, SDK_VERSION: sdkVersionStructure + Kount::Config::SDK_VERSION)
19
23
  end
20
24
 
21
25
  # @param version [String] RIS version
@@ -24,13 +28,11 @@ module Kount
24
28
  # @param ksalt [String] Kount supplied secret salt for KHASH
25
29
  def prepare_params(version, merchant_id, response_format, ksalt)
26
30
  super(version, merchant_id, response_format, ksalt)
27
- begin
28
- params.merge! collect_cart_items
29
- # The Kount::Request has no knowledge of the KSALT or merchant_id, both
30
- # of which are needed for KHASH. Request form params have everything we
31
- # need at this point to do the KHASH if needed.
32
- fixup_payment_params(ksalt, merchant_id)
33
- end
31
+ params.merge! collect_cart_items
32
+ # The Kount::Request has no knowledge of the KSALT or merchant_id, both
33
+ # of which are needed for KHASH. Request form params have everything we
34
+ # need at this point to do the KHASH if needed.
35
+ fixup_payment_params(ksalt, merchant_id)
34
36
  params
35
37
  end
36
38
 
data/lib/kount/request.rb CHANGED
@@ -12,8 +12,6 @@ module Kount
12
12
  #
13
13
  # @param initial_params [Hash] Initial params for request
14
14
  def initialize(initial_params = {})
15
- raise "Cannot directly instantiate a #{self.class}." if
16
- self.class == Request
17
15
  @params = initial_params
18
16
  end
19
17
 
@@ -37,5 +35,12 @@ module Kount
37
35
  # subclass prepare_params methods.
38
36
  params.merge!(VERS: version, MERC: merchant_id, FRMT: response_format)
39
37
  end
38
+
39
+ # Add LBIN to request
40
+ # Supports BIN lengths of 6 digits or greater
41
+ # @param lbin [String] Long Bank Identification Number
42
+ def add_lbin(lbin)
43
+ params.merge!(LBIN: lbin)
44
+ end
40
45
  end
41
46
  end
@@ -4,9 +4,12 @@ module Kount
4
4
  # @param ptyp [String] Payment type code: CARD, GIFT, or OTHER
5
5
  # @return [String] KHASH version of string
6
6
  def self.hash_token(plain_text, ptyp, ksalt, merchant_id = '')
7
- if ptyp == 'CARD'
7
+ # changed if-else to case-when to follow ruby coding standard
8
+
9
+ case ptyp
10
+ when 'CARD'
8
11
  HashPaymentToken(plain_text, ksalt)
9
- elsif ptyp == 'CHEK'
12
+ when 'CHEK'
10
13
  HashCheckPayment(plain_text, ksalt)
11
14
  else
12
15
  HashGiftCard(plain_text, ksalt, merchant_id)
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: 2.0.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kount
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -54,6 +54,7 @@ files:
54
54
  - lib/kount/Response.rb
55
55
  - lib/kount/cart.rb
56
56
  - lib/kount/client.rb
57
+ - lib/kount/config.rb
57
58
  - lib/kount/payment_types.rb
58
59
  - lib/kount/request.rb
59
60
  - lib/kount/request/inquiry.rb
@@ -79,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
80
  - !ruby/object:Gem::Version
80
81
  version: 1.3.5
81
82
  requirements: []
82
- rubygems_version: 3.0.3
83
+ rubygems_version: 3.2.32
83
84
  signing_key:
84
85
  specification_version: 4
85
86
  summary: Kount Complete Services Wrapper