Class: Paynow::HashGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/paynow/hash_generator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ HashGenerator

Returns a new instance of HashGenerator.



13
14
15
# File 'lib/paynow/hash_generator.rb', line 13

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/paynow/hash_generator.rb', line 5

def data
  @data
end

Class Method Details

._hmac(data) ⇒ Object



8
9
10
# File 'lib/paynow/hash_generator.rb', line 8

def _hmac(data)
  new(data)._hmac
end

Instance Method Details

#_hmacObject



17
18
19
20
21
22
23
24
# File 'lib/paynow/hash_generator.rb', line 17

def _hmac
  return unless data

  hash_data = concatenate_hash_values_and_append_key(data)
  puts(hash_data)
  
  _hash = Digest::SHA512.hexdigest(hash_data).upcase 
end