Created
October 30, 2017 09:26
-
-
Save sebduggan/10e5e97aee44e28221fced6e775ae8bf to your computer and use it in GitHub Desktop.
HMAC encode function for FoxyCart
This file contains 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
<cffunction name="hmacEncode" returntype="string" output="false"> | |
<cfargument name="sku" required="true" /> | |
<cfargument name="name" required="true" /> | |
<cfargument name="value" required="true" /> | |
<cfset var stringToHash = arguments.sku & arguments.name & arguments.value /> | |
<cfset var apiKey = "YOUR_API_KEY_HERE" /> | |
<cfset var hashedString = hmac( stringToHash, apiKey, "HMACSHA256" ) /> | |
<cfreturn lcase( hashedString ) /> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment