|
1
|
|
|
<?php |
|
2
|
|
|
declare(strict_types = 1); |
|
3
|
|
|
namespace DERHANSEN\SfEventMgt\Event; |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Extension "sf_event_mgt" for TYPO3 CMS. |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please read the |
|
9
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
use DERHANSEN\SfEventMgt\Controller\PaymentController; |
|
13
|
|
|
use DERHANSEN\SfEventMgt\Domain\Model\Registration; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* This event is triggered before the payment failure view is rendered. This event must be used to handle the |
|
17
|
|
|
* registration (e.g. update/delete) in case of the payment process failed. |
|
18
|
|
|
*/ |
|
19
|
|
|
final class ProcessPaymentFailureEvent |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @var array |
|
23
|
|
|
*/ |
|
24
|
|
|
private $variables; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
private $paymentMethod; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var bool |
|
33
|
|
|
*/ |
|
34
|
|
|
private $updateRegistration; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var bool |
|
38
|
|
|
*/ |
|
39
|
|
|
private $removeRegistration; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @var Registration |
|
43
|
|
|
*/ |
|
44
|
|
|
private $registration; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @var array |
|
48
|
|
|
*/ |
|
49
|
|
|
private $getVariables; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var PaymentController |
|
53
|
|
|
*/ |
|
54
|
|
|
private $paymentController; |
|
55
|
|
|
|
|
56
|
|
|
public function __construct( |
|
57
|
|
|
array $variables, |
|
58
|
|
|
string $paymentMethod, |
|
59
|
|
|
bool $updateRegistration, |
|
60
|
|
|
bool $removeRegistration, |
|
61
|
|
|
Registration $registration, |
|
62
|
|
|
array $getVariables, |
|
63
|
|
|
PaymentController $paymentController |
|
64
|
|
|
) { |
|
65
|
|
|
$this->variables = $variables; |
|
66
|
|
|
$this->paymentMethod = $paymentMethod; |
|
67
|
|
|
$this->updateRegistration = $updateRegistration; |
|
68
|
|
|
$this->removeRegistration = $removeRegistration; |
|
69
|
|
|
$this->registration = $registration; |
|
70
|
|
|
$this->getVariables = $getVariables; |
|
71
|
|
|
$this->paymentController = $paymentController; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return array |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getVariables(): array |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->variables; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @return string |
|
84
|
|
|
*/ |
|
85
|
|
|
public function getPaymentMethod(): string |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->paymentMethod; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @return bool |
|
92
|
|
|
*/ |
|
93
|
|
|
public function getUpdateRegistration(): bool |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->updateRegistration; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @return bool |
|
100
|
|
|
*/ |
|
101
|
|
|
public function getRemoveRegistration(): bool |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->removeRegistration; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @return Registration |
|
108
|
|
|
*/ |
|
109
|
|
|
public function getRegistration(): Registration |
|
110
|
|
|
{ |
|
111
|
|
|
return $this->registration; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @return array |
|
116
|
|
|
*/ |
|
117
|
|
|
public function getGetVariables(): array |
|
118
|
|
|
{ |
|
119
|
|
|
return $this->getVariables; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @return PaymentController |
|
124
|
|
|
*/ |
|
125
|
|
|
public function getPaymentController(): PaymentController |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->paymentController; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @param array $variables |
|
132
|
|
|
*/ |
|
133
|
|
|
public function setVariables(array $variables): void |
|
134
|
|
|
{ |
|
135
|
|
|
$this->variables = $variables; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* @param bool $updateRegistration |
|
140
|
|
|
*/ |
|
141
|
|
|
public function setUpdateRegistration(bool $updateRegistration): void |
|
142
|
|
|
{ |
|
143
|
|
|
$this->updateRegistration = $updateRegistration; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* @param bool $removeRegistration |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setRemoveRegistration(bool $removeRegistration): void |
|
150
|
|
|
{ |
|
151
|
|
|
$this->removeRegistration = $removeRegistration; |
|
152
|
|
|
} |
|
153
|
|
|
} |
|
154
|
|
|
|