-
Notifications
You must be signed in to change notification settings - Fork 60
Description
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);
}