Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function ipnAction(Request $request) |
||
26 | { |
||
27 | $ipnService = $this->get('payplug.ipn'); |
||
28 | $eventDispatcher = $this->get('event_dispatcher'); |
||
29 | $isSignatureValid = $ipnService->verifyIPNRequest($request); |
||
30 | |||
31 | if ($isSignatureValid) { |
||
32 | $ipn = $ipnService->createIPNFromBody($request->getContent()); |
||
33 | $event = new PayplugIPNEvent($ipn); |
||
34 | $eventDispatcher->dispatch(PayplugIPNEvent::PAYPLUG_IPN, $event); |
||
35 | } else { |
||
36 | $event = new PayplugMalformedIPNEvent($request); |
||
37 | $eventDispatcher->dispatch(PayplugMalformedIPNEvent::PAYPLUG_IPN_MALFORMED, $event); |
||
38 | } |
||
39 | |||
40 | return new Response(); |
||
41 | } |
||
42 | } |
||
43 |