diff --git a/app/Import/Routine/BunqRoutine.php b/app/Import/Routine/BunqRoutine.php index b522f4e4bf..ffc7f09df4 100644 --- a/app/Import/Routine/BunqRoutine.php +++ b/app/Import/Routine/BunqRoutine.php @@ -810,7 +810,7 @@ class BunqRoutine implements RoutineInterface $this->addStep(); $account = new MonetaryAccountBank($accountData); $importId = $account->getId(); - if (1 === $mapping[$importId]) { + if (isset($mapping[$importId])) { Log::debug(sprintf('Will grab payments for account %s', $account->getDescription())); $request = new ListPaymentRequest(); $request->setPrivateKey($this->getPrivateKey()); diff --git a/app/Services/Bunq/Object/LabelMonetaryAccount.php b/app/Services/Bunq/Object/LabelMonetaryAccount.php index 2e6198530c..7bc61a4442 100644 --- a/app/Services/Bunq/Object/LabelMonetaryAccount.php +++ b/app/Services/Bunq/Object/LabelMonetaryAccount.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; use FireflyIII\Exceptions\FireflyException; + /** * Class LabelMonetaryAccount */ @@ -49,15 +50,15 @@ class LabelMonetaryAccount extends BunqObject { $this->iban = $data['iban']; $this->isLight = $data['is_light']; - $this->avatar = new Avatar($data['avatar']); + $this->avatar = isset($data['avatar']) ? new Avatar($data['avatar']) : null; $this->labelUser = new LabelUser($data['label_user']); $this->country = $data['country']; } /** - * @return string + * @return string|null */ - public function getIban(): string + public function getIban(): ?string { return $this->iban; } diff --git a/app/Services/Bunq/Object/LabelUser.php b/app/Services/Bunq/Object/LabelUser.php index d7820f9eb5..a2b1f8cb39 100644 --- a/app/Services/Bunq/Object/LabelUser.php +++ b/app/Services/Bunq/Object/LabelUser.php @@ -51,7 +51,7 @@ class LabelUser extends BunqObject $this->displayName = $data['display_name']; $this->country = $data['country']; $this->publicNickName = $data['public_nick_name']; - $this->avatar = new Avatar($data['avatar']); + $this->avatar = isset($data['avatar']) ? new Avatar($data['avatar']) : null; } /** diff --git a/app/Services/Bunq/Object/MonetaryAccountBank.php b/app/Services/Bunq/Object/MonetaryAccountBank.php index 18264af185..86a0d738a7 100644 --- a/app/Services/Bunq/Object/MonetaryAccountBank.php +++ b/app/Services/Bunq/Object/MonetaryAccountBank.php @@ -93,7 +93,7 @@ class MonetaryAccountBank extends BunqObject $this->monetaryAccountProfile = new MonetaryAccountProfile($data['monetary_account_profile']); $this->setting = new MonetaryAccountSetting($data['setting']); $this->overdraftLimit = new Amount($data['overdraft_limit']); - $this->avatar = new Avatar($data['avatar']); + $this->avatar = isset($data['avatar']) ? new Avatar($data['avatar']) : null; $this->reason = $data['reason'] ?? ''; $this->reasonDescription = $data['reason_description'] ?? ''; @@ -176,7 +176,7 @@ class MonetaryAccountBank extends BunqObject 'monetary_account_profile' => $this->monetaryAccountProfile->toArray(), 'setting' => $this->setting->toArray(), 'overdraft_limit' => $this->overdraftLimit->toArray(), - 'avatar' => $this->avatar->toArray(), + 'avatar' => null === $this->avatar ? null : $this->avatar->toArray()->toArray(), 'reason' => $this->reason, 'reason_description' => $this->reasonDescription, 'alias' => [],