Created
November 29, 2011 19:30
-
-
Save resistorsoftware/1406084 to your computer and use it in GitHub Desktop.
Simple WebHook parse, JSON
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
domain = request.env["HTTP_X_SHOPIFY_SHOP_DOMAIN"] | |
product_id = request.env["HTTP_X_SHOPIFY_PRODUCT_ID"] | |
request.body.rewind | |
@product = JSON.parse(request.body.read) | |
@shop = Shop.find_by_myshopify_domain(domain) | |
verified = verify_webhook(data, request.env["HTTP_X_SHOPIFY_HMAC_SHA256"]) | |
unless verified | |
puts "\n\n***** Headers did not match, this call is not from Shopify!!\n" | |
status 200 | |
return | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment