mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
code cleanups
This commit is contained in:
parent
f557fe900d
commit
8a0b80d64b
@ -81,15 +81,14 @@ class TransactionTransformer implements BankRevenueInterface
|
||||
|
||||
public function transformTransaction($transaction)
|
||||
{
|
||||
|
||||
if ((!array_key_exists('transactionId', $transaction) && !array_key_exists('internalTransactionId', $transaction)) || !array_key_exists('transactionAmount', $transaction))
|
||||
throw new \Exception('invalid dataset');
|
||||
|
||||
// depending on institution, the result can be different, so we load the first available unique id
|
||||
$transactionId = '';
|
||||
if (array_key_exists('transactionId', $transaction))
|
||||
$transactionId = $transaction["transactionId"];
|
||||
else if (array_key_exists('internalTransactionId', $transaction))
|
||||
$transactionId = $transaction["internalTransactionId"];
|
||||
else
|
||||
throw new \Exception('invalid dataset: missing transactionId - Please report this error to the developer');
|
||||
|
||||
$amount = (float) $transaction["transactionAmount"]["amount"];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user