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