sepa_file_parser 0.3.0 → 0.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d849a3d8a2c14d65f90cd313e59ea45d6a61fe9c8a4e2ab4adbdc92b74e2ee44
|
4
|
+
data.tar.gz: 39b96e5ed8cab2969e2c81aa1c89a6993c519181da677cb3e103e3ff7f6dee79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52abe875f8007897411b0dfa7d2ef163ff57b94e925afdee25c508e63176418f9a054ab400bdcac35c29dbb51369fac2ca6fc03351e97b2bbd40fc1499c2c20b
|
7
|
+
data.tar.gz: 016deaaaad4a9ec7cdb922ce4f340033e7772bfb7dd0815d9d899c6f7c52b5bced82233e7f2114e1dfe5de9d2f95697093a0ee049085a00b75448584a0014950
|
@@ -40,7 +40,10 @@ module SepaFileParser
|
|
40
40
|
|
41
41
|
def opening_balance
|
42
42
|
@opening_balance ||= begin
|
43
|
-
|
43
|
+
openingNode = xml_data.xpath('Bal/Tp//Cd[contains(text(), "PRCD")]').first ||
|
44
|
+
xml_data.xpath('Bal/Tp//Cd[contains(text(), "OPBD")]').first
|
45
|
+
|
46
|
+
bal = openingNode.ancestors('Bal')
|
44
47
|
date = bal.xpath('Dt/Dt/text()').text
|
45
48
|
credit = bal.xpath('CdtDbtInd/text()').text == 'CRDT'
|
46
49
|
currency = bal.xpath('Amt').attribute('Ccy').value
|
@@ -82,6 +82,18 @@ module SepaFileParser
|
|
82
82
|
@reference ||= xml_data.xpath('Refs/InstrId/text()').text
|
83
83
|
end
|
84
84
|
|
85
|
+
def original_currency_amount # May be missing
|
86
|
+
@original_currency_amount ||= SepaFileParser::Misc.to_amount(parse_original_currency_amount)
|
87
|
+
end
|
88
|
+
|
89
|
+
def original_currency # May be missing
|
90
|
+
@original_currency ||= xml_data.xpath('AmtDtls/InstdAmt/Amt/@Ccy').text
|
91
|
+
end
|
92
|
+
|
93
|
+
def exchange_rate # May be missing
|
94
|
+
@exchange_rate ||= xml_data.xpath('AmtDtls/TxAmt/CcyXchg/XchgRate/text()').text
|
95
|
+
end
|
96
|
+
|
85
97
|
def bank_reference # May be missing
|
86
98
|
@bank_reference ||= xml_data.xpath('Refs/AcctSvcrRef/text()').text
|
87
99
|
end
|
@@ -103,7 +115,10 @@ module SepaFileParser
|
|
103
115
|
end
|
104
116
|
|
105
117
|
def creditor_identifier # May be missing
|
106
|
-
@creditor_identifier ||=
|
118
|
+
@creditor_identifier ||= [
|
119
|
+
xml_data.xpath('RltdPties/Cdtr/Id/PrvtId/Othr/Id/text()'),
|
120
|
+
xml_data.xpath('RltdPties/Cdtr/Pty/Id/PrvtId/Othr/Id/text()'),
|
121
|
+
].reject(&:empty?).first.text
|
107
122
|
end
|
108
123
|
|
109
124
|
def payment_information # May be missing
|
@@ -120,6 +135,10 @@ module SepaFileParser
|
|
120
135
|
|
121
136
|
private
|
122
137
|
|
138
|
+
def parse_original_currency_amount
|
139
|
+
xml_data.xpath('AmtDtls/InstdAmt/Amt/text()').text
|
140
|
+
end
|
141
|
+
|
123
142
|
def parse_amount
|
124
143
|
if xml_data.xpath('Amt').any?
|
125
144
|
xml_data.xpath('Amt/text()').text
|
@@ -5,6 +5,7 @@ require_relative './xml'
|
|
5
5
|
# Add registrations
|
6
6
|
## CAMT052
|
7
7
|
SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:camt.052.001.02', :camt052)
|
8
|
+
SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:camt.052.001.08', :camt052)
|
8
9
|
|
9
10
|
## CAMT053
|
10
11
|
SepaFileParser::Xml.register('urn:iso:std:iso:20022:tech:xsd:camt.053.001.02', :camt053)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepa_file_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Schoknecht
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|