Class: Newebpay::MPGCallbacksController
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Newebpay::ApplicationController
Instance Method Details
#newebpay_response ⇒ Object
9
10
11
|
# File 'app/controllers/newebpay/mpg_callbacks_controller.rb', line 9
def newebpay_response
@newebpay_response ||= Newebpay::MPG::Response.new(params['TradeInfo'])
end
|
#proceed ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/newebpay/mpg_callbacks_controller.rb', line 13
def proceed
unless Newebpay.config.mpg_callback.is_a? Proc
raise NotImplementedError, 'Newebpay.config.mpg_callback is not a proc.'
end
raise InvalidResponseError if params['TradeInfo'].blank?
instance_exec(Newebpay::MPG::Response.new(params['TradeInfo']), self, ::Rails.application.routes.url_helpers, &Newebpay.config.mpg_callback)
redirect_to '/' unless performed?
end
|