issuer_response_codes 0.2.3 → 0.2.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: 48a86fdf7a496cf0d8c922c64ede30d1e01721e6838eb4b010624bf0d0730327
4
- data.tar.gz: 96460d711e7886f3e70a4cd9aae0c6abf208c8f3cc50487e3ac536fa0dd640d2
3
+ metadata.gz: dac9d604f2e19423d50223600a7919c737ad77eaa6d20a81478f36dadc907cbb
4
+ data.tar.gz: 92cf2b531073ec57418906a5996b3b6fcdfeb2771c3646e7879178e73f836bcd
5
5
  SHA512:
6
- metadata.gz: 1b07bb422b09284e992ffa9342e8057ccb1cf46ea7ac84e29b593023a538f80722a7a55ae9dd2c780eb2c4a1b024e0f60d4ab968d38b4f181e0dec110319a9c8
7
- data.tar.gz: 4de04dd09115486f6a29b943d346dff426549277acf4f776a053311033d157e772cdd665cad2fe816335d3bedf350d6b135bda10d012f8efbc2ab94e03d188d3
6
+ metadata.gz: ac1b7680c8c076ac0f06108cc96e685c058fb506240e189f9ea14f7e4ec132d51fd279571bf39a441709adfad8f8bfcc3f798d397d16b82e5ce10f6c7a113937
7
+ data.tar.gz: 3c106d735298510ae3a73742b8ff40eb264a5cff307eb7cc6cc71a8031d6b3f21d7fdea9cda437e2e178746a48f7b0e597422d7c2248494d743ff2aa94a82891
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- issuer_response_codes (0.2.3)
4
+ issuer_response_codes (0.2.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -23,6 +23,7 @@ module IssuerResponseCodes
23
23
  end
24
24
 
25
25
  def issuer_response_codes(locale: :en)
26
+ fraudulent_codes = locale_hash.dig(locale, :issuer_response_codes, :fraudulent_codes)
26
27
  behaviours = locale_hash.dig(locale, :issuer_response_codes, :behaviour)
27
28
  cardholder_reasons = locale_hash.dig(locale, :issuer_response_codes, :targeted, :cardholder)
28
29
  merchant_reasons = locale_hash.dig(locale, :issuer_response_codes, :targeted, :merchant)
@@ -33,13 +34,15 @@ module IssuerResponseCodes
33
34
  {
34
35
  merchant_reason: merchant_reason,
35
36
  cardholder_reason: cardholder_reasons[code],
36
- behaviour: behaviours[code]
37
+ behaviour: behaviours[code],
38
+ fraudulent: fraudulent_codes[code] == true
37
39
  }
38
40
  ]
39
41
  end.to_h
40
42
  end
41
43
 
42
44
  def tds_codes(locale: :en)
45
+ fraudulent_codes = locale_hash.dig(locale, :tds_status_codes, :fraudulent_codes)
43
46
  behaviours = locale_hash.dig(locale, :tds_status_codes, :behaviour)
44
47
  cardholder_reasons = locale_hash.dig(locale, :tds_status_codes, :targeted, :cardholder)
45
48
  merchant_reasons = locale_hash.dig(locale, :tds_status_codes, :targeted, :merchant)
@@ -50,7 +53,8 @@ module IssuerResponseCodes
50
53
  {
51
54
  merchant_reason: merchant_reason,
52
55
  cardholder_reason: cardholder_reasons[code],
53
- behaviour: behaviours[code]
56
+ behaviour: behaviours[code],
57
+ fraudulent: fraudulent_codes[code] == true
54
58
  }
55
59
  ]
56
60
  end.to_h
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IssuerResponseCodes
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: issuer_response_codes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Espago