Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd mark not found in: 180518RD5,00NMSC1 #111

Open
tobias-dietz opened this issue Jun 28, 2018 · 0 comments
Open

cd mark not found in: 180518RD5,00NMSC1 #111

tobias-dietz opened this issue Jun 28, 2018 · 0 comments

Comments

@tobias-dietz
Copy link

tobias-dietz commented Jun 28, 2018

The issue occurs on a booking line which was created by my bank (Volksbank / Fiducia) for canceling an account fee for issuing a new debit card. Not sure what to do with "RD" marked lines - aren't they basically "credit" lines (R= reversed, D=debit)?

On line 100 in Fhp\Paraser\MT940 you extract the different marks but the if/elseif (101, 103) doesn't have a case for "RD" and "RC".

Spec: https://www.rabobank.com/nl/images/format-description-swift-mt940-structured-en.pdf page 7 2.3.6 field :61: Statement Line

Quick fix:

Fhp\Paraser\MT940 line 100 to 107:

preg_match('/^\d{6}(\d{4})?(C|D|RC|RD)([A-Z]{1})?([^N]+)N/', $transaction, $trxMatch);
if ($trxMatch[2] == 'C' || $trxMatch[2] == 'RD') {
$trx[count($trx)]['credit_debit'] = static::CD_CREDIT;
} elseif ($trxMatch[2] == 'D' || $trxMatch[2] == 'RC') {
$trx[count($trx)]['credit_debit'] = static::CD_DEBIT;
} else {
throw new MT940Exception('cd mark not found in: ' . $transaction);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant