Class: Payonline::PaymentResponse
- Inherits:
-
Object
- Object
- Payonline::PaymentResponse
- Extended by:
- Forwardable
- Defined in:
- lib/payonline/payment_response.rb
Constant Summary collapse
- SIGNED_PARAMS =
i(date_time transaction_id order_id amount currency)
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ PaymentResponse
constructor
A new instance of PaymentResponse.
- #valid_payment? ⇒ Boolean
Constructor Details
#initialize(params = {}) ⇒ PaymentResponse
Returns a new instance of PaymentResponse.
11 12 13 14 |
# File 'lib/payonline/payment_response.rb', line 11 def initialize(params = {}) @params = prepare_params(params) @data = OpenStruct.new(@params) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/payonline/payment_response.rb', line 5 def data @data end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/payonline/payment_response.rb', line 5 def params @params end |
Instance Method Details
#valid_payment? ⇒ Boolean
16 17 18 19 |
# File 'lib/payonline/payment_response.rb', line 16 def valid_payment? keys = SIGNED_PARAMS.select { |key| @params.key?(key) } @params[:security_key] == Payonline::Signature.new(@params, keys, false).digest end |