Skip to content

Commit 15ccbfd

Browse files
author
Maxim
committed
preps 1.3.0
- extends README
1 parent 2b46a0a commit 15ccbfd

File tree

3 files changed

+74
-45
lines changed

3 files changed

+74
-45
lines changed

CHANGELOG.mdown

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,45 @@
1+
# 1.3.0
2+
3+
- [FEATURE] adds MT942 compability
4+
15
# 1.2.0
2-
* [FEATURE] strips mt940 header if configured ([#9](https://github.com/railslove/cmxl/issues/9))
3-
```ruby
4-
Cmxl.config[:strip_headers] = true
5-
```
6+
7+
- [FEATURE] strips mt940 header if configured ([#9](https://github.com/railslove/cmxl/issues/9))
8+
```ruby
9+
Cmxl.config[:strip_headers] = true
10+
```
611

712
# 1.1.1
8-
* [BUGFIX] prevents short bank references from swallowing supplementary details delimiter
13+
14+
- [BUGFIX] prevents short bank references from swallowing supplementary details delimiter
915

1016
# 1.1.0
11-
* [FEATURE] adds support for supplementary details in transactions (Field 61, Subfield 9) ([#18](https://github.com/railslove/cmxl/issues/18))
17+
18+
- [FEATURE] adds support for supplementary details in transactions (Field 61, Subfield 9) ([#18](https://github.com/railslove/cmxl/issues/18))
1219

1320
# 1.0.0
14-
* [FEATURE] adds support for storno transactions ([#14](https://github.com/railslove/cmxl/issues/14))
15-
* [NOTE] full backwards compatibility
16-
* [NOTE] same as release 0.2.2, fixing versioning
21+
22+
- [FEATURE] adds support for storno transactions ([#14](https://github.com/railslove/cmxl/issues/14))
23+
- [NOTE] full backwards compatibility
24+
- [NOTE] same as release 0.2.2, fixing versioning
1725

1826
# 0.2.1
19-
* addressing an bug that occoured for transactions submitted end of
20-
but were fetched in the new year -> those ended up with the wrong year
21-
on the entry date
22-
* MT942 support for field 13
27+
28+
- addressing an bug that occoured for transactions submitted end of
29+
but were fetched in the new year -> those ended up with the wrong year
30+
on the entry date
31+
- MT942 support for field 13
2332

2433
# 0.2.0
25-
* added several balance related accessors ([#7](https://github.com/railslove/cmxl/issues/7))
26-
* configuration option for `statement separator` ([#5](https://github.com/railslove/cmxl/issues/5))
27-
* improvement for general compatibility
34+
35+
- added several balance related accessors ([#7](https://github.com/railslove/cmxl/issues/7))
36+
- configuration option for `statement separator` ([#5](https://github.com/railslove/cmxl/issues/5))
37+
- improvement for general compatibility
2838

2939
# 0.1.3
3040

31-
* [BUGFIX] fixed the statement details parser. It failed in case of empty values in the SEPA details
41+
- [BUGFIX] fixed the statement details parser. It failed in case of empty values in the SEPA details
3242

3343
# 0.1.2
3444

35-
* [BUGFIX] fixed the statement details parser. It failed in case of empty values in the sub fields
45+
- [BUGFIX] fixed the statement details parser. It failed in case of empty values in the sub fields

README.md

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
# Cmxl - your friendly ruby MT940 parser
44

5-
At [Railslove](http://railslove.com) we build a lot of financial applications and work on integrating applications with banks and banking functionality.
5+
At [Railslove](http://railslove.com) we build a lot of financial applications and work on integrating applications with banks and banking functionality.
66
Our goal is to make simple solutions for what often looks complicated.
77

8-
Cmxl is a friendly and extendible MT940 bank statement file parser that helps your extracting data from the bank statement files.
8+
Cmxl is a friendly and extendible MT940 bank statement file parser that helps your extracting data from the bank statement files.
99

10-
## What is MT940?
10+
## What is MT940 & MT942?
1111

12-
MT940 (MT = Message Type) is the SWIFT-Standard for the electronic transfer of bank statement files.
13-
When integrating with banks you often get MT940 files as interface.
12+
MT940 (MT = Message Type) is the SWIFT-Standard for the electronic transfer of bank statement files.
13+
When integrating with banks you often get MT940 or MT942 files as interface.
1414
For more information have a look at the different [SWIFT message types](http://en.wikipedia.org/wiki/SWIFT_message_types)
1515

1616
At some point in the future MT940 file should be exchanged with newer XML documents - but banking institutions are slow so MT940 will stick around for a while.
1717

1818
## Reqirements
1919

20-
Cmxl is a pure ruby parser and has no dependency on native extensions.
20+
Cmxl is a pure ruby parser and has no dependency on native extensions.
2121

22-
* Ruby 1.9.3 or newer (jruby, etc.)
22+
- Ruby 1.9.3 or newer (jruby, etc.)
2323

2424
## Installation
2525

@@ -37,7 +37,7 @@ Or install it yourself as:
3737

3838
## Usage
3939

40-
Simple usage:
40+
Simple usage:
4141

4242
```ruby
4343

@@ -55,14 +55,14 @@ Cmxl.config[:strip_headers] = true
5555

5656
# Statment parsing:
5757

58-
statements = Cmxl.parse(File.read('mt940.txt'), :encoding => 'ISO-8859-1') # parses the file and returns an array of statement objects. Please note: if no encoding is given Cmxl tries to guess the encoding from the content and converts it to UTF-8.
58+
statements = Cmxl.parse(File.read('mt940.txt'), :encoding => 'ISO-8859-1') # parses the file and returns an array of statement objects. Please note: if no encoding is given Cmxl tries to guess the encoding from the content and converts it to UTF-8.
5959
statements.each do |s|
6060
puts s.reference
6161
puts s.generation_date
6262
puts s.opening_balance.amount
6363
puts s.closing_balance.amount
6464
puts s.sha # SHA of the statement source - could be used as an unique identifier
65-
65+
6666
s.transactions.each do |t|
6767
puts t.information
6868
puts t.description
@@ -87,24 +87,46 @@ Every object responds to `to_h` and let's you easily convert the data to a hash.
8787

8888
#### A note about encoding and file wirednesses
8989

90-
You probably will encounter encoding issues (hey, you are building banking applications!).
91-
We try to handle encoding and format wirednesses as much as possible. If no encoding is passed we try to guess the encoding of the data and convert it to UTF8.
92-
In the likely case that you encouter encoding issues you can pass encoding options to the `Cmxl.parse(<string>, <options hash>)` it accepts the same options as [String#encode](http://ruby-doc.org/core-2.1.3/String.html#method-i-encode)
90+
You probably will encounter encoding issues (hey, you are building banking applications!).
91+
We try to handle encoding and format wirednesses as much as possible. If no encoding is passed we try to guess the encoding of the data and convert it to UTF8.
92+
In the likely case that you encouter encoding issues you can pass encoding options to the `Cmxl.parse(<string>, <options hash>)` it accepts the same options as [String#encode](http://ruby-doc.org/core-2.1.3/String.html#method-i-encode)
9393
If that fails try to motify the file before you pass it to the parser - and please create an issue.
9494

9595
### MT940 SWIFT header data
9696

97-
Cmxl currently does not support parsing of the SWIFT headers (like {1:F01AXISINBBA ....)
97+
Cmxl currently does not support parsing of the SWIFT headers (like {1:F01AXISINBBA ....)
9898
If your file comes with these headers try the `strip_headers` configuration option to strip data execpt the actual MT940 fields.
9999

100100
```ruby
101101
Cmxl.config[:strip_headers] = true
102102
Cmxl.parse(...)
103103
```
104104

105+
### MT942 data
106+
107+
CMXL is now also capable of parsing MT942 data. Just pass the data and the parser will identify the type automatically.
108+
109+
```ruby
110+
first_statement = Cmxl.parse(File.read('mt940.txt'), :encoding => 'ISO-8859-1').first
111+
puts first_statement.mt942?
112+
#=> false
113+
114+
first_statement = Cmxl.parse(File.read('mt942.txt'), :encoding => 'ISO-8859-1').first
115+
puts first_statement.mt942?
116+
#=> true
117+
118+
p first_statement.vmk_credit_summary.to_h
119+
#=> { type: 'credit', entries: 1, amount: 9792.0, currency: 'EUR' }
120+
121+
p first_statement.vmk_dedit_summary.to_h
122+
#=> { type: 'debit', entries: 0, amount: 0.0, currency: 'EUR' }
123+
124+
first_statement.transactions # same as for MT940
125+
```
126+
105127
### Custom field parsers
106128

107-
Because a lot of banks implement the MT940 format slightly different one of the design goals of this library is to be able to customize the individual field parsers.
129+
Because a lot of banks implement the MT940 format slightly different one of the design goals of this library is to be able to customize the individual field parsers.
108130
Every line get parsed with a special parser. Here is how to write your own parser:
109131

110132
```ruby
@@ -128,23 +150,20 @@ my_field_parser.data #=> {'world' => 'hello from mt940'} - data is the accessor
128150

129151
## Parsing issues? - please create an issue with your file
130152

131-
The Mt940 format often looks different for the different banks and the different countries. Especially the not strict defined fields are often used for custom bank data.
153+
The Mt940 format often looks different for the different banks and the different countries. Especially the not strict defined fields are often used for custom bank data.
132154
If you have a file that can not be parsed please open an issue. We hope to build a parser that handles most of the files.
133155

134-
135156
## ToDo
136157

137-
* collect MT940 files from different banks and use them as example for specs
138-
* support for Mt942
139-
* better header data handling
140-
158+
- collect MT940 files from different banks and use them as example for specs
159+
- better header data handling
141160

142161
## Looking for other Banking and EBICS tools?
143162

144163
Maybe these are also interesting for you.
145164

146-
* [EPICS: Open Source SEPA EBICS client](https://railslove.github.io/epics/) full implementation to manage all the banking activities like direct debits, credits, etc. (SEPA Lastschrift, Überweisungen, etc.)
147-
* [EBICS::Box: out of the box solution to automate banking activities](http://www.railslove.com/ebics-box) - The missing API for your bank
165+
- [EPICS: Open Source SEPA EBICS client](https://railslove.github.io/epics/) full implementation to manage all the banking activities like direct debits, credits, etc. (SEPA Lastschrift, Überweisungen, etc.)
166+
- [EBICS::Box: out of the box solution to automate banking activities](http://www.railslove.com/ebics-box) - The missing API for your bank
148167

149168
## Contributing
150169

@@ -161,9 +180,9 @@ Automated tests: We use rspec to test Cmxl. Simply run `rake` to execute the who
161180
Cmxl is inspired and borrows ideas from the `mt940_parser` by the great people at [betterplace](https://www.betterplace.org/).
162181

163182
other parsers:
164-
* [betterplace/mt940_parser](https://github.com/betterplace/mt940_parser)
165-
* [gmitrev/mt940parser](https://github.com/gmitrev/mt940parser)
166183

184+
- [betterplace/mt940_parser](https://github.com/betterplace/mt940_parser)
185+
- [gmitrev/mt940parser](https://github.com/gmitrev/mt940parser)
167186

168187
## Stats
169188

@@ -172,6 +191,6 @@ other parsers:
172191
[![Test Coverage](https://codeclimate.com/github/railslove/cmxl/badges/coverage.svg)](https://codeclimate.com/github/railslove/cmxl)
173192
[![Gem Version](https://badge.fury.io/rb/cmxl.svg)](http://badge.fury.io/rb/cmxl)
174193

175-
------------
194+
---
176195

177196
2014 - built with love by [Railslove](http://railslove.com) and released under the MIT-Licence. We have built quite a number of FinTech products. If you need support we are happy to help. Please contact us at [email protected].

lib/cmxl/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Cmxl
2-
VERSION = '1.2.0'.freeze
2+
VERSION = '1.3.0'.freeze
33
end

0 commit comments

Comments
 (0)