Class: DefraRubyMocks::WorldpayController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- DefraRubyMocks::WorldpayController
- Defined in:
- app/controllers/defra_ruby_mocks/worldpay_controller.rb
Instance Method Summary collapse
Instance Method Details
#dispatcher ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/defra_ruby_mocks/worldpay_controller.rb', line 19 def dispatcher @response = WorldpayResponseService.run( success_url: params[:successURL], failure_url: params[:failureURL], pending_url: params[:pendingURL], cancel_url: params[:cancelURL], error_url: params[:errorURL] ) if @response.status == :STUCK render formats: :html, action: "stuck", layout: false else redirect_to @response.url end rescue StandardError => e Rails.logger.error("MOCKS: Worldpay dispatcher error: #{e.}") head 500 end |
#payments_service ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/defra_ruby_mocks/worldpay_controller.rb', line 9 def payments_service @values = WorldpayRequestHandlerService.run(convert_request_body_to_xml) render_payment_response if @values[:request_type] == :payment render_refund_response if @values[:request_type] == :refund rescue StandardError => e Rails.logger.error("MOCKS: Worldpay payments service error: #{e.}") head 500 end |