Skip to content

Commit dfeb822

Browse files
committed
change
1 parent da86587 commit dfeb822

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/sale/Sale.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use hiqdev\php\billing\Exception\InvariantException;
1818
use hiqdev\php\billing\plan\PlanInterface;
1919
use hiqdev\php\billing\target\TargetInterface;
20+
use yii\helpers\Json;
2021

2122
/**
2223
* Sale.
@@ -129,9 +130,9 @@ public function setId($id)
129130
$this->id = $id;
130131
}
131132

132-
public function getData(): ?string
133+
public function getData(): ?array
133134
{
134-
return $this->data;
135+
return !empty($this->data) ? Json::decode($this->data, true) : null;
135136
}
136137

137138
public function jsonSerialize(): array

src/sale/SaleCreationDto.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ class SaleCreationDto
2828
public $closeTime;
2929

3030
public $data;
31+
32+
public $reason;
3133
}

src/sale/SaleInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function getTime();
6262
public function getCloseTime(): ?DateTimeImmutable;
6363

6464
/**
65-
* @return string|null
65+
* @return array|null
6666
*/
67-
public function getData(): ?string;
67+
public function getData(): ?array;
6868

6969
/**
7070
* @param DateTimeImmutable $time

0 commit comments

Comments
 (0)