Class: Kount::KHASH
- Inherits:
-
Object
- Object
- Kount::KHASH
- Defined in:
- app/models/kount/khash.rb
Constant Summary collapse
- PREFIX_LENGTH =
6- SUFFIX_LENGTH =
16
Instance Attribute Summary collapse
-
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
-
#original_value ⇒ Object
Returns the value of attribute original_value.
-
#payment_type ⇒ Object
Returns the value of attribute payment_type.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ KHASH
constructor
A new instance of KHASH.
- #to_s ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ KHASH
Returns a new instance of KHASH.
11 12 13 14 15 16 17 18 19 |
# File 'app/models/kount/khash.rb', line 11 def initialize(attrs = {}) attrs = { value: attrs } unless attrs.is_a?(Hash) attrs.symbolize_keys! self.payment_type = RIS::Inquiry::PAYMENT_TYPES.key(attrs[:payment_type]) || attrs[:payment_type] || 'card' self.salt = attrs[:salt] || Kount::Configuration.salt self.merchant_id = attrs[:merchant_id] || Kount::Configuration.merchant_id self.original_value = attrs[:value] end |
Instance Attribute Details
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
8 9 10 |
# File 'app/models/kount/khash.rb', line 8 def merchant_id @merchant_id end |
#original_value ⇒ Object
Returns the value of attribute original_value.
9 10 11 |
# File 'app/models/kount/khash.rb', line 9 def original_value @original_value end |
#payment_type ⇒ Object
Returns the value of attribute payment_type.
8 9 10 |
# File 'app/models/kount/khash.rb', line 8 def payment_type @payment_type end |
#salt ⇒ Object
Returns the value of attribute salt.
8 9 10 |
# File 'app/models/kount/khash.rb', line 8 def salt @salt end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'app/models/kount/khash.rb', line 9 def value @value end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'app/models/kount/khash.rb', line 27 def to_s @value end |