public function authenticateNotification($rawPayload, $provided_signature = null)
    {
        if ($this->getParameter('secret')) {// validate
            $calculated_signature = hash_hmac('sha256', $rawPayload, $this->getParameter('secret'));
            if ($provided_signature != $calculated_signature) {
                return false;
            }
        }

        return true;
    }
public function authenticateNotification($rawPayload, $provided_signature = null)
    {
        if ($this->getParameter('secret')) {// validate
            $calculated_signature = hash_hmac('sha256', $rawPayload, $this->getParameter('secret'));
            if ($provided_signature != $calculated_signature) {
                return false;
            }
        }

        return true;
    }
public function authenticateNotification ( $ rawPayload , $ provided_signature = null ) { if ( $ this -> getParameter ( 'secret' ) ) { // validate $ calculated_signature = hash_hmac ( 'sha256' , $ rawPayload , $ this -> getParameter ( 'secret' ) ) ; if ( $ provided_signature != $ calculated_signature ) { return false ; } } return true ; }
helper function to verify the signature on the header of the file

@param string $rawPayload - file_get_contents('php://input');
@param string $provided_signature - $_SERVER['HTTP_WEBHOOK_SIGNATURE'];

@return bool
helper function to verify the signature on the header of the file