@@ 5-53 (lines=49) @@ | ||
2 | ||
3 | namespace Tgallice\FBMessenger\Model\Attachment\Template\Receipt; |
|
4 | ||
5 | class Adjustment implements \JsonSerializable |
|
6 | { |
|
7 | /** |
|
8 | * @var null|string |
|
9 | */ |
|
10 | private $name; |
|
11 | ||
12 | /** |
|
13 | * @var null|int |
|
14 | */ |
|
15 | private $amount; |
|
16 | ||
17 | /** |
|
18 | * @param null|string $name |
|
19 | * @param null|int $amount |
|
20 | */ |
|
21 | public function __construct($name = null, $amount = null) |
|
22 | { |
|
23 | $this->name = $name; |
|
24 | $this->amount = $amount; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * @return null|string |
|
29 | */ |
|
30 | public function getName() |
|
31 | { |
|
32 | return $this->name; |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * @return null|int |
|
37 | */ |
|
38 | public function getAmount() |
|
39 | { |
|
40 | return $this->amount; |
|
41 | } |
|
42 | ||
43 | /** |
|
44 | * @return array |
|
45 | */ |
|
46 | public function jsonSerialize() |
|
47 | { |
|
48 | return [ |
|
49 | 'name' => $this->name, |
|
50 | 'amount' => $this->amount, |
|
51 | ]; |
|
52 | } |
|
53 | } |
|
54 |
@@ 5-53 (lines=49) @@ | ||
2 | ||
3 | namespace Tgallice\FBMessenger\Model\Button\Payment; |
|
4 | ||
5 | class PriceItem implements \JsonSerializable |
|
6 | { |
|
7 | /** |
|
8 | * @var string |
|
9 | */ |
|
10 | private $label; |
|
11 | ||
12 | /** |
|
13 | * @var float|int |
|
14 | */ |
|
15 | private $amount; |
|
16 | ||
17 | /** |
|
18 | * @param string $label |
|
19 | * @param float|int $amount |
|
20 | */ |
|
21 | public function __construct($label, $amount) |
|
22 | { |
|
23 | $this->label = $label; |
|
24 | $this->amount = $amount; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * @return string |
|
29 | */ |
|
30 | public function getLabel() |
|
31 | { |
|
32 | return $this->label; |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * @return float|int |
|
37 | */ |
|
38 | public function getAmount() |
|
39 | { |
|
40 | return $this->amount; |
|
41 | } |
|
42 | ||
43 | /** |
|
44 | * @inheritdoc |
|
45 | */ |
|
46 | public function jsonSerialize() |
|
47 | { |
|
48 | return [ |
|
49 | 'label' => $this->label, |
|
50 | 'amount' => $this->amount, |
|
51 | ]; |
|
52 | } |
|
53 | } |
|
54 |