protected function normalizeQueryResponse($content)
    {
        $result = new \stdClass();
        $result->Results = array();

        $lines = explode("\n", $content);

        foreach ($lines as $line) {
            if (empty($line)) {
                continue;
            }

            $parts = str_getcsv($line);

            if ($parts[0] === 'Command Response') {
                $result->CommandStatus = $parts[1];
                $result->ResponseCode = $parts[2];
                $result->Description = $parts[3];
                $result->ErrorInformation = $parts[4];
                $result->TransAct_ReferenceID = $parts[5];

                continue;
            }

            $status = new \stdClass();
            $status->TransAct_ReferenceID = $parts[0];
            $status->Provider_TransactionID = $parts[1];
            $status->MerchantID = $parts[2];
            $status->EventName = $parts[3];
            $status->EventDate = $parts[4];
            $status->ResultingStatus = $parts[5];
            $status->ReturnCode = $parts[6];
            $status->VerificationStatus = $parts[7];
            $status->VerificationCode = $parts[8];
            $status->VerificationText = $parts[9];

            $result->Results[] = $status;
        }

        if (!$result->CommandStatus) {
            return null;
        }

        return $result;
    }