php/src/mollie/api.php
protected function signRequest($path, array $params, $secret, $timestamp = null)
	{
        /* If there is no secret, don't sign the request. */
        if (empty($secret)) {
            return $params;
        }

        /* Remove any existing signature, update timestamp and alphabetically sort parameters. */
        unset($params['signature']);
        $params['timestamp'] = $timestamp !== null ? $timestamp : time();
        ksort($params);

        /* Calculate signature */
        $queryString = http_build_query($params, '', '&');
        $params['signature'] = hash_hmac(
            'sha1',
            '/' . trim($path, '/') . '?' . $queryString,
            strtoupper($secret)
        );

        return $params;
    }
protected function signRequest($path, array $params, $secret, $timestamp = null)
	{
        /* If there is no secret, don't sign the request. */
        if (empty($secret)) {
            return $params;
        }

        /* Remove any existing signature, update timestamp and alphabetically sort parameters. */
        unset($params['signature']);
        $params['timestamp'] = $timestamp !== null ? $timestamp : time();
        ksort($params);

        /* Calculate signature */
        $queryString = http_build_query($params, '', '&');
        $params['signature'] = hash_hmac(
            'sha1',
            '/' . trim($path, '/') . '?' . $queryString,
            strtoupper($secret)
        );

        return $params;
    }
protected function signRequest ( $ path , array $ params , $ secret , $ timestamp = null ) { /* If there is no secret, don't sign the request. */ if ( empty ( $ secret ) ) { return $ params ; } /* Remove any existing signature, update timestamp and alphabetically sort parameters. */ unset ( $ params [ 'signature' ] ) ; $ params [ 'timestamp' ] = $ timestamp !== null ? $ timestamp : time ( ) ; ksort ( $ params ) ; /* Calculate signature */ $ queryString = http_build_query ( $ params , '' , '&' ) ; $ params [ 'signature' ] = hash_hmac ( 'sha1' , '/' . trim ( $ path , '/' ) . '?' . $ queryString , strtoupper ( $ secret ) ) ; return $ params ; }
Calculate an MD5-signature based on request path, parameters and key.
Signature will be added to input parameters array.

@param string $path Current request path without query string
@param array $params Parameters to use as HMAC data
@param string $secret Secret to use as HMAC key
@param int $timestamp (Optional) Override timestamp

@return array
Calculate an MD5 - signature based on request path parameters and key . Signature will be added to input parameters array .