PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Entity / Payment / Payment.php

Payment.php in The Innovative Form Builder – IvyForms 1.5.1, at backend/src/Entity/Payment/Payment.php

126 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Entity\Payment;
4
5 use IvyForms\ValueObjects\Payment\Payment as PaymentValueObject;
6
7 /**
8 * Payment entity wrapping the value object.
9 */
10 class Payment
11 {
12 private PaymentValueObject $payment;
13
14 public function __construct(PaymentValueObject $payment)
15 {
16 $this->payment = $payment;
17 }
18
19 public function getId(): int
20 {
21 return $this->payment->id;
22 }
23
24 public function setId(int $id): void
25 {
26 $this->payment->id = $id;
27 }
28
29 public function getEntryId(): ?int
30 {
31 return $this->payment->entryId;
32 }
33
34 public function getFormId(): int
35 {
36 return $this->payment->formId;
37 }
38
39 public function getTransactionId(): string
40 {
41 return $this->payment->transactionId;
42 }
43
44 public function getPaymentMethod(): string
45 {
46 return $this->payment->paymentMethod;
47 }
48
49 public function getCustomerName(): ?string
50 {
51 return $this->payment->customerName;
52 }
53
54 public function setCustomerName(?string $customerName): void
55 {
56 $this->payment = $this->payment->withCustomerName(
57 $customerName !== null && $customerName !== '' ? $customerName : null
58 );
59 }
60
61 public function getAmount(): int
62 {
63 return $this->payment->amount;
64 }
65
66 public function getCurrency(): string
67 {
68 return $this->payment->currency;
69 }
70
71 public function getSquareReceiptUrl(): ?string
72 {
73 return $this->payment->squareReceiptUrl;
74 }
75
76 public function getStatus(): string
77 {
78 return $this->payment->status;
79 }
80
81 public function setStatus(string $status): void
82 {
83 $this->payment->status = $status;
84 }
85
86 public function getProviderMeta(): ?string
87 {
88 return $this->payment->providerMeta;
89 }
90
91 public function setProviderMeta(?string $providerMeta): void
92 {
93 $this->payment = $this->payment->withProviderMeta($providerMeta);
94 }
95
96 public function setEntryId(?int $entryId): void
97 {
98 $this->payment->entryId = $entryId !== null && $entryId > 0 ? $entryId : null;
99 }
100
101 public function setSquareReceiptUrl(?string $receiptUrl): void
102 {
103 $this->payment->squareReceiptUrl = $receiptUrl !== null && $receiptUrl !== ''
104 ? $receiptUrl
105 : null;
106 }
107
108 public function getDateCreated(): ?string
109 {
110 return $this->payment->dateCreated;
111 }
112
113 public function setDateCreated(string $dateCreated): void
114 {
115 $this->payment->dateCreated = $dateCreated;
116 }
117
118 /**
119 * @return mixed[]
120 */
121 public function toArray(): array
122 {
123 return $this->payment->toArray();
124 }
125 }
126