diff --git a/src/FioApi/Transaction.php b/src/FioApi/Transaction.php index 261d8e2..7abe1e1 100644 --- a/src/FioApi/Transaction.php +++ b/src/FioApi/Transaction.php @@ -51,6 +51,9 @@ class Transaction /** @var string */ protected $paymentOrderId; + /** @var string */ + protected $specification; + protected function __construct( $id, $date, @@ -67,7 +70,8 @@ protected function __construct( $transactionType, $performedBy, $comment, - $paymentOrderId + $paymentOrderId, + $specification ) { $this->id = $id; $this->date = $date; @@ -85,6 +89,7 @@ protected function __construct( $this->performedBy = $performedBy; $this->comment = $comment; $this->paymentOrderId = $paymentOrderId; + $this->specification = $specification; } /** @@ -109,7 +114,8 @@ public static function create(\stdClass $data) $data->column8->value, //Typ !empty($data->column9) ? $data->column9->value : null, //Provedl !empty($data->column25) ? $data->column25->value : null, //Komentář - !empty($data->column17) ? $data->column17->value : null //ID pokynu + !empty($data->column17) ? $data->column17->value : null, //ID pokynu + !empty($data->column18) ? $data->column18->value : null //Upřesnění ); } @@ -240,4 +246,12 @@ public function getPaymentOrderId() { return $this->paymentOrderId; } + + /** + * @return string + */ + public function getSpecification() + { + return $this->specification; + } } diff --git a/tests/FioApi/TransactionTest.php b/tests/FioApi/TransactionTest.php index ef801ee..c4c5b46 100644 --- a/tests/FioApi/TransactionTest.php +++ b/tests/FioApi/TransactionTest.php @@ -26,5 +26,6 @@ public function testAccountValuesAreProperlySet() $this->assertSame(null, $transaction->getPerformedBy()); $this->assertSame('Comment? Comment!', $transaction->getComment()); $this->assertSame(1111122222, $transaction->getPaymentOrderId()); + $this->assertSame('1500.00 EUR', $transaction->getSpecification()); } } diff --git a/tests/FioApi/data/example-transaction.json b/tests/FioApi/data/example-transaction.json index 45ac2f2..a9ca176 100644 --- a/tests/FioApi/data/example-transaction.json +++ b/tests/FioApi/data/example-transaction.json @@ -58,7 +58,11 @@ "id": 8 }, "column9": null, - "column18": null, + "column18": { + "value": "1500.00 EUR", + "name": "Upřesnění", + "id": 18 + }, "column25": { "value": "Comment? Comment!", "name": "Komentář",