sepa_file_parser 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5233f32c897d7e33ce7a00b1213f4933fed2c6d9d3c47d2c4367268e21f5dccd
4
- data.tar.gz: 5562ca231c07df7848143dfa5f0d7b1dde9fc81ebf866ad18eb55b346596bf04
3
+ metadata.gz: '09d296b3da481acbadb314e290ad2357ad2f5321a612d1b16e1933ced9975b39'
4
+ data.tar.gz: 51836479ced6c9725276b960aac75a543d7f3265eb27fce098080ea7826a6a42
5
5
  SHA512:
6
- metadata.gz: b151cf8b849f21e33e01d4c2b85268c150cf010ab0c62a5743dd9ef004ebac010b5f46f237d6b9c3ad5764aa26ca6eeda27a1bb6fe45349fa810259e560baa2f
7
- data.tar.gz: b7557e088a656bc18f892f008e7aba228efbdc60a0da2b998735c9db0d7935b9babecbf25679618d60683f64cf1a318807c0c3045c3abf1804eb908fabc423ab
6
+ metadata.gz: 349297e0b3aaa816710b5cb8959f8dfc89fb7d6e12e6d07143fcf5a31468f4c0b680e60ab95e804f38ba94bd73aed8b4e53d2fb81ea98f122c21d4807a658cd4
7
+ data.tar.gz: db7a57ad4da5f700d75e01edf512bdfd4090a095a43b60ce0326edcbfd13754e03365d8c5622abda6944d2746fdd0c0f1c1e7bd1bc3978b850452236c900a9ff
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SepaFileParser
4
+ module Pain002
5
+ class Base
6
+ attr_reader :group_header, :reports, :xml_data
7
+
8
+ def initialize(xml_data)
9
+ @xml_data = xml_data
10
+ # CstmrPmtStsRpt = Customer Payment Status Report
11
+ grphdr = xml_data.xpath('CstmrPmtStsRpt/GrpHdr')
12
+ @group_header = SepaFileParser::GroupHeader.new(grphdr)
13
+ reports = xml_data.xpath('CstmrPmtStsRpt/OrgnlPmtInfAndSts')
14
+ @reports = reports.map { |x| Report.new(x) }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SepaFileParser
4
+ module Pain002
5
+ class Report
6
+
7
+ attr_reader :xml_data
8
+
9
+ def initialize(xml_data)
10
+ @xml_data = xml_data
11
+ end
12
+
13
+ def original_identification
14
+ @original_identification ||= xml_data.xpath('OrgnlPmtInfId/text()').text
15
+ end
16
+
17
+ def status_id
18
+ @status_id ||= xml_data.xpath('TxInfAndSts/StsId/text()').text
19
+ end
20
+
21
+ def transaction_status
22
+ @transaction_status ||= xml_data.xpath('TxInfAndSts/TxSts/text()').text
23
+ end
24
+
25
+ def source
26
+ xml_data.to_s
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -19,5 +19,8 @@ SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:camt.054.001.04', :
19
19
  ## PAIN001
20
20
  SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:pain.001.001.03', :pain001)
21
21
 
22
+ ## PAIN002
23
+ SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:pain.002.001.03', :pain002)
24
+
22
25
  ## PAIN008
23
26
  SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:pain.008.003.02', :pain008)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SepaFileParser
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.2.0'.freeze
5
5
  end
@@ -7,6 +7,7 @@ module SepaFileParser
7
7
  camt053: SepaFileParser::Camt053::Base,
8
8
  camt054: SepaFileParser::Camt054::Base,
9
9
  pain001: SepaFileParser::Pain001::Base,
10
+ pain002: SepaFileParser::Pain002::Base,
10
11
  pain008: SepaFileParser::Pain008::Base,
11
12
  }.freeze
12
13
 
@@ -30,6 +30,8 @@ require_relative 'sepa_file_parser/camt054/notification'
30
30
  require_relative 'sepa_file_parser/camt054/base'
31
31
  require_relative 'sepa_file_parser/pain001/payment_information'
32
32
  require_relative 'sepa_file_parser/pain001/base'
33
+ require_relative 'sepa_file_parser/pain002/report'
34
+ require_relative 'sepa_file_parser/pain002/base'
33
35
  require_relative 'sepa_file_parser/pain008/payment_information'
34
36
  require_relative 'sepa_file_parser/pain008/base'
35
37
  require_relative 'sepa_file_parser/file'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sepa_file_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-23 00:00:00.000000000 Z
11
+ date: 2024-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -128,6 +128,8 @@ files:
128
128
  - lib/sepa_file_parser/misc.rb
129
129
  - lib/sepa_file_parser/pain001/base.rb
130
130
  - lib/sepa_file_parser/pain001/payment_information.rb
131
+ - lib/sepa_file_parser/pain002/base.rb
132
+ - lib/sepa_file_parser/pain002/report.rb
131
133
  - lib/sepa_file_parser/pain008/base.rb
132
134
  - lib/sepa_file_parser/pain008/payment_information.rb
133
135
  - lib/sepa_file_parser/register.rb