Class: Stall::PaymentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/stall/payments_controller.rb

Instance Method Summary collapse

Instance Method Details

#notifyObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/stall/payments_controller.rb', line 9

def notify
  service = Stall.config.service_for(:payment_notification).new(params[:gateway], request)
  service.call

  # TODO : This is not the cleanest solution but an API change here would
  #        imply to rewrite most of the existing gateways.
  #
  #        This should be done as soon as we can to avoid keeping this
  #        dirty fix for too long
  #
  if (redirect_location = service.rendering_options[:redirect_location])
    redirect_to redirect_location
  else
    render service.rendering_options
  end
end