Skip to content

Commit 68a2d1e

Browse files
author
Sanjeev Kumar
committed
Merge branch 'UpdateReleaseVersion' into 'master'
Update release version See merge request kount/third_party/ris-clients!6
2 parents dacd806 + c9a3244 commit 68a2d1e

File tree

7 files changed

+20
-22
lines changed

7 files changed

+20
-22
lines changed

kount_complete.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'kount_complete'
3-
s.version = '2.0.3'
3+
s.version = '2.0.4'
44
s.summary = "Kount Complete Services Wrapper"
55
s.description = "A wrapper to facilitate making Kount RIS calls"
66
s.email = 'ruby@kount.com'

lib/kount.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module Kount
2020
# }
2121
# @param options Hash
2222
def new(options = {})
23-
raise ArgumentError, 'Config options required' if options.empty?
2423
Client.new(options)
2524
end
2625

lib/kount/Response.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ def get_browser
284284
end
285285

286286
def get_numberrules_triggered
287-
no_rules_triggered = @paramlist['RULES_TRIGGERED'].to_s
288-
no_rules_triggered
287+
# changed due to rubocop styling rules for ruby
288+
@paramlist['RULES_TRIGGERED'].to_s
289289
end
290290

291291
def get_rules_triggered
@@ -299,8 +299,8 @@ def get_rules_triggered
299299
end
300300

301301
def get_warning_count
302-
warning_count = @paramlist['WARNING_COUNT'].to_s
303-
warning_count
302+
# changed due to rubocop styling rules for ruby
303+
@paramlist['WARNING_COUNT'].to_s
304304
end
305305

306306
def get_warnings
@@ -313,8 +313,8 @@ def get_warnings
313313
end
314314

315315
def get_error_count
316-
errorcount = @paramlist['ERROR_COUNT'].to_s
317-
errorcount
316+
# changed due to rubocop styling rules for ruby
317+
@paramlist['ERROR_COUNT'].to_s
318318
end
319319

320320
def geterrors
@@ -327,8 +327,8 @@ def geterrors
327327
end
328328

329329
def get_numbercounters_triggered
330-
count_triggered = @paramlist['COUNTERS_TRIGGERED'].to_s
331-
count_triggered
330+
# changed due to rubocop styling rules for ruby
331+
@paramlist['COUNTERS_TRIGGERED'].to_s
332332
end
333333

334334
def get_counters_triggered

lib/kount/request.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class Request
1212
#
1313
# @param initial_params [Hash] Initial params for request
1414
def initialize(initial_params = {})
15-
raise "Cannot directly instantiate a #{self.class}." if
16-
self.class == Request
1715
@params = initial_params
1816
end
1917

lib/kount/request/inquiry.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ def initialize(initial_params = {})
2424
# @param ksalt [String] Kount supplied secret salt for KHASH
2525
def prepare_params(version, merchant_id, response_format, ksalt)
2626
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
27+
params.merge! collect_cart_items
28+
# The Kount::Request has no knowledge of the KSALT or merchant_id, both
29+
# of which are needed for KHASH. Request form params have everything we
30+
# need at this point to do the KHASH if needed.
31+
fixup_payment_params(ksalt, merchant_id)
3432
params
3533
end
3634

lib/kount/utils/khash.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ class Khash
44
# @param ptyp [String] Payment type code: CARD, GIFT, or OTHER
55
# @return [String] KHASH version of string
66
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'
811
HashPaymentToken(plain_text, ksalt)
9-
elsif ptyp == 'CHEK'
12+
when 'CHEK'
1013
HashCheckPayment(plain_text, ksalt)
1114
else
1215
HashGiftCard(plain_text, ksalt, merchant_id)

spec/khash_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
describe "Test the HashCheckPayment Method" do
2424
it 'Test the HashCheckPayment Method for CHECK type' do
25-
expect(Kount::Khash.hash_check_payment('01234567811111111111111', '')).to eq('012345440GD428TF29K0')
25+
expect(Kount::Khash.hash_check_payment('0123456781111111', '')).to eq('012345IIY6S6GU6UZ9K5')
2626
end
2727
end
2828
end

0 commit comments

Comments
 (0)