Class: PaymentTest::EngineController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/payment_test/engine_controller.rb

Direct Known Subclasses

PaymentsController

Instance Method Summary collapse

Instance Method Details

#current_tenant_userObject



10
11
12
13
14
15
# File 'app/controllers/payment_test/engine_controller.rb', line 10

def current_tenant_user
  # If the rails application on which that engine is mounted defines such method (Devise), we extract the current user,
  # if not we default to nil, and serve our static mock configuration
  user = current_user if respond_to?(:current_user)
  PaymentTest.current_tenant_user.call(session, user)
end

#get_layoutObject



6
7
8
# File 'app/controllers/payment_test/engine_controller.rb', line 6

def get_layout
  layout ||= PaymentTest.config[:layout]
end

#options_for_klientObject



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/payment_test/engine_controller.rb', line 17

def options_for_klient
  user = current_tenant_user
  {
      :username => user[:username],
      :password => user[:password],
      :session_id => user[:session_id],
      :api_key => user[:api_key],
      :api_secret => user[:api_secret]
  }
end