Created
April 9, 2012 20:32
-
-
Save rtekie/2346413 to your computer and use it in GitHub Desktop.
LoyaltyPlus API call sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$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