Skip to content

Commit

Permalink
Added missing "specification" field
Browse files Browse the repository at this point in the history
  • Loading branch information
soukicz committed Mar 12, 2016
1 parent f1cfce5 commit 1b1a568
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/FioApi/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class Transaction
/** @var string */
protected $paymentOrderId;

/** @var string */
protected $specification;

protected function __construct(
$id,
$date,
Expand All @@ -67,7 +70,8 @@ protected function __construct(
$transactionType,
$performedBy,
$comment,
$paymentOrderId
$paymentOrderId,
$specification
) {
$this->id = $id;
$this->date = $date;
Expand All @@ -85,6 +89,7 @@ protected function __construct(
$this->performedBy = $performedBy;
$this->comment = $comment;
$this->paymentOrderId = $paymentOrderId;
$this->specification = $specification;
}

/**
Expand All @@ -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í
);
}

Expand Down Expand Up @@ -240,4 +246,12 @@ public function getPaymentOrderId()
{
return $this->paymentOrderId;
}

/**
* @return string
*/
public function getSpecification()
{
return $this->specification;
}
}
1 change: 1 addition & 0 deletions tests/FioApi/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
6 changes: 5 additions & 1 deletion tests/FioApi/data/example-transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -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ář",
Expand Down

0 comments on commit 1b1a568

Please # to comment.