Class: MandarinApi::Responder
- Inherits:
-
Object
- Object
- MandarinApi::Responder
- Defined in:
- lib/mandarin_api/responder.rb
Overview
Processes callbacks from mandarinpay
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #failure ⇒ Object
-
#initialize(data) ⇒ Responder
constructor
A new instance of Responder.
- #success ⇒ Object
Constructor Details
#initialize(data) ⇒ Responder
Returns a new instance of Responder.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/mandarin_api/responder.rb', line 6 def initialize(data) @data = data @secret = MandarinApi.config.secret if sign_is_valid @process_status = @data[:status] else @process_status = 'failed' @data = { sign: 'Wrong signature!' } end end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/mandarin_api/responder.rb', line 5 def data @data end |
Instance Method Details
#failure ⇒ Object
21 22 23 |
# File 'lib/mandarin_api/responder.rb', line 21 def failure @process_status == 'failed' end |
#success ⇒ Object
17 18 19 |
# File 'lib/mandarin_api/responder.rb', line 17 def success @process_status == 'success' end |