Coder Social home page Coder Social logo

php-mt940's Introduction

Latest Stable Version Total Downloads License

Scrutinizer Quality Score Build Status wercker status

php-mt940?

The php-mt940 package provides a lightweight parser for mt940 (dutch bank file format) parsing. The output is transformed into easy to use dataclasses Transaction_banking which itself contains Statement_banking objects. Pretty straight forward.

Requirements

  • Atleast PHP 5.5.

Installation

If composer is not yet on your system, follow the instructions on getcomposer.org to do so.

To add this dependency to your project, simply run the following command from the root of your project:

composer require kingsquare/php-mt940

This ensures that you install the latest stable release.

How to use the parser?

I've attached a simple script in the examples directory to explain it a bit more in detail, but after loading the required classes, the usage should be pretty simple:

<?php
// ... load everything ... //

// instantiate the actual parser
// and parse them from a given file, this could be any file or a posted string
$parser = new \Kingsquare\Parser\Banking\Mt940();
$tmpFile = __DIR__.'/test.mta';
$parsedStatements = $parser->parse(file_get_contents($tmpFile));
?>

Included engines

Currently the following engines are included:

Custom engines

To override engines or just try a one-off engine on a file, you can pass an engine into the parse-method:

<?php
// ... load everything ... //

class MyCustomMt940Engine extends \Kingsquare\Parser\Banking\Mt940\Engine {
    // add your overrides / overloads and custom logic here
}

// instantiate the actual parser
// and parse them from a given file, this could be any file or a posted string
$parser = new \Kingsquare\Parser\Banking\Mt940();
$engine = new MyCustomMt940Engine();
$tmpFile = __DIR__.'/test.mta';
$parsedStatements = $parser->parse(file_get_contents($tmpFile), $engine);
?>

Known issues

I've provided unittests but please take a look at the github issue tracker for the latest ideas's, issues or other stuff..

Future plans

I do intend to add new engines or keep everything running smoothly, but since i don't have access to any more test files, it's hard to add new engines ;) The unknown engine should work or atleast give some idea as to where different banks diverge from the standard. If you do have any ideas, examples or new banks that you'd like to see incorporated, please don't hesitate and send me an issue / pullrequest!

Contact

This is GitHub, you know where to find me :)

License

PHP-MT940 is licensed under the MIT License - see the LICENSE file for details

php-mt940's People

Contributors

fruitl00p avatar tswestendorp avatar markoheijnen avatar sven-codeculture avatar sammousa avatar sebastianberm avatar tpokorra avatar ddcatgg avatar doenietzomoeilijk avatar hpolthof avatar rikvdh avatar tomcoonen avatar tuxphr34k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.