Module: Adyen

Defined in:
lib/adyen.rb,
lib/adyen/form.rb,
lib/adyen/soap.rb,
lib/adyen/encoding.rb,
lib/adyen/matchers.rb,
lib/adyen/formatter.rb,
lib/adyen/notification.rb

Defined Under Namespace

Modules: Encoding, Form, Formatter, Matchers, SOAP Classes: Notification

Constant Summary collapse

LIVE_RAILS_ENVIRONMENTS =
['production']

Class Method Summary collapse

Class Method Details

.autodetect_environmentObject

Autodetects the Adyen environment based on the RAILS_ENV constant



17
18
19
# File 'lib/adyen.rb', line 17

def self.autodetect_environment
  (defined?(RAILS_ENV) && Adyen::LIVE_RAILS_ENVIRONMENTS.include?(RAILS_ENV.to_s.downcase)) ? 'live' : 'test'
end

.const_missing(sym) ⇒ Object

Loads submodules on demand, so that dependencies are not required.



22
23
24
25
26
27
# File 'lib/adyen.rb', line 22

def self.const_missing(sym)
  require "adyen/#{sym.to_s.downcase}"
  return Adyen.const_get(sym)
rescue
  super(sym)
end

.environment(override = nil) ⇒ Object

Returns the current Adyen environment. Returns either ‘test’ or ‘live’.



12
13
14
# File 'lib/adyen.rb', line 12

def self.environment(override = nil)
  override || @environment || Adyen.autodetect_environment
end

.environment=(env) ⇒ Object

Setter voor the current Adyen environment. Must be either ‘test’ or ‘live’



6
7
8
# File 'lib/adyen.rb', line 6

def self.environment=(env)
  @environment = env
end