src/Genesis/API/Notification.php
public function isAuthentic()
    {
        if (!isset($this->unique_id) || !isset($this->notificationObj->signature)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'Missing field(s), required for validation!'
            );
        }

        $messageSig  = trim($this->notificationObj->signature);
        $customerPwd = trim(\Genesis\Config::getPassword());

        switch (strlen($messageSig)) {
            default:
            case 40:
                $hashType = 'sha1';
                break;
            case 128:
                $hashType = 'sha512';
                break;
        }

        if ($messageSig === hash($hashType, $this->unique_id . $customerPwd)) {
            return true;
        }

        return false;
    }
public function isAuthentic()
    {
        if (!isset($this->unique_id) || !isset($this->notificationObj->signature)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'Missing field(s), required for validation!'
            );
        }

        $messageSig  = trim($this->notificationObj->signature);
        $customerPwd = trim(\Genesis\Config::getPassword());

        switch (strlen($messageSig)) {
            default:
            case 40:
                $hashType = 'sha1';
                break;
            case 128:
                $hashType = 'sha512';
                break;
        }

        if ($messageSig === hash($hashType, $this->unique_id . $customerPwd)) {
            return true;
        }

        return false;
    }
public function isAuthentic ( ) { if ( ! isset ( $ this -> unique_id ) || ! isset ( $ this -> notificationObj -> signature ) ) { throw new \ Genesis \ Exceptions \ InvalidArgument ( 'Missing field(s), required for validation!' ) ; } $ messageSig = trim ( $ this -> notificationObj -> signature ) ; $ customerPwd = trim ( \ Genesis \ Config :: getPassword ( ) ) ; switch ( strlen ( $ messageSig ) ) { default : case 40 : $ hashType = 'sha1' ; break ; case 128 : $ hashType = 'sha512' ; break ; } if ( $ messageSig === hash ( $ hashType , $ this -> unique_id . $ customerPwd ) ) { return true ; } return false ; }
Verify the signature on the parsed Notification

@return bool
@throws \Genesis\Exceptions\InvalidArgument
Verify the signature on the parsed Notification