Last active
June 1, 2018 09:14
-
-
Save xtrasimplicity/5802c030d196f8570bbd93c4fb6371cf to your computer and use it in GitHub Desktop.
Generating a fingerprint for SecurePay Australia's DirectPost integration.
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
require 'openssl' | |
raw_fingerprint = [merchant_id, merchant_password, transaction_type, reference_id, amount, timestamp].join('|') | |
digest = OpenSSL::Digest.new('sha256') | |
fingerprint = OpenSSL::HMAC.hexdigest(digest, merchant_password, raw_fingerprint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment