Class: MandarinApi::Responder
- Inherits:
-
Object
- Object
- MandarinApi::Responder
- Defined in:
- lib/mandarin_api/responder.rb
Overview
Processes callbacks from mandarinpay
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.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/mandarin_api/responder.rb', line 5 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 Method Details
#failure ⇒ Object
20 21 22 |
# File 'lib/mandarin_api/responder.rb', line 20 def failure @process_status == 'failed' end |
#success ⇒ Object
16 17 18 |
# File 'lib/mandarin_api/responder.rb', line 16 def success @process_status == 'success' end |