1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CultureKings\Afterpay\Model; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class OrderDetails |
7
|
|
|
* |
8
|
|
|
* @package CultureKings\Afterpay\Model |
9
|
|
|
*/ |
10
|
|
|
class OrderDetails |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var Consumer |
14
|
|
|
*/ |
15
|
|
|
protected $consumer; |
16
|
|
|
/** |
17
|
|
|
* @var Contact |
18
|
|
|
*/ |
19
|
|
|
protected $billing; |
20
|
|
|
/** |
21
|
|
|
* @var Contact |
22
|
|
|
*/ |
23
|
|
|
protected $shipping; |
24
|
|
|
/** |
25
|
|
|
* @var ShippingCourier |
26
|
|
|
*/ |
27
|
|
|
protected $courier; |
28
|
|
|
/** |
29
|
|
|
* @var Item[] |
30
|
|
|
*/ |
31
|
|
|
protected $items = array(); |
32
|
|
|
/** |
33
|
|
|
* @var Discount[] |
34
|
|
|
*/ |
35
|
|
|
protected $discounts = array(); |
36
|
|
|
/** |
37
|
|
|
* @var Money |
38
|
|
|
*/ |
39
|
|
|
protected $totalAmount; |
40
|
|
|
/** |
41
|
|
|
* @var Money |
42
|
|
|
*/ |
43
|
|
|
protected $taxAmount; |
44
|
|
|
/** |
45
|
|
|
* @var Money |
46
|
|
|
*/ |
47
|
|
|
protected $shippingAmount; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var MerchantOptions |
51
|
|
|
*/ |
52
|
|
|
protected $merchant; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
protected $paymentType; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var string |
61
|
|
|
*/ |
62
|
|
|
protected $merchantReference; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return Consumer |
66
|
|
|
*/ |
67
|
|
|
public function getConsumer() |
68
|
|
|
{ |
69
|
|
|
return $this->consumer; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @return Contact |
74
|
|
|
*/ |
75
|
|
|
public function getBilling() |
76
|
|
|
{ |
77
|
|
|
return $this->billing; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return Contact |
82
|
|
|
*/ |
83
|
|
|
public function getShipping() |
84
|
|
|
{ |
85
|
|
|
return $this->shipping; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return ShippingCourier |
90
|
|
|
*/ |
91
|
|
|
public function getCourier() |
92
|
|
|
{ |
93
|
|
|
return $this->courier; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return Item[] |
98
|
|
|
*/ |
99
|
|
|
public function getItems() |
100
|
|
|
{ |
101
|
|
|
return $this->items; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @return Discount[] |
106
|
|
|
*/ |
107
|
|
|
public function getDiscounts() |
108
|
|
|
{ |
109
|
|
|
return $this->discounts; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @return Money |
114
|
|
|
*/ |
115
|
|
|
public function getTotalAmount() |
116
|
|
|
{ |
117
|
|
|
return $this->totalAmount; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param Money $totalAmount |
122
|
|
|
* @return $this |
123
|
|
|
*/ |
124
|
|
|
public function setTotalAmount($totalAmount) |
125
|
|
|
{ |
126
|
|
|
$this->totalAmount = $totalAmount; |
127
|
|
|
|
128
|
|
|
return $this; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return Money |
133
|
|
|
*/ |
134
|
|
|
public function getTaxAmount() |
135
|
|
|
{ |
136
|
|
|
return $this->taxAmount; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @return Money |
141
|
|
|
*/ |
142
|
|
|
public function getShippingAmount() |
143
|
|
|
{ |
144
|
|
|
return $this->shippingAmount; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @return string |
149
|
|
|
*/ |
150
|
|
|
public function getMerchantReference() |
151
|
|
|
{ |
152
|
|
|
return $this->merchantReference; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @param Consumer $consumer |
157
|
|
|
* @return $this |
158
|
|
|
*/ |
159
|
|
|
public function setConsumer(Consumer $consumer) |
160
|
|
|
{ |
161
|
|
|
$this->consumer = $consumer; |
162
|
|
|
|
163
|
|
|
return $this; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @param Contact $billing |
168
|
|
|
* @return $this |
169
|
|
|
*/ |
170
|
|
|
public function setBilling(Contact $billing) |
171
|
|
|
{ |
172
|
|
|
$this->billing = $billing; |
173
|
|
|
|
174
|
|
|
return $this; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @param Contact $shipping |
179
|
|
|
* @return $this |
180
|
|
|
*/ |
181
|
|
|
public function setShipping(Contact $shipping) |
182
|
|
|
{ |
183
|
|
|
$this->shipping = $shipping; |
184
|
|
|
|
185
|
|
|
return $this; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @param ShippingCourier $courier |
190
|
|
|
* @return $this |
191
|
|
|
*/ |
192
|
|
|
public function setCourier(ShippingCourier $courier) |
193
|
|
|
{ |
194
|
|
|
$this->courier = $courier; |
195
|
|
|
|
196
|
|
|
return $this; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @param Item[] $items |
201
|
|
|
* @return $this |
202
|
|
|
*/ |
203
|
|
|
public function setItems(array $items) |
204
|
|
|
{ |
205
|
|
|
$this->items = $items; |
206
|
|
|
|
207
|
|
|
return $this; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* @param Discount[] $discounts |
212
|
|
|
* @return $this |
213
|
|
|
*/ |
214
|
|
|
public function setDiscounts(array $discounts) |
215
|
|
|
{ |
216
|
|
|
$this->discounts = $discounts; |
217
|
|
|
|
218
|
|
|
return $this; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* @param Money $taxAmount |
223
|
|
|
* @return $this |
224
|
|
|
*/ |
225
|
|
|
public function setTaxAmount(Money $taxAmount) |
226
|
|
|
{ |
227
|
|
|
$this->taxAmount = $taxAmount; |
228
|
|
|
|
229
|
|
|
return $this; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @param Money $shippingAmount |
234
|
|
|
* @return $this |
235
|
|
|
*/ |
236
|
|
|
public function setShippingAmount(Money $shippingAmount) |
237
|
|
|
{ |
238
|
|
|
$this->shippingAmount = $shippingAmount; |
239
|
|
|
|
240
|
|
|
return $this; |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @return MerchantOptions |
245
|
|
|
*/ |
246
|
|
|
public function getMerchant() |
247
|
|
|
{ |
248
|
|
|
return $this->merchant; |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @param MerchantOptions $merchant |
253
|
|
|
* @return $this |
254
|
|
|
*/ |
255
|
|
|
public function setMerchant(MerchantOptions $merchant) |
256
|
|
|
{ |
257
|
|
|
$this->merchant = $merchant; |
258
|
|
|
|
259
|
|
|
return $this; |
260
|
|
|
} |
261
|
|
|
|
262
|
|
|
/** |
263
|
|
|
* @return string |
264
|
|
|
*/ |
265
|
|
|
public function getPaymentType() |
266
|
|
|
{ |
267
|
|
|
return $this->paymentType; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @param string $paymentType |
272
|
|
|
* @return $this |
273
|
|
|
*/ |
274
|
|
|
public function setPaymentType($paymentType) |
275
|
|
|
{ |
276
|
|
|
$this->paymentType = $paymentType; |
277
|
|
|
|
278
|
|
|
return $this; |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
/** |
282
|
|
|
* @param string $merchantReference |
283
|
|
|
* @return $this |
284
|
|
|
*/ |
285
|
|
|
public function setMerchantReference($merchantReference) |
286
|
|
|
{ |
287
|
|
|
$this->merchantReference = $merchantReference; |
288
|
|
|
|
289
|
|
|
return $this; |
290
|
|
|
} |
291
|
|
|
} |
292
|
|
|
|