Class: Paynow::HashGenerator
- Inherits:
-
Object
- Object
- Paynow::HashGenerator
- Defined in:
- lib/paynow/hash_generator.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #_hmac ⇒ Object
-
#initialize(data) ⇒ HashGenerator
constructor
A new instance of HashGenerator.
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
#data ⇒ Object (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
#_hmac ⇒ Object
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 |