issuer_response_codes 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/Gemfile.lock +1 -1
- data/lib/issuer_response_codes/locale_library.rb +34 -0
- data/lib/issuer_response_codes/version.rb +1 -1
- 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: 48a86fdf7a496cf0d8c922c64ede30d1e01721e6838eb4b010624bf0d0730327
|
4
|
+
data.tar.gz: 96460d711e7886f3e70a4cd9aae0c6abf208c8f3cc50487e3ac536fa0dd640d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b07bb422b09284e992ffa9342e8057ccb1cf46ea7ac84e29b593023a538f80722a7a55ae9dd2c780eb2c4a1b024e0f60d4ab968d38b4f181e0dec110319a9c8
|
7
|
+
data.tar.gz: 4de04dd09115486f6a29b943d346dff426549277acf4f776a053311033d157e772cdd665cad2fe816335d3bedf350d6b135bda10d012f8efbc2ab94e03d188d3
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
issuer_response_codes
|
data/Gemfile.lock
CHANGED
@@ -22,6 +22,40 @@ module IssuerResponseCodes
|
|
22
22
|
result.gsub(/%{substitute}/, substitute)
|
23
23
|
end
|
24
24
|
|
25
|
+
def issuer_response_codes(locale: :en)
|
26
|
+
behaviours = locale_hash.dig(locale, :issuer_response_codes, :behaviour)
|
27
|
+
cardholder_reasons = locale_hash.dig(locale, :issuer_response_codes, :targeted, :cardholder)
|
28
|
+
merchant_reasons = locale_hash.dig(locale, :issuer_response_codes, :targeted, :merchant)
|
29
|
+
|
30
|
+
merchant_reasons.map do |code, merchant_reason|
|
31
|
+
[
|
32
|
+
code,
|
33
|
+
{
|
34
|
+
merchant_reason: merchant_reason,
|
35
|
+
cardholder_reason: cardholder_reasons[code],
|
36
|
+
behaviour: behaviours[code]
|
37
|
+
}
|
38
|
+
]
|
39
|
+
end.to_h
|
40
|
+
end
|
41
|
+
|
42
|
+
def tds_codes(locale: :en)
|
43
|
+
behaviours = locale_hash.dig(locale, :tds_status_codes, :behaviour)
|
44
|
+
cardholder_reasons = locale_hash.dig(locale, :tds_status_codes, :targeted, :cardholder)
|
45
|
+
merchant_reasons = locale_hash.dig(locale, :tds_status_codes, :targeted, :merchant)
|
46
|
+
|
47
|
+
merchant_reasons.map do |code, merchant_reason|
|
48
|
+
[
|
49
|
+
code,
|
50
|
+
{
|
51
|
+
merchant_reason: merchant_reason,
|
52
|
+
cardholder_reason: cardholder_reasons[code],
|
53
|
+
behaviour: behaviours[code]
|
54
|
+
}
|
55
|
+
]
|
56
|
+
end.to_h
|
57
|
+
end
|
58
|
+
|
25
59
|
def self.symbolize_keys(hash)
|
26
60
|
h = hash.map do |k, v|
|
27
61
|
v_sym = if v.instance_of? Hash
|
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.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Espago
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-09-
|
12
|
+
date: 2021-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -119,6 +119,7 @@ extra_rdoc_files: []
|
|
119
119
|
files:
|
120
120
|
- ".gitignore"
|
121
121
|
- ".rubocop.yml"
|
122
|
+
- ".ruby-gemset"
|
122
123
|
- ".ruby-version"
|
123
124
|
- ".travis.yml"
|
124
125
|
- ".vscode/extensions.json"
|