forked from Payum/PayumBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotifyController.php
More file actions
29 lines (21 loc) · 792 Bytes
/
Copy pathNotifyController.php
File metadata and controls
29 lines (21 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace Payum\Bundle\PayumBundle\Controller;
use Payum\Core\Request\Notify;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class NotifyController extends PayumController
{
public function doUnsafeAction(Request $request): Response
{
$gateway = $this->getPayum()->getGateway($request->attributes->get('gateway'));
$gateway->execute(new Notify(null));
return new Response('', 204);
}
public function doAction(Request $request): Response
{
$token = $this->getPayum()->getHttpRequestVerifier()->verify($request);
$gateway = $this->getPayum()->getGateway($token->getGatewayName());
$gateway->execute(new Notify($token));
return new Response('', 204);
}
}