-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshippingoption.php
More file actions
52 lines (42 loc) · 910 Bytes
/
shippingoption.php
File metadata and controls
52 lines (42 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace SuperUserDev\PaymentAPI;
class ShippingOption extends DisplayItem
{
private $_id = '';
private $_selected = false;
public function __construct(
String $id,
String $label,
Amount $amount,
Bool $pending = true,
Bool $selected = false
)
{
parent::__construct($label, $amount, $pending);
$this->setId($id);
$this->setSelected($selected);
}
public function jsonSerialize(): Array
{
$data = parent::jsonSerialize();
$data['id'] = $this->getId();
$data['selected'] = $this->getSelected();
return $data;
}
public function setId(String $id): Void
{
$this->_id = $id;
}
public function getId(): String
{
return $this->_id;
}
public function setSelected(Bool $selected = true): Void
{
$this->_selected = $selected;
}
public function getSelected(): Bool
{
return $this->_selected;
}
}