Giter VIP home page Giter VIP logo

Comments (7)

fruitl00p avatar fruitl00p commented on September 17, 2024 1

Have you run it through a debugger? Also the ING parser was created for the Dutch ING bank, it could be that the Polish ING has a different markup.

My suggestion to debug is allow the parser to detect it. Should it fallback to the generic parser, it should give a clue as to where to start looking ;) (and confirm that the Dutch ING and Polish ING differ in their MT940)

from php-mt940.

fruitl00p avatar fruitl00p commented on September 17, 2024 1

Hmmm... thanks for the link to the docs...

It seems ING Poland has some type of prefix for all the :86: lines... (as mentioned in the docs) You might want to have a look at pages 60+ from the PDF you mentioned. It should be doable to create a custom / new ING-Poland parser based on one of the other already available parsers.

I currently don't have the time personally to look too deep into this, but PRs are welcome ;)
(will flag this issue as #hacktoberfest to get some attention)

from php-mt940.

websafe avatar websafe commented on September 17, 2024

I did some "debugging" ;-) but wasn't able to fix it really. It all starts with parseStatementData() in Engine.php.

My sta begins with:

:20:MT940
:25:/PL12345678912345678912345678
:28C:9
:60F:C190930PLN66666,66
:61:1909020902D850,39S02097202028342
:86:020
:86:020~00IBCG

The problem begins in:

protected function parseStatementData()
{
$results = preg_split(
'/(^:20:|^-X{,3}$|\Z)/m',
$this->getRawData(),
-1,
PREG_SPLIT_NO_EMPTY
);
array_shift($results); // remove the header
return $results;
}

As I understand my statements are not separated by ^:20 but by ^:86: so I "fixed" '/(^:20:|^-X{,3}$|\Z)/m' into '/(^:86:|^-X{,3}$|\Z)/m' and got an array with 156 entries as result.

But still verry messy. Just an example:

  15 => 
    object(Kingsquare\Banking\Statement)[26]
      private 'bank' => string 'ING' (length=3)
      private 'account' => string '' (length=0)
      private 'transactions' => 
        array (size=1)
          0 => 
            object(Kingsquare\Banking\Transaction)[27]
              ...
      private 'startPrice' => float 0
      private 'endPrice' => float 0
      private 'startTimestamp' => int 0
      private 'endTimestamp' => int 0
      private 'number' => string '' (length=0)
      private 'currency' => string '' (length=0)
      public 'rawData' => string '020~00IBCG
~20Faktura 11-116089-09196
~21~22
~23~24
~25
~3010301931~319000010015184076
~32Orange Polska S.A. Al. ~33Jerozolimskie 160 02-326 
~34020
~38PL42103019319000010015184076
~62Warszawa
:61:1909050905D1,00S02097202113823
' (length=239)

from php-mt940.

websafe avatar websafe commented on September 17, 2024

I have found the english description for MT940 used by ING-PL https://www.ing.pl/_fileserver/item/1003276
I guess it should be :61: not :86: but the result with 77 entries is still messy.
At least 77 matches the real transaction count. Same transaction as before as an example of the result I'm getting:

  7 => 
    object(Kingsquare\Banking\Statement)[11]
      private 'bank' => string 'ING' (length=3)
      private 'account' => string '' (length=0)
      private 'transactions' => 
        array (size=0)
          empty
      private 'startPrice' => float 0
      private 'endPrice' => float 0
      private 'startTimestamp' => int 0
      private 'endTimestamp' => int 0
      private 'number' => string '' (length=0)
      private 'currency' => string '' (length=0)
      public 'rawData' => string '1909050905D141,45S02097202112873
:86:020
:86:020~00IBCG
~20Faktura 11-116089-09196
~21~22
~23~24
~25
~3010301931~319000010015184076
~32Orange Polska S.A. Al. ~33Jerozolimskie 160 02-326 
~34020
~38PL42103019319000010015184076
~62Warszawa
' (length=250)

from php-mt940.

websafe avatar websafe commented on September 17, 2024

Thank you, I'll try to find some time :-)

from php-mt940.

websafe avatar websafe commented on September 17, 2024

@fruitl00p So I've started writing the IngPl parser, looks promising :-) But I'll have few questions. Is it OK to ask them using separate Issues?

from php-mt940.

fruitl00p avatar fruitl00p commented on September 17, 2024

@websafe a single thread is also doable.. .Just be sure to include a reproducable scenario et al... You might even go as far as creating a PR which isnt finished yet so I might be able to see how far your getting..

Its really up to you ;)

from php-mt940.

Related Issues (20)

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.