Class: Spree::Paysera::ParseResponse
- Inherits:
-
Object
- Object
- Spree::Paysera::ParseResponse
- Defined in:
- app/domain/spree/paysera/parse_response.rb
Constant Summary collapse
- PUBLIC_KEY =
'http://www.paysera.com/download/public.key'
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#payment_method ⇒ Object
readonly
Returns the value of attribute payment_method.
-
#ss1 ⇒ Object
readonly
Returns the value of attribute ss1.
-
#ss2 ⇒ Object
readonly
Returns the value of attribute ss2.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(payment_method, response) ⇒ ParseResponse
constructor
A new instance of ParseResponse.
- #run ⇒ Object
Constructor Details
#initialize(payment_method, response) ⇒ ParseResponse
Returns a new instance of ParseResponse.
12 13 14 15 16 17 |
# File 'app/domain/spree/paysera/parse_response.rb', line 12 def initialize(payment_method, response) @payment_method = payment_method @data = unescape_string(response[:data]) @ss1 = response[:ss1] @ss2 = decode_string(unescape_string(response[:ss2])) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'app/domain/spree/paysera/parse_response.rb', line 4 def data @data end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
4 5 6 |
# File 'app/domain/spree/paysera/parse_response.rb', line 4 def payment_method @payment_method end |
#ss1 ⇒ Object (readonly)
Returns the value of attribute ss1.
4 5 6 |
# File 'app/domain/spree/paysera/parse_response.rb', line 4 def ss1 @ss1 end |
#ss2 ⇒ Object (readonly)
Returns the value of attribute ss2.
4 5 6 |
# File 'app/domain/spree/paysera/parse_response.rb', line 4 def ss2 @ss2 end |
Class Method Details
.for(payment_method, response) ⇒ Object
8 9 10 |
# File 'app/domain/spree/paysera/parse_response.rb', line 8 def self.for(payment_method, response) new(payment_method, response).run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 |
# File 'app/domain/spree/paysera/parse_response.rb', line 19 def run validate! result end |