88use Contributte \Comgate \Entity \Codes \LangCode ;
99use Contributte \Comgate \Entity \Codes \PaymentMethodCode ;
1010
11- class Payment extends AbstractEntity
11+ class Payment extends AbstractPayment
1212{
1313
14- /** @var int */
15- private $ price ;
16-
17- /** @var string ISO 4217 */
18- private $ curr ;
19-
20- /** @var string */
21- private $ label ;
22-
23- /** @var string */
24- private $ refId ;
25-
26- /** @var string */
27- private $ email ;
28-
2914 /** @var string */
3015 private $ method = PaymentMethodCode::ALL ;
3116
32- /** @var string */
33- private $ country = CountryCode::ALL ;
34-
35- /** @var string */
36- private $ payerId ;
37-
38- /** @var string */
39- private $ account ;
40-
41- /** @var string */
42- private $ phone ;
43-
44- /** @var string */
45- private $ name ;
46-
4717 /** @var string ISO 639-1 */
4818 private $ lang = LangCode::CS ;
4919
5020 /** @var bool */
51- private $ prepareOnly ;
21+ private $ prepareOnly = true ;
5222
5323 /** @var bool */
54- private $ preauth ;
24+ private $ preauth = false ;
5525
5626 /** @var bool */
57- private $ initRecurring ;
27+ private $ initRecurring = false ;
5828
5929 /** @var bool */
60- private $ verification ;
30+ private $ verification = false ;
6131
6232 /** @var bool */
63- private $ embedded ;
64-
65- /** @var bool */
66- private $ eetReport ;
67-
68- /** @var mixed[] */
69- private $ eetData ;
33+ private $ embedded = false ;
7034
7135 final private function __construct ()
7236 {
@@ -91,86 +55,15 @@ public static function of(
9155 $ p ->method = $ method ;
9256 $ p ->country = $ country ;
9357 $ p ->lang = $ lang ;
94- $ p ->prepareOnly = true ;
9558
9659 return $ p ;
9760 }
9861
99- public function getPrice (): int
100- {
101- return $ this ->price ;
102- }
103-
104- public function getCurr (): string
105- {
106- return $ this ->curr ;
107- }
108-
109- public function getLabel (): string
110- {
111- return $ this ->label ;
112- }
113-
114- public function getRefId (): string
115- {
116- return $ this ->refId ;
117- }
118-
119- public function getEmail (): string
120- {
121- return $ this ->email ;
122- }
123-
12462 public function getMethod (): string
12563 {
12664 return $ this ->method ;
12765 }
12866
129- public function getCountry (): string
130- {
131- return $ this ->country ;
132- }
133-
134- public function getPayerId (): string
135- {
136- return $ this ->payerId ;
137- }
138-
139- public function setPayerId (string $ payerId ): void
140- {
141- $ this ->payerId = $ payerId ;
142- }
143-
144- public function getAccount (): string
145- {
146- return $ this ->account ;
147- }
148-
149- public function setAccount (string $ account ): void
150- {
151- $ this ->account = $ account ;
152- }
153-
154- public function getPhone (): string
155- {
156- return $ this ->phone ;
157- }
158-
159- public function setPhone (string $ phone ): void
160- {
161- $ this ->phone = $ phone ;
162- }
163-
164- public function getName (): string
165- {
166- return $ this ->name ;
167- }
168-
169- public function setName (string $ name ): void
170- {
171- $ this ->name = $ name ;
172- }
173-
17467 public function getLang (): string
17568 {
17669 return $ this ->lang ;
@@ -231,49 +124,20 @@ public function setEmbedded(bool $embedded): void
231124 $ this ->embedded = $ embedded ;
232125 }
233126
234- public function isEetReport (): bool
235- {
236- return $ this ->eetReport ;
237- }
238-
239- public function setEetReport (bool $ eetReport ): void
240- {
241- $ this ->eetReport = $ eetReport ;
242- }
243-
244- /**
245- * @return mixed[]
246- */
247- public function getEetData (): array
248- {
249- return $ this ->eetData ;
250- }
251-
252- /**
253- * @param mixed[] $eetData
254- */
255- public function setEetData (array $ eetData ): void
256- {
257- $ this ->eetData = $ eetData ;
258- }
259-
260127 /**
261128 * @return mixed[]
262129 */
263130 public function toArray (): array
264131 {
265- return [
266- 'price ' => $ this ->price ,
267- 'curr ' => $ this ->curr ,
268- 'label ' => $ this ->label ,
269- 'refId ' => $ this ->refId ,
132+ return array_merge (parent ::toArray (), [
270133 'method ' => $ this ->method ,
271- 'email ' => $ this ->email ,
272- 'prepareOnly ' => $ this ->prepareOnly ? 'true ' : 'false ' ,
273- 'country ' => $ this ->country ,
274134 'lang ' => $ this ->lang ,
135+ 'prepareOnly ' => $ this ->prepareOnly ? 'true ' : 'false ' ,
136+ 'preauth ' => $ this ->preauth ? 'true ' : 'false ' ,
137+ 'initRecurring ' => $ this ->initRecurring ? 'true ' : 'false ' ,
138+ 'verification ' => $ this ->verification ? 'true ' : 'false ' ,
275139 'embedded ' => $ this ->embedded ? 'true ' : 'false ' ,
276- ];
140+ ]) ;
277141 }
278142
279143}
0 commit comments