<?php
define('IDCOMPTE', '394953');
define('URLCSS', 'http://sd-20614.dedibox.fr/~jabella/beemoov/cssperso/base.css');
define('APISECRETKEY', '6fa9c299b26df2e359318f2359f4b64c');
define('IDSITE', '285913');
define('IDDOCUMENT', '1190193');
	 
function process_hmac($params, $apiKey)
	{
	    $params['ids']          = IDSITE;
	    $params['idd']          = IDDOCUMENT;
	    $params['ucs']          = base64_encode(URLCSS);
	    $params['idc']          = IDCOMPTE;
	 
	    ksort($params);
	 	
	return sha1(http_build_query($params).$apiKey);    
	}
	$ucs = base64_encode(URLCSS);
	$hmac = process_hmac($params, APISECRETKEY);
	echo "<br> UCS: " . $ucs;
	echo "<br> HMAC: " . $hmac;
	
	//https://payment.allopass.com/acte/sms/purchase.apu?ids=285913&idd=1190193&ucs=aHR0cDovL3NkLTIwNjE0LmRlZGlib3guZnIvfmphYmVsbGEvYW5rYW1hL2Nzc3BlcnNvL2Jhc2UuY3Nz&hmac=a3524e36faaf74c4cc86a9e38e196b654c2509ee
	$url = "http://payment.allopass.com/acte/sms/purchase.apu?ids=285913&idd=1190193&ucs=" . $ucs . "&hmac=" . $hmac;
	echo "<br><a href='".$url."'>".$url."</a>";
?>