Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

HMAC multiple products

jrwhipjrwhip Member
in Help edited December 2014
I can't seem to get HMAC working with multiple products being added to the cart at the same time.

I have placed the 2: outside of the hash I have tried several different ways of doing it and the output looks like it should work, but I keep getting an error. Can you give me an example of how I would do it using your get verification function for php
function get_verification($var_name, $var_value, $var_code) {
$api_key = "my_api_key";
$encodingval = htmlspecialchars($var_code . $var_name . $var_value);
return $var_name . '||' . hash_hmac('sha256', $encodingval, $api_key) . ($var_value === "--OPEN--" ? "||open" : "");
}
Tagged:
Comments
  • Im not sure why I couldn't get it to work before, but it is working just fine now.
  • winstonwinston FoxyCart Team
    @jrwhip

    Glad to hear it's working, let us know if you run into further questions! I'm editing your post to remove your API key just so it's not stored publicly.
  • oops, Thanks
Sign In or Register to comment.