1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
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
|
|
|
namespace DERHANSEN\SfEventMgt\Event; |
13
|
|
|
|
14
|
|
|
use DERHANSEN\SfEventMgt\Controller\PaymentController; |
15
|
|
|
use DERHANSEN\SfEventMgt\Domain\Model\Registration; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* This event is triggered before the payment redirect view is rendered. This event must be used to process initialize |
19
|
|
|
* the payment process with the payment provider. |
20
|
|
|
*/ |
21
|
|
|
final class ProcessPaymentInitializeEvent |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var array |
25
|
|
|
*/ |
26
|
|
|
private $variables; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
private $paymentMethod; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var bool |
35
|
|
|
*/ |
36
|
|
|
private $updateRegistration; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var Registration |
40
|
|
|
*/ |
41
|
|
|
private $registration; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var PaymentController |
45
|
|
|
*/ |
46
|
|
|
private $paymentController; |
47
|
|
|
|
48
|
|
|
public function __construct( |
49
|
|
|
array $variables, |
50
|
|
|
string $paymentMethod, |
51
|
|
|
bool $updateRegistration, |
52
|
|
|
Registration $registration, |
53
|
|
|
PaymentController $paymentController |
54
|
|
|
) { |
55
|
|
|
$this->variables = $variables; |
56
|
|
|
$this->paymentMethod = $paymentMethod; |
57
|
|
|
$this->updateRegistration = $updateRegistration; |
58
|
|
|
$this->registration = $registration; |
59
|
|
|
$this->paymentController = $paymentController; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return array |
64
|
|
|
*/ |
65
|
|
|
public function getVariables(): array |
66
|
|
|
{ |
67
|
|
|
return $this->variables; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return string |
72
|
|
|
*/ |
73
|
|
|
public function getPaymentMethod(): string |
74
|
|
|
{ |
75
|
|
|
return $this->paymentMethod; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return bool |
80
|
|
|
*/ |
81
|
|
|
public function getUpdateRegistration(): bool |
82
|
|
|
{ |
83
|
|
|
return $this->updateRegistration; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return Registration |
88
|
|
|
*/ |
89
|
|
|
public function getRegistration(): Registration |
90
|
|
|
{ |
91
|
|
|
return $this->registration; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return PaymentController |
96
|
|
|
*/ |
97
|
|
|
public function getPaymentController(): PaymentController |
98
|
|
|
{ |
99
|
|
|
return $this->paymentController; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param array $variables |
104
|
|
|
*/ |
105
|
|
|
public function setVariables(array $variables): void |
106
|
|
|
{ |
107
|
|
|
$this->variables = $variables; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param bool $updateRegistration |
112
|
|
|
*/ |
113
|
|
|
public function setUpdateRegistration(bool $updateRegistration): void |
114
|
|
|
{ |
115
|
|
|
$this->updateRegistration = $updateRegistration; |
116
|
|
|
} |
117
|
|
|
} |
118
|
|
|
|