Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 01 Getting Started/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion 02 Charging For Your App/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down