Method: AuthorizeNet::SIM::Transaction#fingerprint
- Defined in:
- lib/authorize_net/sim/transaction.rb
#fingerprint ⇒ Object
Calculates and returns the HMAC-MD5 fingerprint needed to authenticate the transaction with the SIM gateway.
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/authorize_net/sim/transaction.rb', line 66 def fingerprint if @timestamp.nil? @timestamp = Time.now.to_i end if @sequence.nil? @sequence = rand(RANDOM_SEQUENCE_MAX) end OpenSSL::HMAC.hexdigest(@@digest, @api_transaction_key, "#{@api_login_id.to_s.rstrip}^#{@sequence.to_s.rstrip}^#{@timestamp.to_s.rstrip}^#{@amount.to_s.rstrip}^") end |