src/Requests/Orders/Handlers/GetOrderInvoiceRequestHandler.php
protected function getFileName(Response $response)
    {
        $headers = $response->getHeaders();
        $contentDisposition = isset($headers['Content-Disposition'][0]) ? $headers['Content-Disposition'][0] : null;

        if ($contentDisposition && preg_match('/filename="(.+)"/', $contentDisposition, $filename)) {
            return $filename[1];
        }

        return null;
    }
protected function getFileName(Response $response)
    {
        $headers = $response->getHeaders();
        $contentDisposition = isset($headers['Content-Disposition'][0]) ? $headers['Content-Disposition'][0] : null;

        if ($contentDisposition && preg_match('/filename="(.+)"/', $contentDisposition, $filename)) {
            return $filename[1];
        }

        return null;
    }
Retrieve the filename from headers.

@param Response $response

@return string