diff --git a/src/Account.php b/src/Account.php index c591094..aa1ea30 100644 --- a/src/Account.php +++ b/src/Account.php @@ -34,9 +34,9 @@ public function getAccountHolderName(): string public function toArray(): array { return [ - 'bankCode' => $this->getBankCode()->getString(), - 'accountNumber' => $this->getAccountNumber(), - 'accountHolderName' => $this->getAccountHolderName(), + 'bankCode' => $this->bankCode->getString(), + 'accountNumber' => $this->accountNumber, + 'accountHolderName' => $this->accountHolderName, ]; } } diff --git a/src/Balance.php b/src/Balance.php index fb15c3f..7d47cba 100644 --- a/src/Balance.php +++ b/src/Balance.php @@ -35,13 +35,13 @@ public function getValue(): Money public function toArray(): array { return [ - 'type' => $this->getType(), + 'type' => $this->type, 'value' => [ - 'amount' => $this->getValue()->getAmount(), + 'amount' => $this->value->getAmount(), + 'currency' => $this->value->getCurrency()->getCode(), 'priceUnit' => 100, - 'currency' => $this->getValue()->getCurrency()->getCode(), ], - 'date' => $this->getDate()->format('Y-m-d'), + 'date' => $this->date->format('Y-m-d'), ]; } } diff --git a/src/Transaction.php b/src/Transaction.php index 7e36f16..61101a3 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -73,19 +73,19 @@ public function getType(): string public function toArray(): array { return [ - 'date' => $this->getDate()->format('Y-m-d'), - 'localAccount' => $this->getLocalAccount()->toArray(), - 'purpose' => $this->getPurpose(), - 'remoteAccount' => $this->getRemoteAccount()->toArray(), - 'type' => $this->getType(), + 'date' => $this->date->format('Y-m-d'), + 'localAccount' => $this->localAccount->toArray(), + 'purpose' => $this->purpose, + 'remoteAccount' => $this->remoteAccount->toArray(), + 'type' => $this->type, 'value' => [ - 'amount' => $this->getValue()->getAmount(), - 'currency' => $this->getValue()->getCurrency()->getCode(), + 'amount' => $this->value->getAmount(), + 'currency' => $this->value->getCurrency()->getCode(), 'priceUnit' => 100, ], - 'valutaDate' => $this->getValutaDate() ? $this->getValutaDate()->format('Y-m-d') : null, - 'primaNota' => $this->getPrimaNota(), - 'customerReference' => $this->getCustomerReference(), + 'valutaDate' => $this->valutaDate?->format('Y-m-d'), + 'primaNota' => $this->primaNota, + 'customerReference' => $this->customerReference, ]; } } diff --git a/tests/BalanceTest.php b/tests/BalanceTest.php index 6cc3f0f..2291949 100644 --- a/tests/BalanceTest.php +++ b/tests/BalanceTest.php @@ -31,8 +31,8 @@ public function testBalance(): void 'type' => 'noted', 'value' => [ 'amount' => '10', - 'priceUnit' => 100, 'currency' => 'EUR', + 'priceUnit' => 100, ], 'date' => $date->format('Y-m-d'), ], $sut->toArray());