PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Domain / Entity / Payment / Payment.php
ameliabooking / src / Domain / Entity / Payment Last commit date
Payment.php 1 year ago PaymentGateway.php 7 years ago
Payment.php
525 lines
1 <?php
2 /**
3 * @copyright © TMS-Plugins. All rights reserved.
4 * @licence See LICENCE.md for license details.
5 */
6
7 namespace AmeliaBooking\Domain\Entity\Payment;
8
9 use AmeliaBooking\Domain\ValueObjects\BooleanValueObject;
10 use AmeliaBooking\Domain\ValueObjects\DateTime\DateTimeValue;
11 use AmeliaBooking\Domain\ValueObjects\Json;
12 use AmeliaBooking\Domain\ValueObjects\Number\Float\Price;
13 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
14 use AmeliaBooking\Domain\ValueObjects\String\Name;
15 use AmeliaBooking\Domain\ValueObjects\String\PaymentStatus;
16 use AmeliaBooking\Domain\ValueObjects\String\PaymentData;
17 use AmeliaBooking\Domain\ValueObjects\String\Url;
18
19 /**
20 * Class Payment
21 *
22 * @package AmeliaBooking\Domain\Entity\Payment
23 */
24 class Payment
25 {
26 /** @var Id */
27 private $id;
28
29 /** @var Id */
30 private $customerBookingId;
31
32 /** @var Id */
33 private $packageCustomerId;
34
35 /** @var Id */
36 private $parentId;
37
38 /** @var Id */
39 private $invoiceNumber;
40
41 /** @var Price */
42 private $amount;
43
44 /** @var DateTimeValue */
45 private $dateTime;
46
47 /** @var PaymentStatus */
48 private $status;
49
50 /** @var PaymentGateway */
51 private $gateway;
52
53 /** @var Name */
54 private $gatewayTitle;
55
56 /** @var PaymentData */
57 private $data;
58
59 /** @var DateTimeValue */
60 private $created;
61
62 /** @var Name */
63 private $entity;
64
65 /** @var BooleanValueObject */
66 private $actionsCompleted;
67
68 /** @var BooleanValueObject */
69 private $triggeredActions;
70
71 /** @var Id */
72 private $wcOrderId;
73
74 /** @var Id */
75 private $wcOrderItemId;
76
77 /** @var Url */
78 private $wcOrderUrl;
79
80 /** @var Price */
81 private $wcItemCouponValue;
82
83 /** @var Price */
84 private $wcItemTaxValue;
85
86 /** @var string */
87 private $transactionId;
88
89 /** @var Json */
90 private $transfers;
91
92 /** @var array */
93 private $paymentLinks;
94
95 /**
96 * Payment constructor.
97 *
98 * @param Price $amount
99 * @param DateTimeValue $dateTime
100 * @param PaymentStatus $status
101 * @param PaymentGateway $gateway
102 * @param PaymentData $data
103 */
104 public function __construct(
105 Price $amount,
106 DateTimeValue $dateTime,
107 PaymentStatus $status,
108 PaymentGateway $gateway,
109 PaymentData $data
110 ) {
111 $this->amount = $amount;
112
113 $this->dateTime = $dateTime;
114
115 $this->status = $status;
116
117 $this->gateway = $gateway;
118
119 $this->data = $data;
120 }
121
122 /**
123 * @return Id
124 */
125 public function getId()
126 {
127 return $this->id;
128 }
129
130 /**
131 * @param Id $id
132 */
133 public function setId($id)
134 {
135 $this->id = $id;
136 }
137
138 /**
139 * @return Id
140 */
141 public function getCustomerBookingId()
142 {
143 return $this->customerBookingId;
144 }
145
146 /**
147 * @param Id $customerBookingId
148 */
149 public function setCustomerBookingId($customerBookingId)
150 {
151 $this->customerBookingId = $customerBookingId;
152 }
153
154 /**
155 * @return Id
156 */
157 public function getPackageCustomerId()
158 {
159 return $this->packageCustomerId;
160 }
161
162 /**
163 * @param Id $packageCustomerId
164 */
165 public function setPackageCustomerId($packageCustomerId)
166 {
167 $this->packageCustomerId = $packageCustomerId;
168 }
169
170 /**
171 * @return Id
172 */
173 public function getParentId()
174 {
175 return $this->parentId;
176 }
177
178 /**
179 * @param Id $parentId
180 */
181 public function setParentId($parentId)
182 {
183 $this->parentId = $parentId;
184 }
185
186 /**
187 * @return Id
188 */
189 public function getInvoiceNumber()
190 {
191 return $this->invoiceNumber;
192 }
193
194 /**
195 * @param Id $invoiceNumber
196 */
197 public function setInvoiceNumber($invoiceNumber)
198 {
199 $this->invoiceNumber = $invoiceNumber;
200 }
201
202
203 /**
204 * @return Price
205 */
206 public function getAmount()
207 {
208 return $this->amount;
209 }
210
211 /**
212 * @param Price $amount
213 */
214 public function setAmount($amount)
215 {
216 $this->amount = $amount;
217 }
218
219 /**
220 * @return DateTimeValue
221 */
222 public function getDateTime()
223 {
224 return $this->dateTime;
225 }
226
227 /**
228 * @param DateTimeValue $dateTime
229 */
230 public function setDateTime($dateTime)
231 {
232 $this->dateTime = $dateTime;
233 }
234
235 /**
236 * @return PaymentStatus
237 */
238 public function getStatus()
239 {
240 return $this->status;
241 }
242
243 /**
244 * @param PaymentStatus $status
245 */
246 public function setStatus($status)
247 {
248 $this->status = $status;
249 }
250
251 /**
252 * @return PaymentGateway
253 */
254 public function getGateway()
255 {
256 return $this->gateway;
257 }
258
259 /**
260 * @param PaymentGateway $gateway
261 */
262 public function setGateway($gateway)
263 {
264 $this->gateway = $gateway;
265 }
266
267 /**
268 * @return Name
269 */
270 public function getGatewayTitle()
271 {
272 return $this->gatewayTitle;
273 }
274
275 /**
276 * @param Name $gatewayTitle
277 */
278 public function setGatewayTitle($gatewayTitle)
279 {
280 $this->gatewayTitle = $gatewayTitle;
281 }
282
283 /**
284 * @return PaymentData
285 */
286 public function getData()
287 {
288 return $this->data;
289 }
290
291 /**
292 * @param PaymentData $data
293 */
294 public function setData($data)
295 {
296 $this->data = $data;
297 }
298
299 /**
300 * @return DateTimeValue
301 */
302 public function getCreated()
303 {
304 return $this->created;
305 }
306
307 /**
308 * @param DateTimeValue $created
309 */
310 public function setCreated($created)
311 {
312 $this->created = $created;
313 }
314
315 /**
316 * @return Name
317 */
318 public function getEntity()
319 {
320 return $this->entity;
321 }
322
323 /**
324 * @param Name $entity
325 */
326 public function setEntity($entity)
327 {
328 $this->entity = $entity;
329 }
330
331 /**
332 * @return BooleanValueObject
333 */
334 public function getActionsCompleted()
335 {
336 return $this->actionsCompleted;
337 }
338
339 /**
340 * @param BooleanValueObject $actionsCompleted
341 */
342 public function setActionsCompleted($actionsCompleted)
343 {
344 $this->actionsCompleted = $actionsCompleted;
345 }
346
347 /**
348 * @return BooleanValueObject
349 */
350 public function getTriggeredActions()
351 {
352 return $this->triggeredActions;
353 }
354
355 /**
356 * @param BooleanValueObject $triggeredActions
357 */
358 public function setTriggeredActions($triggeredActions)
359 {
360 $this->triggeredActions = $triggeredActions;
361 }
362
363 /**
364 * @return Id
365 */
366 public function getWcOrderId()
367 {
368 return $this->wcOrderId;
369 }
370
371 /**
372 * @param Id $wcOrderId
373 */
374 public function setWcOrderId($wcOrderId)
375 {
376 $this->wcOrderId = $wcOrderId;
377 }
378
379 /**
380 * @return Id
381 */
382 public function getWcOrderItemId()
383 {
384 return $this->wcOrderItemId;
385 }
386
387 /**
388 * @param Id $wcOrderItemId
389 */
390 public function setWcOrderItemId($wcOrderItemId)
391 {
392 $this->wcOrderItemId = $wcOrderItemId;
393 }
394
395 /**
396 * @return Url
397 */
398 public function getWcOrderUrl()
399 {
400 return $this->wcOrderUrl;
401 }
402
403 /**
404 * @param Url $wcOrderUrl
405 */
406 public function setWcOrderUrl($wcOrderUrl)
407 {
408 $this->wcOrderUrl = $wcOrderUrl;
409 }
410
411 /**
412 * @return Price
413 */
414 public function getWcItemCouponValue()
415 {
416 return $this->wcItemCouponValue;
417 }
418
419 /**
420 * @param Price $wcItemCouponValue
421 */
422 public function setWcItemCouponValue($wcItemCouponValue)
423 {
424 $this->wcItemCouponValue = $wcItemCouponValue;
425 }
426
427 /**
428 * @return Price
429 */
430 public function getWcItemTaxValue()
431 {
432 return $this->wcItemTaxValue;
433 }
434
435 /**
436 * @param Price $wcItemTaxValue
437 */
438 public function setWcItemTaxValue($wcItemTaxValue)
439 {
440 $this->wcItemTaxValue = $wcItemTaxValue;
441 }
442
443
444 /**
445 * @return string|null
446 */
447 public function getTransactionId()
448 {
449 return $this->transactionId;
450 }
451
452 /**
453 * @param string|null $transactionId
454 */
455 public function setTransactionId($transactionId)
456 {
457 $this->transactionId = $transactionId;
458 }
459
460 /**
461 * @return Json
462 */
463 public function getTransfers()
464 {
465 return $this->transfers;
466 }
467
468 /**
469 * @param Json $transfers
470 */
471 public function setTransfers($transfers)
472 {
473 $this->transfers = $transfers;
474 }
475
476 /**
477 * @return array
478 */
479 public function getPaymentLinks()
480 {
481 return $this->paymentLinks;
482 }
483
484 /**
485 * @param array $paymentLinks
486 */
487 public function setPaymentLinks($paymentLinks)
488 {
489 $this->paymentLinks = $paymentLinks;
490 }
491
492
493 /**
494 * @return array
495 */
496 public function toArray()
497 {
498 return [
499 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
500 'customerBookingId' => $this->customerBookingId ? $this->customerBookingId->getValue() : null,
501 'packageCustomerId' => $this->packageCustomerId ? $this->packageCustomerId->getValue() : null,
502 'parentId' => $this->getParentId() ? $this->getParentId()->getValue() : null,
503 'amount' => $this->amount->getValue(),
504 'gateway' => $this->gateway->getName()->getValue(),
505 'gatewayTitle' => null !== $this->getGatewayTitle() ? $this->getGatewayTitle()->getValue() : '',
506 'dateTime' => null !== $this->dateTime ? $this->dateTime->getValue()->format('Y-m-d H:i:s') : null,
507 'status' => $this->status->getValue(),
508 'data' => $this->data->getValue(),
509 'entity' => $this->getEntity() ? $this->getEntity()->getValue() : null,
510 'created' => $this->getCreated() ? $this->getCreated()->getValue()->format('Y-m-d H:i:s') : null,
511 'actionsCompleted' => $this->getActionsCompleted() ? $this->getActionsCompleted()->getValue() : null,
512 'triggeredActions' => $this->getTriggeredActions() ? $this->getTriggeredActions()->getValue() : null,
513 'wcOrderId' => $this->getWcOrderId() ? $this->getWcOrderId()->getValue() : null,
514 'wcOrderItemId' => $this->getWcOrderItemId() ? $this->getWcOrderItemId()->getValue() : null,
515 'wcOrderUrl' => $this->getWcOrderUrl() ? $this->getWcOrderUrl()->getValue() : null,
516 'wcItemCouponValue' => $this->getWcItemCouponValue() ? $this->getWcItemCouponValue()->getValue() : null,
517 'wcItemTaxValue' => $this->getWcItemTaxValue() ? $this->getWcItemTaxValue()->getValue() : null,
518 'transactionId' => $this->getTransactionId(),
519 'transfers' => $this->getTransfers() ? $this->getTransfers()->getValue() : null,
520 'invoiceNumber' => $this->getInvoiceNumber() ? $this->getInvoiceNumber()->getValue() : null,
521 'paymentLinks' => $this->getPaymentLinks() ?: null,
522 ];
523 }
524 }
525