camt_parser 2.9.0 → 2.11.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: 1ab0e2f31eb6cbafeaeda36ef3d09815ca8c4a8eaa854f31675c56c036de631f
4
- data.tar.gz: b770cc8c5275519149590f8decd8339211116265d1e2435aba1124a84b3e4efb
3
+ metadata.gz: f1ad921eca990eda6e9d8237ae3650fb41c0edf5c90dfd8cb346792876f90880
4
+ data.tar.gz: a45514f7a6cebef374f6a494b9999ef7c79900f6ff83296c46e5e9b46e69cad4
5
5
  SHA512:
6
- metadata.gz: c6bcd215688c41b5931c852ae05e08d7687a94bed8e3a9d0ea4b434c8977870d2370ad61e26f659c6461fd05e9468b04e7df166a7d4cf904469fd47121cdb40d
7
- data.tar.gz: 0eb90c900f1838df35536a89a360315bbde8e452b52357ca152f7cef14fdedb63fa34c6c89be14fe8a4469b4ca3f8c07fc19aabcc60c098fc35e6a55e0a112ec
6
+ metadata.gz: 1816bb435502061c3b7538c8914001aba4ebf5b6191c94d4b32613965e4b60a3256bb1429543bbe8bc79e050b0497a0b227aa0aaefe2c94ce3948ebd6793c540
7
+ data.tar.gz: 134e052b4c9dd05a36541cb9b65c17481c7065b5d74ec0e34cbcd0de8d3cef2ad947dd3a59851d07d1a43d9382b5a99ea3fd45a2d6aae529d88b143f213efbfe
@@ -8,6 +8,14 @@ module CamtParser
8
8
  @iban ||= @xml_data.xpath('Id/IBAN/text()').text
9
9
  end
10
10
 
11
+ def other_id
12
+ @other_id ||= @xml_data.xpath('Id/Othr/Id/text()').text
13
+ end
14
+
15
+ def account_number
16
+ !iban.nil? && !iban.empty? ? iban : other_id
17
+ end
18
+
11
19
  def bic
12
20
  @bic ||= @xml_data.xpath('Svcr/FinInstnId/BIC/text()').text
13
21
  end
@@ -8,6 +8,10 @@ module CamtParser
8
8
  @payment_information_identification ||= @xml_data.xpath('PmtInfId/text()').text
9
9
  end
10
10
 
11
+ def msg_id # may be missing
12
+ @msg_id ||= @xml_data.xpath('MsgId/text()').text
13
+ end
14
+
11
15
  def number_of_transactions
12
16
  @number_of_transactions ||= @xml_data.xpath('NbOfTxs/text()').text
13
17
  end
@@ -4,7 +4,10 @@ module CamtParser
4
4
  def to_amount_in_cents(value)
5
5
  return nil if value == nil || value.strip == ''
6
6
 
7
- value.gsub(/[,|\.](\d*)/) { $1.ljust(2, '0') }.to_i
7
+ # Using dollars and cents as representation for parts before and after the decimal separator
8
+ dollars, cents = value.split(/,|\./)
9
+ cents ||= '0'
10
+ format('%s%s', dollars, cents.ljust(2, '0')).to_i
8
11
  end
9
12
 
10
13
  def to_amount(value)
@@ -1,3 +1,3 @@
1
1
  module CamtParser
2
- VERSION = '2.9.0'.freeze
2
+ VERSION = '2.11.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camt_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-29 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0'
69
69
  description: A parser for the Camt file format
70
70
  email:
71
- - tobias.schoknecht@barzahlen.de
71
+ - tobias.schoknecht@viafintech.com
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
@@ -104,7 +104,7 @@ homepage: https://github.com/Barzahlen/camt_parser
104
104
  licenses:
105
105
  - MIT
106
106
  metadata: {}
107
- post_install_message:
107
+ post_install_message:
108
108
  rdoc_options: []
109
109
  require_paths:
110
110
  - lib
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.0.6
123
- signing_key:
122
+ rubygems_version: 3.1.4
123
+ signing_key:
124
124
  specification_version: 4
125
125
  summary: Gem for parsing camt files into a speaking object.
126
126
  test_files: []