1 | <?php |
||
31 | class PaymentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController |
||
32 | { |
||
33 | |||
34 | /** |
||
35 | * PaymentService |
||
36 | * |
||
37 | * @var PaymentService |
||
38 | */ |
||
39 | protected $paymentService; |
||
40 | |||
41 | /** |
||
42 | * Hash Service |
||
43 | * |
||
44 | * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService |
||
45 | */ |
||
46 | protected $hashService; |
||
47 | |||
48 | /** |
||
49 | * Registration repository |
||
50 | * |
||
51 | * @var \DERHANSEN\SfEventMgt\Domain\Repository\RegistrationRepository |
||
52 | */ |
||
53 | protected $registrationRepository = null; |
||
54 | |||
55 | /** |
||
56 | * DI for paymentService |
||
57 | * |
||
58 | * @param PaymentService $paymentService |
||
59 | */ |
||
60 | public function injectPaymentService(PaymentService $paymentService) |
||
64 | |||
65 | /** |
||
66 | * DI for hashService |
||
67 | * |
||
68 | * @param HashService $hashService |
||
69 | */ |
||
70 | public function injectHashService(HashService $hashService) |
||
74 | |||
75 | /** |
||
76 | * DI for registrationRepository |
||
77 | * |
||
78 | * @param RegistrationRepository $registrationRepository |
||
79 | */ |
||
80 | public function injectRegistrationRepository(RegistrationRepository $registrationRepository) |
||
84 | |||
85 | /** |
||
86 | * Catches all PaymentExceptions and sets the Exception message to the response content |
||
87 | * |
||
88 | * @param RequestInterface $request |
||
89 | * @param ResponseInterface $response |
||
90 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
||
91 | */ |
||
92 | public function processRequest(RequestInterface $request, ResponseInterface $response) |
||
101 | |||
102 | /** |
||
103 | * Redirect to payment provider |
||
104 | * |
||
105 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
106 | * @param string $hmac |
||
107 | */ |
||
108 | public function redirectAction($registration, $hmac) |
||
143 | |||
144 | /** |
||
145 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
146 | * @param string $hmac |
||
147 | */ |
||
148 | public function successAction($registration, $hmac) |
||
175 | |||
176 | /** |
||
177 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
178 | * @param string $hmac |
||
179 | */ |
||
180 | public function failureAction($registration, $hmac) |
||
207 | |||
208 | /** |
||
209 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
210 | * @param string $hmac |
||
211 | */ |
||
212 | public function cancelAction($registration, $hmac) |
||
239 | |||
240 | /** |
||
241 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
242 | * @param string $hmac |
||
243 | */ |
||
244 | public function notifyAction($registration, $hmac) |
||
269 | |||
270 | /** |
||
271 | * Checks if the given action may be called for the given registration / event |
||
272 | * |
||
273 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration$registration |
||
274 | * @param string $actionName |
||
275 | * @throws PaymentException |
||
276 | * @return void |
||
277 | */ |
||
278 | protected function processWithAction($registration, $actionName) |
||
288 | |||
289 | /** |
||
290 | * Checks the HMAC for the given action and registration |
||
291 | * |
||
292 | * @param $registration |
||
293 | * @param $hmac |
||
294 | * @param $action |
||
295 | * @throws InvalidHashException |
||
296 | */ |
||
297 | protected function validateHmacForAction($registration, $hmac, $action) |
||
302 | |||
303 | /** |
||
304 | * Returns the payment Uri for the given action and registration |
||
305 | * |
||
306 | * @param string $action |
||
307 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
308 | * @return string |
||
309 | * @throws \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForHashGenerationException |
||
310 | */ |
||
311 | protected function getPaymentUriForAction($action, $registration) |
||
324 | |||
325 | } |
||
326 | |||
327 |