diff --git a/01 Getting Started/app.rb b/01 Getting Started/app.rb index b37c5e6..be516cc 100644 --- a/01 Getting Started/app.rb +++ b/01 Getting Started/app.rb @@ -42,7 +42,7 @@ def initialize # create webhook for order creation if it doesn't exist create_order_webhook - + # now that the session is activated, redirect to the bulk edit page redirect bulk_edit_url end @@ -125,7 +125,7 @@ def instantiate_session(shop) end def validate_hmac(hmac,request) - h = request.params.reject{|k,_| k == 'hmac' || k == 'signature'} + h = request.params.reject{|k,_| k == 'hmac'} query = URI.escape(h.sort.collect{|k,v| "#{k}=#{v}"}.join('&')) digest = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), API_SECRET, query) diff --git a/02 Charging For Your App/app.rb b/02 Charging For Your App/app.rb index c6fa6f5..4e719e0 100644 --- a/02 Charging For Your App/app.rb +++ b/02 Charging For Your App/app.rb @@ -136,7 +136,7 @@ def instantiate_session(shop) end def validate_hmac(hmac,request) - h = request.params.reject{|k,_| k == 'hmac' || k == 'signature'} + h = request.params.reject{|k,_| k == 'hmac'} query = URI.escape(h.sort.collect{|k,v| "#{k}=#{v}"}.join('&')) digest = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), API_SECRET, query)