kount_complete 2.0.3 → 2.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89d6e66be40078e26b18861dbd0bb99ff427acfa1ff0717d1f9092efadc0250a
4
- data.tar.gz: '086b6abb447bb81459b6ad933213e81e6a9e690e9a945d4c4cd6aed8774973ca'
3
+ metadata.gz: 10600c289b443555890abb28f2ff53e58ce14034fb095f3b23e675152f00ab61
4
+ data.tar.gz: 265c55111a4e6224d23173eaf569a30dcf2ad7c878c88f1d9d38e02c0d4dcebb
5
5
  SHA512:
6
- metadata.gz: 211dc77e3326c05bcd7fb27cfa173c3eba9f733dd3943004110b7e85b8a206ed06180b045fb3652597eba54145a58690b0bc92f4469d83a38bda9d447e0fa79b
7
- data.tar.gz: 0f34dec4c5891478ed8c0cc57d60809476d90a74438c59469fd90232bb973e839ec6e4cbcdfda1b6b07be946792f8548552ed11eb6b3b45f57d540a1d6ddc8fe
6
+ metadata.gz: db97cb94c2b116e60bc6de56c2901ca6d073b7aa653a1b0b6358c2cbbed8fe6c66554f602ad69c4328d06015bb7838d792c65370f7161c0a752ff660b82484c3
7
+ data.tar.gz: 3f6f26bd5e8a5c22a7a37ac75df9e99f54622fb7c1746b756530a4de89799074375198c1e9b69efa59546e1b7b9b72f8e3af9002d00d5855f01c60a518c537ec
data/lib/kount.rb CHANGED
@@ -20,7 +20,6 @@ module Kount
20
20
  # }
21
21
  # @param options Hash
22
22
  def new(options = {})
23
- raise ArgumentError, 'Config options required' if options.empty?
24
23
  Client.new(options)
25
24
  end
26
25
 
@@ -284,8 +284,8 @@ module Response
284
284
  end
285
285
 
286
286
  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
289
289
  end
290
290
 
291
291
  def get_rules_triggered
@@ -299,8 +299,8 @@ module Response
299
299
  end
300
300
 
301
301
  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
304
304
  end
305
305
 
306
306
  def get_warnings
@@ -313,8 +313,8 @@ module Response
313
313
  end
314
314
 
315
315
  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
318
318
  end
319
319
 
320
320
  def geterrors
@@ -327,8 +327,8 @@ module Response
327
327
  end
328
328
 
329
329
  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
332
332
  end
333
333
 
334
334
  def get_counters_triggered
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
 
@@ -24,13 +24,11 @@ module Kount
24
24
  # @param ksalt [String] Kount supplied secret salt for KHASH
25
25
  def prepare_params(version, merchant_id, response_format, ksalt)
26
26
  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)
34
32
  params
35
33
  end
36
34
 
@@ -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.0.4
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: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client