protected function initSignature()
    {
        if (!$this->getRequestParameters()->has($this->parameters['hmac']['signature_name'])) {
            $this->logger->error('Payment signature not set.');

            return false;
        }

        $signature = $this->getRequestParameters()->get($this->parameters['hmac']['signature_name']);
        $signatureLength = strlen($signature);

        if ($signatureLength > 172) {
            $this->signature = base64_decode(urldecode($signature));

            return true;
        } elseif ($signatureLength == 172) {
            $this->signature = base64_decode($signature);

            return true;
        } elseif ($signatureLength == 128) {
            $this->signature = $signature;

            return true;
        } else {
            $this->signature = null;
            $this->logger->error('Bad signature format.');

            return false;
        }
    }
protected function initSignature()
    {
        if (!$this->getRequestParameters()->has($this->parameters['hmac']['signature_name'])) {
            $this->logger->error('Payment signature not set.');

            return false;
        }

        $signature = $this->getRequestParameters()->get($this->parameters['hmac']['signature_name']);
        $signatureLength = strlen($signature);

        if ($signatureLength > 172) {
            $this->signature = base64_decode(urldecode($signature));

            return true;
        } elseif ($signatureLength == 172) {
            $this->signature = base64_decode($signature);

            return true;
        } elseif ($signatureLength == 128) {
            $this->signature = $signature;

            return true;
        } else {
            $this->signature = null;
            $this->logger->error('Bad signature format.');

            return false;
        }
    }
protected function initSignature ( ) { if ( ! $ this -> getRequestParameters ( ) -> has ( $ this -> parameters [ 'hmac' ] [ 'signature_name' ] ) ) { $ this -> logger -> error ( 'Payment signature not set.' ) ; return false ; } $ signature = $ this -> getRequestParameters ( ) -> get ( $ this -> parameters [ 'hmac' ] [ 'signature_name' ] ) ; $ signatureLength = strlen ( $ signature ) ; if ( $ signatureLength > 172 ) { $ this -> signature = base64_decode ( urldecode ( $ signature ) ) ; return true ; } elseif ( $ signatureLength == 172 ) { $ this -> signature = base64_decode ( $ signature ) ; return true ; } elseif ( $ signatureLength == 128 ) { $ this -> signature = $ signature ; return true ; } else { $ this -> signature = null ; $ this -> logger -> error ( 'Bad signature format.' ) ; return false ; } }
Gets the signature set in the http request.

Paybox documentation says :
The Paybox signature is created by encrypting a SHA-1 hash with the private Paybox RSA key. The size
of a SHA-1 hash is 160 bits and the size of the Paybox key is 1024 bits. The signature is always a binary
value of fixed 128 bytes size (172 bytes in Base64 encoding).

But sometimes, base64 encoded signature are also url encoded.
Gets the signature set in the http request .