Class: WirecardCheckoutPage::CheckedResponse
- Inherits:
-
Object
- Object
- WirecardCheckoutPage::CheckedResponse
- Includes:
- Utils
- Defined in:
- lib/wirecard_checkout_page/checked_response.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params) ⇒ CheckedResponse
constructor
A new instance of CheckedResponse.
- #message ⇒ Object
- #success? ⇒ Boolean
- #valid? ⇒ Boolean
Methods included from Utils
Constructor Details
#initialize(params) ⇒ CheckedResponse
Returns a new instance of CheckedResponse.
5 6 7 |
# File 'lib/wirecard_checkout_page/checked_response.rb', line 5 def initialize(params) @params = stringify_keys(params).freeze end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
9 10 11 |
# File 'lib/wirecard_checkout_page/checked_response.rb', line 9 def params @params end |
Instance Method Details
#message ⇒ Object
19 20 21 |
# File 'lib/wirecard_checkout_page/checked_response.rb', line 19 def @params['message'] end |
#success? ⇒ Boolean
15 16 17 |
# File 'lib/wirecard_checkout_page/checked_response.rb', line 15 def success? valid? && @params['paymentState'] == 'SUCCESS' end |
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/wirecard_checkout_page/checked_response.rb', line 11 def valid? WirecardCheckoutPage::ResponseChecksum.new(@params).valid? end |