Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
18 | class IpnController extends AbstractController |
||
19 | { |
||
20 | use LoggerTrait; |
||
21 | |||
22 | /** |
||
23 | * @return \Symfony\Component\HttpFoundation\Response |
||
24 | */ |
||
25 | public function endpointAction(Request $request) |
||
26 | { |
||
27 | $headers = $this->convertHeaders($request->headers->all()); |
||
28 | $body = file_get_contents('php://input'); |
||
29 | |||
30 | $ipnRequestTransfer = $this->getFacade()->convertAmazonPayIpnRequest($headers, $body); |
||
31 | $this->getFacade()->handleAmazonPayIpnRequest($ipnRequestTransfer); |
||
32 | |||
33 | return new Response('Request has been processed'); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param array $headers |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | protected function convertHeaders(array $headers) |
||
50 | } |
||
51 | } |
||
52 |