Fix missing account validation step.

This commit is contained in:
James Cole 2023-05-06 15:59:31 +02:00
parent 1ef9b83180
commit 309d3e8e95
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
2 changed files with 4 additions and 2 deletions

View File

@ -130,11 +130,13 @@ trait WithdrawalValidation
{ {
$accountId = array_key_exists('id', $array) ? $array['id'] : null; $accountId = array_key_exists('id', $array) ? $array['id'] : null;
$accountName = array_key_exists('name', $array) ? $array['name'] : null; $accountName = array_key_exists('name', $array) ? $array['name'] : null;
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
$accountNumber =array_key_exists('number', $array) ? $array['number'] : null;
Log::debug('Now in validateWithdrawalSource', $array); Log::debug('Now in validateWithdrawalSource', $array);
// source can be any of the following types. // source can be any of the following types.
$validTypes = array_keys($this->combinations[$this->transactionType]); $validTypes = array_keys($this->combinations[$this->transactionType]);
if (null === $accountId && null === $accountName && false === $this->canCreateTypes($validTypes)) { if (null === $accountId && null === $accountName && null === $accountNumber && null === $accountIban && false === $this->canCreateTypes($validTypes)) {
// if both values are NULL we return false, // if both values are NULL we return false,
// because the source of a withdrawal can't be created. // because the source of a withdrawal can't be created.
$this->sourceError = (string)trans('validation.withdrawal_source_need_data'); $this->sourceError = (string)trans('validation.withdrawal_source_need_data');

View File

@ -90,7 +90,7 @@ trait TransactionValidation
Log::error(sprintf('Transactions array is not countable, because its a %s', gettype($transactions))); Log::error(sprintf('Transactions array is not countable, because its a %s', gettype($transactions)));
return []; return [];
} }
Log::debug('Returning transactions.', $transactions); //Log::debug('Returning transactions.', $transactions);
return $transactions; return $transactions;
} }