Class: Smartpay::Requests::Payment
- Inherits:
-
Object
- Object
- Smartpay::Requests::Payment
- Includes:
- Validator
- Defined in:
- lib/smartpay/requests/payment.rb
Overview
Payment
Constant Summary collapse
- REQUIREMENT_KEY_NAME =
i[order amount currency].freeze
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(raw_payload) ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize(raw_payload) ⇒ Payment
Returns a new instance of Payment.
13 14 15 |
# File 'lib/smartpay/requests/payment.rb', line 13 def initialize(raw_payload) @payload = raw_payload.transform_keys(&:to_sym) end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
9 10 11 |
# File 'lib/smartpay/requests/payment.rb', line 9 def payload @payload end |
Instance Method Details
#as_hash ⇒ Object
17 18 19 20 |
# File 'lib/smartpay/requests/payment.rb', line 17 def as_hash check_requirement!(REQUIREMENT_KEY_NAME) normalize_payload end |