lib/GestPayCrypt.php
private function _parseResponse($type, $response)
    {
        $matches = array();

        if (preg_match("/#" . $type . "string#([\w\W]*)#\/" . $type . "string#/", $response, $matches)) {
            $parsed = trim($matches[1]);
        } elseif (preg_match("/#error#([\w\W]*)#\/error#/", $response, $matches)) {
            $err = explode("-", $matches[1]);

            if (empty($err[0]) && empty($err[1])) {
                $this->setError('9999', 'Unknown error');
            } else {
                $this->setError(trim($err[0]), trim($err[1]));
            }

            return -1;
        } else {
            $this->setError('9999', 'Response from server not valid');

            return -1;
        }

        return $parsed;
    }
private function _parseResponse($type, $response)
    {
        $matches = array();

        if (preg_match("/#" . $type . "string#([\w\W]*)#\/" . $type . "string#/", $response, $matches)) {
            $parsed = trim($matches[1]);
        } elseif (preg_match("/#error#([\w\W]*)#\/error#/", $response, $matches)) {
            $err = explode("-", $matches[1]);

            if (empty($err[0]) && empty($err[1])) {
                $this->setError('9999', 'Unknown error');
            } else {
                $this->setError(trim($err[0]), trim($err[1]));
            }

            return -1;
        } else {
            $this->setError('9999', 'Response from server not valid');

            return -1;
        }

        return $parsed;
    }
@param string $type
@param string $response

@return string