Skip to content

Instantly share code, notes, and snippets.

@rtekie
Created April 9, 2012 20:32
Show Gist options
  • Save rtekie/2346413 to your computer and use it in GitHub Desktop.
Save rtekie/2346413 to your computer and use it in GitHub Desktop.
LoyaltyPlus API call sample
<?
$secret_key = "SECRET_KEY";
$params = array("email" => "CUSTOMER_EMAIL", "uuid" => "ACCOUNT_ID");
ksort($params);
$string_to_hash = $secret_key;
foreach ($params as $key => $val) {
$string_to_hash .= $key.$val;
}
$params["sig"] = md5($string_to_hash);
$api_url = "http://loyalty.500friends.com/api/enroll.gif?";
foreach ($params as $key => $val) {
$api_url .= "$key=".urlencode($val)."&";
}
echo $api_url; // Url of the api call.
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment