public function validateHash(array $data)
    {
        $fpHash = isset($data['fp_hash']) ? $data['fp_hash'] : null;

        if (empty($fpHash)) {
            return true;
        }

        $parameters = $this->getParameters();
        $secret = isset($parameters['secret']) ? $parameters['secret'] : '';

        if (empty($secret)) {
            throw new \Exception("Secret key is required!");
        }

        $response = array(
            $data['fp_paidto'],
            $data['fp_paidby'],
            $data['fp_store'],
            $data['fp_amnt'],
            $data['fp_batchnumber'],
            $data['fp_currency'],
            $secret
        );

        $hash = Security::getHash($response);

        if (strcmp($fpHash, $hash) !== 0) {
            throw new \Exception("Invalid response! Secret key is wrong!");
        }

        return true;
    }