sepa_file_parser 0.2.2 → 0.4.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: 15edde5fad18eb796a18e88cf9ea90971ca9f150e8514f325e8624818a96fa9a
4
- data.tar.gz: 725d1010f0a58b488cc0c54df14342074365d375ba80fe37df0e2c5b0179f185
3
+ metadata.gz: dc1b49342df2ec9e64acf292db190c7a0f18faa8ac3b687f0411abdc09b17095
4
+ data.tar.gz: 44a28b13cbff5ec5d953f990d51ba927dd4851c12e661097126529c13bf4c922
5
5
  SHA512:
6
- metadata.gz: a919ed43e7ab99a9679735df33491b3f319724c3f86d960c36ded230e21a3d5d4c9bb637602a0991c5fe460be36229ac703d06f562335a63ace02ca055c0c866
7
- data.tar.gz: 07cb118e95c4b23244959351ca1c09149af2c04074e4073ab3950bad00fbe0c9bb1a93af8058f3f907e5fa2b6548647e2b98f5dd26398f2de545e5a15c004a4d
6
+ metadata.gz: b5e447b025c72c012230d773d67ce6d55cbbc6cf3c88da7c9c3c97e9cc8b112d8eea2c56a1b199826f63c92f1446bccd36258cd22a0fa43aa7dbc5fec883d198
7
+ data.tar.gz: 0eab576311fa01993d1499ca6050330ebd373075f4a0165071b527df5f2fb79d6ea81c77c51d2335d7785df4131d633b005b32bb5edf88ab918312c45490caa4
@@ -53,6 +53,11 @@ module SepaFileParser
53
53
  @bank_reference ||= xml_data.xpath('AcctSvcrRef/text()').text
54
54
  end
55
55
 
56
+ # @return [String]
57
+ def reference # May be missing
58
+ @reference ||= xml_data.xpath('NtryRef/text()').text
59
+ end
60
+
56
61
  # @return [Array<SepaFileParser::Transaction>]
57
62
  def transactions
58
63
  @transactions ||= parse_transactions
@@ -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
@@ -120,6 +132,10 @@ module SepaFileParser
120
132
 
121
133
  private
122
134
 
135
+ def parse_original_currency_amount
136
+ xml_data.xpath('AmtDtls/InstdAmt/Amt/text()').text
137
+ end
138
+
123
139
  def parse_amount
124
140
  if xml_data.xpath('Amt').any?
125
141
  xml_data.xpath('Amt/text()').text
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SepaFileParser
4
- VERSION = '0.2.2'.freeze
4
+ VERSION = '0.4.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sepa_file_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-06-13 00:00:00.000000000 Z
10
+ date: 2025-01-15 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -140,7 +139,6 @@ homepage: https://github.com/viafintech/sepa_file_parser
140
139
  licenses:
141
140
  - MIT
142
141
  metadata: {}
143
- post_install_message:
144
142
  rdoc_options: []
145
143
  require_paths:
146
144
  - lib
@@ -155,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
153
  - !ruby/object:Gem::Version
156
154
  version: '0'
157
155
  requirements: []
158
- rubygems_version: 3.5.11
159
- signing_key:
156
+ rubygems_version: 3.6.2
160
157
  specification_version: 4
161
158
  summary: Gem for parsing camt, pain, ... files into a speaking object.
162
159
  test_files: []