wimverstuyf / php-coda-parser

PHP parser for Belgian CODA banking files
GNU Lesser General Public License v3.0
42 stars 25 forks source link

Sepa direct debit support #3

Closed Grummfy closed 9 years ago

Grummfy commented 9 years ago

Example :

$parser = new \Codelicious\Coda\Parser();
            $parser->setDetailParser([
                new DetailParsers\IdentificationParser(),
                new DetailParsers\OriginalSituationParser(),
                new DetailParsers\Transaction21SepaDirectDebitParser(),
                new DetailParsers\Transaction22Parser(),
                new DetailParsers\Transaction23Parser(),
                new DetailParsers\Transaction31Parser(),
                new DetailParsers\Transaction32Parser(),
                new DetailParsers\Transaction33Parser(),
                new DetailParsers\MessageParser(),
                new DetailParsers\NewSituationParser(),
                new DetailParsers\SummaryParser(),
            ]);
            $codaLine = $parser->fileToCodaLines($uploadEdFile->getRealPath());
            $codaRaw = $parser->parseToRaw($codaLine);
            $statements = $parser->transformRaw($codaRaw, new \Codelicious\Coda\Transformation\TransformToSimpleWithSepaDirectDebit());

And then you have the information about the sdd in your transaction