From b5e2e0d6d1703eb2a025994229f951e3b75ebad5 Mon Sep 17 00:00:00 2001 From: CyberVitexus Date: Mon, 4 Nov 2024 02:08:16 +0100 Subject: [PATCH] import scope boundaries fix api response parser fix --- src/Pohoda/RaiffeisenBank/PohodaBankClient.php | 6 +++--- src/Pohoda/RaiffeisenBank/Transactor.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Pohoda/RaiffeisenBank/PohodaBankClient.php b/src/Pohoda/RaiffeisenBank/PohodaBankClient.php index 375590f..6693550 100644 --- a/src/Pohoda/RaiffeisenBank/PohodaBankClient.php +++ b/src/Pohoda/RaiffeisenBank/PohodaBankClient.php @@ -165,7 +165,7 @@ public function setScope($scope): void if ($scope !== 'auto' && $scope !== 'today' && $scope !== 'yesterday') { $this->since = $this->since->setTime(0, 0); - $this->until = $this->until->setTime(0, 0); + $this->until = $this->until->setTime(23, 59); } } @@ -233,14 +233,14 @@ public function insertTransactionToPohoda($success) ++$success; } - if (property_exists($this->response, 'producedDetails') && \is_array($this->response->producedDetails)) { + if (isset($this->response->producedDetails) && \is_array($this->response->producedDetails)) { $producedId = $this->response->producedDetails['id']; $producedNumber = $this->response->producedDetails['number']; $producedAction = $this->response->producedDetails['actionType']; } else { echo ''; } - } catch (\Pohoda\Exception $exc) { + } catch (\Exception $exc) { $producedId = 'n/a'; $producedNumber = 'n/a'; $producedAction = 'n/a'; diff --git a/src/Pohoda/RaiffeisenBank/Transactor.php b/src/Pohoda/RaiffeisenBank/Transactor.php index fb3f58d..da7ee72 100644 --- a/src/Pohoda/RaiffeisenBank/Transactor.php +++ b/src/Pohoda/RaiffeisenBank/Transactor.php @@ -59,8 +59,9 @@ public function getTransactions() $transactions = array_merge($transactions, $result['transactions']); } } while ($result['lastPage'] === false); - } catch (Exception $e) { + } catch (\VitexSoftware\Raiffeisenbank\ApiException $e) { echo 'Exception when calling GetTransactionListApi->getTransactionList: ', $e->getMessage(), \PHP_EOL; + exit($e->getCode()); } return $transactions;