Update TransactionTransformer.php

I've changed the way base_type was defined by using the $amount field that was already defined before and made it use the float value to check below 0, so that small values like 0.01 also work.

Signed-off-by: Yannick <yannickdg99@gmail.com>
This commit is contained in:
Yannick 2024-05-23 00:44:46 +02:00 committed by GitHub
parent a97faf3f97
commit fb9447e216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -148,7 +148,7 @@ class TransactionTransformer implements BankRevenueInterface
'description' => $description,
'participant' => $participant,
'participant_name' => $participant_name,
'base_type' => (int) $transaction["transactionAmount"]["amount"] <= 0 ? 'DEBIT' : 'CREDIT',
'base_type' => $amount < 0 ? 'DEBIT' : 'CREDIT',
];
}