Skip to content

Commit 4576f4f

Browse files
committed
[BUGFIX] Use Old setStatus for Resonse in TYPO3 v10.4
Related: #27
1 parent 56a1b9a commit 4576f4f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Classes/Controller/Order/PaymentController.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ public function cancelAction(): void
186186
public function notifyAction()
187187
{
188188
if ($this->request->getMethod() !== 'POST') {
189+
// exit with Status Code in TYPO3 v10.4
190+
if (isset($this->response)) {
191+
$this->response->setStatus(405);
192+
exit();
193+
}
189194
return $this->htmlResponse()->withStatus(405, 'Method not allowed.');
190195
}
191196

@@ -207,12 +212,22 @@ public function notifyAction()
207212

208213
$cartSHash = $postData['custom'];
209214
if (empty($cartSHash)) {
215+
// exit with Status Code in TYPO3 v10.4
216+
if (isset($this->response)) {
217+
$this->response->setStatus(403);
218+
exit();
219+
}
210220
return $this->htmlResponse()->withStatus(403, 'Not allowed.');
211221
}
212222

213223
$this->loadCartByHash($this->request->getArgument('hash'));
214224

215225
if ($this->cart === null) {
226+
// exit with Status Code in TYPO3 v10.4
227+
if (isset($this->response)) {
228+
$this->response->setStatus(404);
229+
exit();
230+
}
216231
return $this->htmlResponse()->withStatus(404, 'Page / Cart not found.');
217232
}
218233

@@ -228,6 +243,11 @@ public function notifyAction()
228243
$this->eventDispatcher->dispatch($notifyEvent);
229244
}
230245

246+
// exit with Status Code in TYPO3 v10.4
247+
if (isset($this->response)) {
248+
$this->response->setStatus(200);
249+
exit();
250+
}
231251
return $this->htmlResponse()->withStatus(200);
232252
}
233253

0 commit comments

Comments
 (0)