change account_type

This commit is contained in:
paulwer 2023-12-06 09:28:33 +01:00
parent 9f062cc4f8
commit e2d8ac37b5

View File

@ -83,11 +83,9 @@ use App\Helpers\Bank\AccountTransformerInterface;
*/
class AccountTransformer implements AccountTransformerInterface
{
class AccountTransformer implements AccountTransformerInterface {
public function transform($nordigen_account)
{
public function transform($nordigen_account) {
if(!property_exists($nordigen_account, 'data') || !property_exists($nordigen_account, 'metadata') || !property_exists($nordigen_account, 'balances') || !property_exists($nordigen_account, 'institution'))
throw new \Exception('invalid dataset');
@ -102,8 +100,8 @@ class AccountTransformer implements AccountTransformerInterface
}
return [
'id' => $nordigen_account->metadata["id"], // TODO: maybe add prefix for unique id between yodlee and nordigen?
'account_type' => "bank_account", // TODO: not creditCard, which type should be used here?!
'id' => $nordigen_account->metadata["id"],
'account_type' => "bank",
'account_name' => $nordigen_account->data["iban"],
'account_status' => $nordigen_account->metadata["status"],
'account_number' => '**** '.substr($nordigen_account->data["iban"], -7),