1 | <?php |
||
9 | class Transaction |
||
10 | { |
||
11 | /** |
||
12 | * @var string The transaction ID. (e.g. 1234) Required |
||
13 | */ |
||
14 | protected $id; |
||
15 | |||
16 | /** |
||
17 | * @var string The store or affiliation from which this transaction occurred (e.g. Acme Clothing). |
||
18 | */ |
||
19 | protected $affiliation; |
||
20 | |||
21 | /** |
||
22 | * @var float Specifies the total revenue or grand total associated with the transaction (e.g. 11.99). |
||
23 | */ |
||
24 | protected $revenue; |
||
25 | |||
26 | /** |
||
27 | * @var float Specifies the total shipping cost of the transaction. (e.g. 5) |
||
28 | */ |
||
29 | protected $shipping; |
||
30 | |||
31 | /** |
||
32 | * @var float Specifies the total tax of the transaction. (e.g. 1.29) |
||
33 | */ |
||
34 | protected $tax; |
||
35 | |||
36 | /** |
||
37 | * @var string The local currency must be specified in the ISO 4217 standard. |
||
38 | */ |
||
39 | protected $currency; |
||
40 | |||
41 | /** |
||
42 | * @var Item[] |
||
43 | */ |
||
44 | protected $items = []; |
||
45 | |||
46 | /** |
||
47 | * @param $params |
||
48 | * @return static |
||
49 | */ |
||
50 | 2 | public static function createFromArray($params) |
|
56 | |||
57 | /** |
||
58 | * @param $params |
||
59 | */ |
||
60 | 2 | public function populateFromParams($params) |
|
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | 2 | public function getId() |
|
76 | |||
77 | /** |
||
78 | * @param string $id |
||
79 | */ |
||
80 | public function setId(string $id) |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | 2 | public function getAffiliation() |
|
92 | |||
93 | /** |
||
94 | * @param string $affiliation |
||
95 | */ |
||
96 | public function setAffiliation(string $affiliation) |
||
100 | |||
101 | /** |
||
102 | * @return float |
||
103 | */ |
||
104 | 2 | public function getRevenue() |
|
108 | |||
109 | /** |
||
110 | * @param float $revenue |
||
111 | */ |
||
112 | public function setRevenue(float $revenue) |
||
116 | |||
117 | /** |
||
118 | * @return float |
||
119 | */ |
||
120 | 2 | public function getShipping() |
|
124 | |||
125 | /** |
||
126 | * @param float $shipping |
||
127 | */ |
||
128 | public function setShipping(float $shipping) |
||
132 | |||
133 | /** |
||
134 | * @return float |
||
135 | */ |
||
136 | 2 | public function getTax() |
|
140 | |||
141 | /** |
||
142 | * @param float $tax |
||
143 | */ |
||
144 | public function setTax(float $tax) |
||
148 | |||
149 | /** |
||
150 | * @return string |
||
151 | */ |
||
152 | 2 | public function getCurrency() |
|
156 | |||
157 | /** |
||
158 | * @param string $currency |
||
159 | */ |
||
160 | public function setCurrency(string $currency) |
||
164 | |||
165 | /** |
||
166 | * @return Item[] |
||
167 | */ |
||
168 | public function getItems(): array |
||
172 | |||
173 | /** |
||
174 | * @param Item $item |
||
175 | */ |
||
176 | public function addItem(Item $item) |
||
185 | } |
||
186 |