Skip to content

Instantly share code, notes, and snippets.

@melodymorgan
Created June 7, 2013 21:51
Show Gist options
  • Save melodymorgan/5732670 to your computer and use it in GitHub Desktop.
Save melodymorgan/5732670 to your computer and use it in GitHub Desktop.
$params = $this->getParams();
$binary_hash = hash_hmac('sha1', $params, $this->secretKey, true);
$base64_hash = base64_encode($binary_hash);
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $this->apiUrl . $params,
CURLOPT_HTTPHEADER => Array('Authorization: ' . $base64_hash),
CURLOPT_RETURNTRANSFER => true,
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment