sepa_file_parser 0.1.0 → 0.2.1

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: 9a8d90059f9f6a6aa166f2f164a0e2412ff8ae5378b8d614f8fc764095094d9e
4
+ data.tar.gz: 1ae6aeacac6e2a086cd8abeefca57ba83992d155e6b76a84d18a3327b05a9b58
5
5
  SHA512:
6
- metadata.gz: b151cf8b849f21e33e01d4c2b85268c150cf010ab0c62a5743dd9ef004ebac010b5f46f237d6b9c3ad5764aa26ca6eeda27a1bb6fe45349fa810259e560baa2f
7
- data.tar.gz: b7557e088a656bc18f892f008e7aba228efbdc60a0da2b998735c9db0d7935b9babecbf25679618d60683f64cf1a318807c0c3045c3abf1804eb908fabc423ab
6
+ metadata.gz: 1f0b6558fcbe154187bfbd0dbfcb9a5a567302ff85e9b2a6325e3f69c1e8f14898a9c69ca70d3d958a6be1c3c1e701de9745ada957a8a103f47861c6b4a7c3e7
7
+ data.tar.gz: e6c2565015a26d735eec95310f897bf7a28b5341d97e700ba2a11d11975408a1906881f21798bafcc5c321b44b392167c559b15996aa5d4f4be40b93113d24a6
@@ -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,9 @@ 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
+ SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:pain.002.001.10', :pain002)
25
+
22
26
  ## PAIN008
23
27
  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.1'.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.1
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