src/Util/RebillySignature.php
public static function generateSignature($apiUser, $apiKey)
    {
        $serverTimezone = date_default_timezone_get();
        date_default_timezone_set('UTC');

        $nonce = self::generateNonce(self::NONCE_LENGTH);
        $time = time();
        $signature = hash_hmac('sha1', $apiUser . $nonce . $time, $apiKey);

        $data = [
            'REB-APIUSER' => $apiUser,
            'REB-NONCE' => $nonce,
            'REB-TIMESTAMP' => $time,
            'REB-SIGNATURE' => $signature,
        ];

        date_default_timezone_set($serverTimezone);

        return base64_encode(json_encode($data));
    }
public static function generateSignature($apiUser, $apiKey)
    {
        $serverTimezone = date_default_timezone_get();
        date_default_timezone_set('UTC');

        $nonce = self::generateNonce(self::NONCE_LENGTH);
        $time = time();
        $signature = hash_hmac('sha1', $apiUser . $nonce . $time, $apiKey);

        $data = [
            'REB-APIUSER' => $apiUser,
            'REB-NONCE' => $nonce,
            'REB-TIMESTAMP' => $time,
            'REB-SIGNATURE' => $signature,
        ];

        date_default_timezone_set($serverTimezone);

        return base64_encode(json_encode($data));
    }
public static function generateSignature ( $ apiUser , $ apiKey ) { $ serverTimezone = date_default_timezone_get ( ) ; date_default_timezone_set ( 'UTC' ) ; $ nonce = self :: generateNonce ( self :: NONCE_LENGTH ) ; $ time = time ( ) ; $ signature = hash_hmac ( 'sha1' , $ apiUser . $ nonce . $ time , $ apiKey ) ; $ data = [ 'REB-APIUSER' => $ apiUser , 'REB-NONCE' => $ nonce , 'REB-TIMESTAMP' => $ time , 'REB-SIGNATURE' => $ signature , ] ; date_default_timezone_set ( $ serverTimezone ) ; return base64_encode ( json_encode ( $ data ) ) ; }
This method returns an array with the header name and header values for the nonce,
timestamp and signature.

@param string $apiUser
@param string $apiKey

@return string
This method returns an array with the header name and header values for the nonce timestamp and signature .