Class: Newebpay::PaymentCodeCallbacksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/newebpay/payment_code_callbacks_controller.rb

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_responseObject



7
8
9
# File 'app/controllers/newebpay/payment_code_callbacks_controller.rb', line 7

def newebpay_response
  @newebpay_response ||= Newebpay::MPG::Response.new(params['TradeInfo'])
end

#proceedObject

Raises:

  • (NotImplementedError)


11
12
13
14
15
16
# File 'app/controllers/newebpay/payment_code_callbacks_controller.rb', line 11

def proceed
  raise NotImplementedError, 'Newebpay.config.payment_code_callback is not a proc.' unless Newebpay.config.payment_code_callback.is_a? Proc
  raise InvalidResponseError if params["TradeInfo"].blank?
  instance_exec(Newebpay::MPG::Response.new(params["TradeInfo"]), self, ::Rails.application.routes.url_helpers, &Newebpay.config.payment_code_callback)
  redirect_to '/' unless performed?
end