James Cole
2 years ago
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
3 changed files with
14 additions and
2 deletions
-
app/Services/Nordigen/Model/Account.php
-
app/Services/Nordigen/Services/AccountInformationCollector.php
-
app/Services/Shared/Model/ImportServiceAccount.php
|
|
@ -131,6 +131,11 @@ class Account |
|
|
|
return $this->bban; |
|
|
|
} |
|
|
|
|
|
|
|
public function getBalances(): array |
|
|
|
{ |
|
|
|
return $this->balances; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param string $bban |
|
|
|
*/ |
|
|
|
|
|
@ -133,7 +133,7 @@ class AccountInformationCollector |
|
|
|
$account->setStatus($information['status'] ?? ''); |
|
|
|
$account->setUsage($information['usage'] ?? ''); |
|
|
|
|
|
|
|
// set owner info (could be array or string)
|
|
|
|
// set owner info (could be an array or string)
|
|
|
|
$ownerAddress = []; |
|
|
|
if (array_key_exists('ownerAddressUnstructured', $information) && is_array($information['ownerAddressUnstructured'])) { |
|
|
|
$ownerAddress = $information['ownerAddressUnstructured']; |
|
|
|
|
|
@ -28,6 +28,7 @@ namespace App\Services\Shared\Model; |
|
|
|
|
|
|
|
use App\Services\CSV\Converter\Iban as IbanConverter; |
|
|
|
use App\Services\Nordigen\Model\Account as NordigenAccount; |
|
|
|
use App\Services\Nordigen\Model\Balance; |
|
|
|
use App\Services\Spectre\Model\Account as SpectreAccount; |
|
|
|
|
|
|
|
class ImportServiceAccount |
|
|
@ -57,7 +58,7 @@ class ImportServiceAccount |
|
|
|
$iban = ''; |
|
|
|
} |
|
|
|
|
|
|
|
$return[] = self::fromArray( |
|
|
|
$current = self::fromArray( |
|
|
|
[ |
|
|
|
'id' => $account->getIdentifier(), |
|
|
|
'name' => $account->getFullName(), |
|
|
@ -75,6 +76,12 @@ class ImportServiceAccount |
|
|
|
], |
|
|
|
] |
|
|
|
); |
|
|
|
/** @var Balance $balance */ |
|
|
|
foreach ($account->getBalances() as $balance) { |
|
|
|
$key = sprintf('Balance (%s) (%s)', $balance->type, $balance->currency); |
|
|
|
$current->extra[$key] = $balance->amount; |
|
|
|
} |
|
|
|
$return[] = $current; |
|
|
|
} |
|
|
|
|
|
|
|
return $return; |
|
|
|