Skip to content

Commit e03e462

Browse files
authored
Merge pull request #5 from apility/dev
Adds missing fields for TransactionLog and fixed serialzation
2 parents 5134c6b + 8d446a9 commit e03e462

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Ecommerce/TransactionLog.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @property string $transactionText
1212
* @property string $timeStamp
1313
* @property string $operation
14+
* @property string $requestId
1415
* @property bool $operationSuccess
1516
*/
1617
class TransactionLog extends Model
@@ -21,9 +22,11 @@ class TransactionLog extends Model
2122
protected $fields = [
2223
'amount',
2324
'transactionText',
25+
'transactionId',
2426
'timeStamp',
2527
'operation',
26-
'operationSuccess'
28+
'requestId',
29+
'operationSuccess',
2730
];
2831

2932
/** @var array */
@@ -36,6 +39,6 @@ class TransactionLog extends Model
3639
*/
3740
public function getOperationSuccess(): bool
3841
{
39-
return boolval($this->_operationSuccess);
42+
return boolval($this->attributes['operationSuccess']);
4043
}
4144
}

src/Model.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public static function create(array $attributes = [], $immuteable = false)
6262
*/
6363
public function jsonSerialize(): array
6464
{
65-
$model = array_filter($this->__debugInfo());
65+
$model = array_filter($this->__debugInfo(), function ($value) {
66+
return !is_null($value);
67+
});
6668

6769
foreach ($this->rawValues as $key) {
6870
$model[$key] = $this->attributes[$key] ?? null;

0 commit comments

Comments
 (0)