ExShopify v0.2.0 ExShopify.HMAC

Module for handling Shopify HMAC signatures.

Summary

Functions

Verifies the Shopify HMAC signature

Functions

verify(hmac, message, shared_secret)
verify(String.t, String.t, String.t) :: {:ok | :error, String.t}

Verifies the Shopify HMAC signature.

Every request or redirect from Shopify includes an HMAC signature that can be used to ensure that it came from Shopify.

This function will compute an SHA256 HMAC digest based on the provided message and shared_secret. The digest is then compared to the hmac signature. If they match, verification has passed. Otherwise verification has failed.