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;
    }
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;
    }
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 ; }
Check if response is valid, only for advance mode

@example data = [fp_paidto, fp_paidby, fp_store, fp_amnt, fp_batchnumber, fp_currency]
@param array $data
@return bool
@throws \Exception
Check if response is valid only for advance mode