Class: EpayTools::HashGenerator
- Inherits:
-
ServicePattern::Service
- Object
- ServicePattern::Service
- EpayTools::HashGenerator
- Defined in:
- lib/epay_tools/hash_generator.rb
Constant Summary collapse
- KEYS_ORDER =
%w[txnid orderid amount currency date time txnfee paymenttype cardno hash].freeze
Instance Attribute Summary collapse
-
#epay_md5_key ⇒ Object
readonly
Returns the value of attribute epay_md5_key.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(epay_md5_key:, params:) ⇒ HashGenerator
constructor
A new instance of HashGenerator.
Constructor Details
#initialize(epay_md5_key:, params:) ⇒ HashGenerator
Returns a new instance of HashGenerator.
6 7 8 9 |
# File 'lib/epay_tools/hash_generator.rb', line 6 def initialize(epay_md5_key:, params:) @epay_md5_key = epay_md5_key @params = params.reject { |key, _value| key.to_s == "hash" } end |
Instance Attribute Details
#epay_md5_key ⇒ Object (readonly)
Returns the value of attribute epay_md5_key.
2 3 4 |
# File 'lib/epay_tools/hash_generator.rb', line 2 def epay_md5_key @epay_md5_key end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
2 3 4 |
# File 'lib/epay_tools/hash_generator.rb', line 2 def params @params end |
Instance Method Details
#execute! ⇒ Object
11 12 13 |
# File 'lib/epay_tools/hash_generator.rb', line 11 def execute! ServicePattern::Response.new(result: calculate_hash) end |