Completed
Push — master ( 70dfe1...a97a1c )
by Torben
04:18
created

ProcessPaymentNotifyEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 6
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 notify view is rendered. This event must be used to handle feedback
19
 * from the payment provider when the notification action is triggered (e.g. payment denied afterwards)
20
 */
21
final class ProcessPaymentNotifyEvent
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 array
45
     */
46
    private $getVariables;
47
48
    /**
49
     * @var PaymentController
50
     */
51
    private $paymentController;
52
53
    public function __construct(
54
        array $variables,
55
        string $paymentMethod,
56
        bool $updateRegistration,
57
        Registration $registration,
58
        array $getVariables,
59
        PaymentController $paymentController
60
    ) {
61
        $this->variables = $variables;
62
        $this->paymentMethod = $paymentMethod;
63
        $this->updateRegistration = $updateRegistration;
64
        $this->registration = $registration;
65
        $this->getVariables = $getVariables;
66
        $this->paymentController = $paymentController;
67
    }
68
69
    /**
70
     * @return array
71
     */
72
    public function getVariables(): array
73
    {
74
        return $this->variables;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getPaymentMethod(): string
81
    {
82
        return $this->paymentMethod;
83
    }
84
85
    /**
86
     * @return bool
87
     */
88
    public function getUpdateRegistration(): bool
89
    {
90
        return $this->updateRegistration;
91
    }
92
93
    /**
94
     * @return Registration
95
     */
96
    public function getRegistration(): Registration
97
    {
98
        return $this->registration;
99
    }
100
101
    /**
102
     * @return array
103
     */
104
    public function getGetVariables(): array
105
    {
106
        return $this->getVariables;
107
    }
108
109
    /**
110
     * @return PaymentController
111
     */
112
    public function getPaymentController(): PaymentController
113
    {
114
        return $this->paymentController;
115
    }
116
117
    /**
118
     * @param array $variables
119
     */
120
    public function setVariables(array $variables): void
121
    {
122
        $this->variables = $variables;
123
    }
124
125
    /**
126
     * @param bool $updateRegistration
127
     */
128
    public function setUpdateRegistration(bool $updateRegistration): void
129
    {
130
        $this->updateRegistration = $updateRegistration;
131
    }
132
}
133