sepa_reason_codes 1.0.1 → 1.0.2
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 +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +22 -8
- data/lib/reason_codes.yml +23 -23
- data/lib/sepa_reason_codes.rb +31 -31
- data/lib/sepa_reason_codes/code.rb +22 -0
- data/lib/sepa_reason_codes/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f830e8f627a2444dd64acc97883e918b8245edabc1ca67c13a3624b0aa34b107
|
4
|
+
data.tar.gz: 9f02bcfc64d59b5874a4afba98c93150460632dbb940a044d623c28eff0789c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12908a83f48931c05d8393f0c7db8bfe5fe4979aa83a24d47ccb6a99c066c6213c43fe75b9b713f7f96a931b4d73e23f09356d5769baa8ea8cdeae59c7067f38
|
7
|
+
data.tar.gz: 52a240de0c400b16070fb962083817c948aea6c62f890ba4c899bfb218f06ee54438a642bd415b8f9610e3cb8eef254a9f5aa3964aa1100c05714d7b3a1011df
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,18 @@
|
|
1
|
+
[](https://badge.fury.io/rb/sepa_reason_codes)
|
2
|
+
[](https://circleci.com/gh/ramblingcode/sepa-reason-codes)
|
3
|
+
|
1
4
|
# SepaReasonCodes
|
2
5
|
|
3
|
-
Welcome to SepaReasonCodes!
|
6
|
+
Welcome to SepaReasonCodes!
|
4
7
|
|
5
|
-
|
8
|
+
It is a minimal Ruby gem to work with SEPA Reason Codes.
|
6
9
|
|
7
|
-
|
8
|
-
|
10
|
+
Reason Codes are used in exception handling in SEPA Direct Debit (SDD). These codes
|
11
|
+
indicate reasons for why a transaction failure has happened. You may use these codes if you are parsing bank statements or handling SEPA transactions through an API of some kind of 3rd Party Payment Gateway.
|
9
12
|
|
10
|
-
We have created
|
13
|
+
We have created SepaReasonCodes so you may easily access and work with them.
|
11
14
|
|
12
|
-
If you want to know more about
|
15
|
+
If you want to know more about Reason Codes, read [here](https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2018-09/EPC173-14%20v4.1%20Guidance%20on%20Reason%20Codes%20for%20SDD%20R-transactions.pdf)
|
13
16
|
|
14
17
|
## Installation
|
15
18
|
|
@@ -29,7 +32,7 @@ Or install it yourself as:
|
|
29
32
|
|
30
33
|
## Usage
|
31
34
|
|
32
|
-
No magic here! Just pass in the reason code and get back the
|
35
|
+
No magic here! Just pass in the reason code and get back the SepaReasonCodes::Code instance with all required information.
|
33
36
|
|
34
37
|
```ruby
|
35
38
|
reason_code = SepaReasonCodes.find("AC01")
|
@@ -48,7 +51,18 @@ You can also retrieve all Reason Codes by doing:
|
|
48
51
|
SepaReasonCodes.all
|
49
52
|
```
|
50
53
|
|
51
|
-
which will return a collection of `
|
54
|
+
which will return a collection of `SepaReasonCodes::Code`.
|
55
|
+
|
56
|
+
Equality check has been overwritten and will be checked based on
|
57
|
+
attribute values.
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
reason_code = SepaReasonCodes::Code.find('AC01')
|
61
|
+
other_same_reason_code_instance = SepaReasonCodes::Code.find('AC01')
|
62
|
+
|
63
|
+
reason_code == other_same_reason_code_instance
|
64
|
+
> true
|
65
|
+
```
|
52
66
|
|
53
67
|
## Development
|
54
68
|
|
data/lib/reason_codes.yml
CHANGED
@@ -223,7 +223,7 @@ AM21:
|
|
223
223
|
probable_status: declined
|
224
224
|
ARDT:
|
225
225
|
code: ARDT
|
226
|
-
iso_name:
|
226
|
+
iso_name: Already returned transaction
|
227
227
|
description: Transaction has already been returned
|
228
228
|
probable_status: declined
|
229
229
|
BE01:
|
@@ -694,7 +694,7 @@ FF10:
|
|
694
694
|
probable_status: error
|
695
695
|
FRAD:
|
696
696
|
code: FRAD
|
697
|
-
iso_name:
|
697
|
+
iso_name: Fraudulent Payment
|
698
698
|
description: Payment is made with fraudulent intent.
|
699
699
|
probable_status: declined
|
700
700
|
ID01:
|
@@ -817,7 +817,7 @@ NOOR:
|
|
817
817
|
probable_status: declined
|
818
818
|
PART:
|
819
819
|
code: PART
|
820
|
-
iso_name:
|
820
|
+
iso_name: Parial Rejection
|
821
821
|
description: Partial rejection of a bulk
|
822
822
|
probable_status: declined
|
823
823
|
PINL:
|
@@ -828,7 +828,7 @@ PINL:
|
|
828
828
|
probable_status: declined
|
829
829
|
PY01:
|
830
830
|
code: PY01
|
831
|
-
iso_name:
|
831
|
+
iso_name: Beneficiary or instructing bank not registered
|
832
832
|
description: The transaction cannot be processed because the beneficiary and/or the instructing bank
|
833
833
|
is not registered with the EBA as a direct or indirect participant. (Initiator SEPA Clearer).
|
834
834
|
probable_status: declined
|
@@ -903,7 +903,7 @@ RF01:
|
|
903
903
|
probable_status: declined
|
904
904
|
RJCT:
|
905
905
|
code: RJCT
|
906
|
-
iso_name:
|
906
|
+
iso_name: Complete Rejection of a bulk
|
907
907
|
description: Complete rejection of a bulk
|
908
908
|
probable_status: declined
|
909
909
|
RR01:
|
@@ -1011,7 +1011,7 @@ TD03:
|
|
1011
1011
|
probable_status: declined
|
1012
1012
|
TECH:
|
1013
1013
|
code: TECH
|
1014
|
-
iso_name:
|
1014
|
+
iso_name: Erroneous credit transfer
|
1015
1015
|
description: Technical problems resulting in erroneous credit transfer
|
1016
1016
|
probable_status: declined
|
1017
1017
|
TM01:
|
@@ -1036,7 +1036,7 @@ UPAY:
|
|
1036
1036
|
probable_status: chargeback
|
1037
1037
|
XD19:
|
1038
1038
|
code: XD19
|
1039
|
-
iso_name:
|
1039
|
+
iso_name: Iban check failed
|
1040
1040
|
description: IBAN check according to ISO 13616 failed (e.g. (DebtorAccount or CreditorAccount are not correct.)
|
1041
1041
|
probable_status: declined
|
1042
1042
|
XD75:
|
@@ -1046,87 +1046,87 @@ XD75:
|
|
1046
1046
|
probable_status: error
|
1047
1047
|
XT13:
|
1048
1048
|
code: XT13
|
1049
|
-
iso_name:
|
1049
|
+
iso_name: Unsupported or missing field
|
1050
1050
|
description: Transaction contains at least one unsupported field.
|
1051
1051
|
At least one mandatory field is not included in the transaction.
|
1052
1052
|
probable_status: declined
|
1053
1053
|
XT27:
|
1054
1054
|
code: XT27
|
1055
|
-
iso_name:
|
1055
|
+
iso_name: BIC is not available in SCL directory
|
1056
1056
|
description: Transaction contains at least one element with a BIC that is not
|
1057
1057
|
is available in the SCL directory.
|
1058
1058
|
probable_status: declined
|
1059
1059
|
XT33:
|
1060
1060
|
code: XT33
|
1061
|
-
iso_name:
|
1061
|
+
iso_name: Faulty format
|
1062
1062
|
description: Content of at least one XML element does not have the required format.
|
1063
1063
|
The faulty XML field is marked with the error code (Initiator SEPA Clearer).
|
1064
1064
|
probable_status: declined
|
1065
1065
|
XT43:
|
1066
1066
|
code: XT43
|
1067
|
-
iso_name:
|
1067
|
+
iso_name: Type of direct debit differs from the assignment of <Srvcld>
|
1068
1068
|
description: Type of direct debit (CORE7B2B) differs from the assignment of the <Srvcld>
|
1069
1069
|
in the file header (Initiator SEPA Clearer).
|
1070
1070
|
probable_status: declined
|
1071
1071
|
XT53:
|
1072
1072
|
code: XT53
|
1073
|
-
iso_name:
|
1073
|
+
iso_name: Faulty Creditor Identifier
|
1074
1074
|
description: Check of the Creditor Indentifier <CdtrSchmeld><Id> with regard to structure/check digit
|
1075
1075
|
failed (initiator SEPA Clearer).
|
1076
1076
|
probable_status: declined
|
1077
1077
|
XT73:
|
1078
1078
|
code: XT73
|
1079
|
-
iso_name:
|
1079
|
+
iso_name: Invalid country code
|
1080
1080
|
description: Both characters for the country code are not valid ISO or SEPA
|
1081
1081
|
Country code (Initiator SEPA Clearer)
|
1082
1082
|
probable_status: declined
|
1083
1083
|
XT74:
|
1084
1084
|
code: XT74
|
1085
|
-
iso_name:
|
1085
|
+
iso_name: Faulty original transaction
|
1086
1086
|
description: Faulty underlying original transaction (initiator other
|
1087
1087
|
CSM). Further examination required
|
1088
1088
|
probable_status: declined
|
1089
1089
|
XT75:
|
1090
1090
|
code: XT75
|
1091
|
-
iso_name:
|
1091
|
+
iso_name: Incorrect status of original transaction
|
1092
1092
|
description: Incorrect status of the underlying original transaction from
|
1093
1093
|
the R message (initiator other CSM). No further actions necessary.
|
1094
1094
|
probable_status: declined
|
1095
1095
|
XT76:
|
1096
1096
|
code: XT76
|
1097
|
-
iso_name:
|
1097
|
+
iso_name: Invalid error code in Return/Refund
|
1098
1098
|
description: Invalid error code in Return/Refund (Initiator SEPA Clearer)
|
1099
1099
|
probable_status: declined
|
1100
1100
|
XT77:
|
1101
1101
|
code: XT77
|
1102
|
-
iso_name:
|
1102
|
+
iso_name: <OrgnIIntrBkSttlmAmt> amount paid by other CSM not found or mismatched
|
1103
1103
|
description: The originally commissioned amount <OrgnIIntrBkSttlmAmt> was paid by
|
1104
1104
|
other CSM not found or does not match the amount of the original transaction about
|
1105
1105
|
probable_status: declined
|
1106
1106
|
XT78:
|
1107
1107
|
code: XT78
|
1108
|
-
iso_name:
|
1108
|
+
iso_name: Faulty or mismatching amount in either <OrgnlIntrBkSttlmAmt>, <CompstnAmt>, <ChrgsInf><Amt>
|
1109
1109
|
description: 'pasc.004.001.01: The amount in <OrgnlIntrBkSttlmAmt> + <CompstnAmt>
|
1110
1110
|
+ <ChrgsInf><Amt> must result in the amount in <RtrdIntrBkSttlmAmt> if <CompstnAmt>
|
1111
1111
|
and/or <ChrgsInf><Amt> available (initiator SEPA Clearer).'
|
1112
1112
|
probable_status: declined
|
1113
1113
|
XT79:
|
1114
1114
|
code: XT79
|
1115
|
-
iso_name:
|
1115
|
+
iso_name: Debtor is not allowed to receive direct debit
|
1116
1116
|
description: The <DbtrAgt> is not allowed to receive direct debits. An
|
1117
1117
|
indirect participants must be allowed to accept direct debits from the clearing system
|
1118
1118
|
(initiator other CSM).
|
1119
1119
|
probable_status: declined
|
1120
1120
|
XT80:
|
1121
1121
|
code: XT80
|
1122
|
-
iso_name:
|
1122
|
+
iso_name: Creditor is not allowed to send direct debits
|
1123
1123
|
description: The <CdtrAgt> is not allowed to send direct debits. An indirect
|
1124
1124
|
Participant must be allowed to send direct debits to the clearing system
|
1125
1125
|
(initiator other CSM).
|
1126
1126
|
probable_status: declined
|
1127
1127
|
XT81:
|
1128
1128
|
code: XT81
|
1129
|
-
iso_name:
|
1129
|
+
iso_name: SCT field is not permitted
|
1130
1130
|
description: SCT XML field not permitted in CT service
|
1131
1131
|
probable_status: declined
|
1132
1132
|
XT85:
|
@@ -1136,7 +1136,7 @@ XT85:
|
|
1136
1136
|
probable_status: declined
|
1137
1137
|
XT87:
|
1138
1138
|
code: XT87
|
1139
|
-
iso_name:
|
1139
|
+
iso_name: Invalid SDD R-Msg
|
1140
1140
|
description: SDD R-Msg not following same DP route/ sending DP not identical to
|
1141
1141
|
Instructing / Instructed Agent of the original Transaction
|
1142
1142
|
probable_status: declined
|
@@ -1147,7 +1147,7 @@ XT90:
|
|
1147
1147
|
probable_status: declined
|
1148
1148
|
XT99:
|
1149
1149
|
code: XT99
|
1150
|
-
iso_name:
|
1150
|
+
iso_name: Rejection by SEPA clearer
|
1151
1151
|
description: Rejection of the bank transfer or direct debit or card collection from
|
1152
1152
|
SEPA Clearer for other reasons.
|
1153
1153
|
probable_status: declined
|
data/lib/sepa_reason_codes.rb
CHANGED
@@ -1,61 +1,61 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'sepa_reason_codes/version'
|
4
|
-
require '
|
4
|
+
require 'sepa_reason_codes/code'
|
5
5
|
|
6
|
-
|
7
|
-
#
|
8
|
-
# SepaReasonCodes.find('AC01')
|
9
|
-
#
|
10
|
-
# @returns ReasonCodeStruct{
|
11
|
-
# code: 'AC01',
|
12
|
-
# iso_name: '',
|
13
|
-
# description: '',
|
14
|
-
# probable_status: ''
|
15
|
-
# }
|
6
|
+
require 'yaml'
|
16
7
|
|
17
8
|
module SepaReasonCodes
|
18
9
|
class Error < StandardError; end
|
19
10
|
|
20
|
-
|
11
|
+
PARSED_REASON_CODES =
|
21
12
|
YAML.load_file(File.join(__dir__, ['reason_codes.yml'])).freeze
|
22
13
|
|
23
|
-
ReasonCodeStruct =
|
24
|
-
Struct.new(:code, :iso_name, :description, :probable_status)
|
25
|
-
|
26
14
|
# @param ~String~ Sepa Reason Code; Case insensitive
|
27
15
|
# Read more at : https://www.hettwer-beratung.de/sepa-spezialwissen/sepa-reason-codes/
|
28
16
|
|
29
17
|
# Parses lib/reason_codes.yml, retrieves and
|
30
|
-
# returns
|
18
|
+
# returns SepaReasonCodes::Code with accessors
|
31
19
|
# code, iso_name, description, probable_status
|
32
20
|
|
21
|
+
# Usage:
|
22
|
+
#
|
23
|
+
# SepaReasonCodes.find('AC01')
|
24
|
+
#
|
25
|
+
# @returns SepaReasonCodes::Code{
|
26
|
+
# code: 'AC01',
|
27
|
+
# iso_name: '...',
|
28
|
+
# description: '...',
|
29
|
+
# probable_status: '...'
|
30
|
+
# }
|
31
|
+
|
33
32
|
def self.find(code)
|
34
|
-
|
35
|
-
ParsedReasonCodes.fetch(code&.upcase, nil)
|
33
|
+
reason_code_data = PARSED_REASON_CODES.fetch(code&.upcase, nil)
|
36
34
|
|
37
|
-
return unless
|
35
|
+
return unless reason_code_data
|
38
36
|
|
39
|
-
|
37
|
+
reason_code(reason_code_data)
|
40
38
|
end
|
41
39
|
|
42
|
-
# @returns collection [
|
40
|
+
# @returns collection [SepaReasonCodes::Code]
|
43
41
|
|
44
42
|
def self.all
|
45
|
-
|
46
|
-
|
43
|
+
PARSED_REASON_CODES.values.map do |reason_code_data|
|
44
|
+
reason_code(reason_code_data)
|
47
45
|
end
|
48
46
|
end
|
49
47
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
48
|
+
# @api private
|
49
|
+
|
50
|
+
def self.reason_code(reason_code_data)
|
51
|
+
Code.new(
|
52
|
+
code: reason_code_data.fetch('code'),
|
53
|
+
iso_name: reason_code_data.fetch('iso_name'),
|
54
|
+
description: reason_code_data.fetch('description'),
|
55
|
+
probable_status: reason_code_data.fetch('probable_status')
|
56
56
|
)
|
57
57
|
end
|
58
58
|
|
59
|
-
private_constant :
|
60
|
-
private_class_method :
|
59
|
+
private_constant :PARSED_REASON_CODES
|
60
|
+
private_class_method :reason_code
|
61
61
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SepaReasonCodes
|
4
|
+
class Code
|
5
|
+
ATTRS = %i[code iso_name description probable_status].freeze
|
6
|
+
|
7
|
+
attr_reader(*ATTRS)
|
8
|
+
|
9
|
+
def initialize(code:, iso_name:, description:, probable_status:)
|
10
|
+
@code = code
|
11
|
+
@iso_name = iso_name
|
12
|
+
@description = description
|
13
|
+
@probable_status = probable_status
|
14
|
+
end
|
15
|
+
|
16
|
+
def ==(other)
|
17
|
+
ATTRS.all? do |attribute|
|
18
|
+
other.public_send(attribute) == public_send(attribute)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepa_reason_codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sahil Gadimbayli
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email:
|
57
57
|
- hi@ramblingcode.dev
|
58
58
|
executables: []
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- bin/setup
|
74
74
|
- lib/reason_codes.yml
|
75
75
|
- lib/sepa_reason_codes.rb
|
76
|
+
- lib/sepa_reason_codes/code.rb
|
76
77
|
- lib/sepa_reason_codes/version.rb
|
77
78
|
- sepa_reason_codes.gemspec
|
78
79
|
homepage: https://github.com/ramblingcode/sepa-reason-codes
|
@@ -81,7 +82,7 @@ licenses:
|
|
81
82
|
metadata:
|
82
83
|
homepage_uri: https://github.com/ramblingcode/sepa-reason-codes
|
83
84
|
source_code_uri: https://github.com/ramblingcode/sepa-reason-codes
|
84
|
-
post_install_message:
|
85
|
+
post_install_message:
|
85
86
|
rdoc_options: []
|
86
87
|
require_paths:
|
87
88
|
- lib
|
@@ -96,8 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
97
|
- !ruby/object:Gem::Version
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
100
|
-
signing_key:
|
100
|
+
rubygems_version: 3.1.4
|
101
|
+
signing_key:
|
101
102
|
specification_version: 4
|
102
103
|
summary: Minimal, plain old ruby gem to work with Sepa Reason Codes.
|
103
104
|
test_files: []
|