Created
July 1, 2020 07:00
-
-
Save TeTiRoss/55842daec4dc3495c57513651a7e1a0b to your computer and use it in GitHub Desktop.
authenticated Miinto orders requested
This file contains hidden or 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
shop_id = SHOP_ID | |
channel_response_id = CHANNEL_RESPONSE_ID | |
channel_response_token = CHANNEL_RESPONSE_TOKEN | |
time = Time.now.to_i.to_s | |
seed = rand(1..99) | |
resourceSig = Digest::SHA256.hexdigest('GET' + "\n" + 'api-order.miinto.net' + "\n" + "/shops/#{shop_id}/orders" + "\n") | |
headerSig = Digest::SHA256.hexdigest(channel_response_id + "\n" + time + "\n" + seed + "\n" + 'MNT-HMAC-SHA256-1-0') | |
payloadSig = Digest::SHA256.hexdigest('') | |
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), channel_response_token, resourceSig + "\n" + headerSig + "\n" + payloadSig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment