Module: Adyen
- Defined in:
- lib/adyen.rb,
lib/adyen/api.rb,
lib/adyen/api.rb,
lib/adyen/form.rb,
lib/adyen/encoding.rb,
lib/adyen/matchers.rb,
lib/adyen/formatter.rb,
lib/adyen/notification.rb
Overview
XML template constants
Defined Under Namespace
Modules: API, Encoding, Form, Formatter, Matchers Classes: Notification
Constant Summary collapse
- VERSION =
Version constant for the Adyen plugin. DO NOT CHANGE THIS VALUE BY HAND. It will be updated automatically by the gem:release rake task.
"0.3.8.20101015"
- LIVE_RAILS_ENVIRONMENTS =
The Rails environment for which to use to Adyen “live” environment.
['production']
Class Method Summary collapse
-
.autodetect_environment ⇒ 'test', 'live'
Autodetects the Adyen environment based on the RAILS_ENV constant.
-
.const_missing(sym) ⇒ Module
Loads submodules on demand, so that dependencies are not required.
-
.environment(override = nil) ⇒ 'test', 'live'
Returns the current Adyen environment, either test or live.
-
.environment=(env) ⇒ Object
Setter voor the current Adyen environment.
-
.load_config(hash, mod = Adyen) ⇒ Object
Loads configuration settings from a Hash.
Class Method Details
.autodetect_environment ⇒ 'test', 'live'
Autodetects the Adyen environment based on the RAILS_ENV constant.
60 61 62 |
# File 'lib/adyen.rb', line 60 def self.autodetect_environment (defined?(RAILS_ENV) && Adyen::LIVE_RAILS_ENVIRONMENTS.include?(RAILS_ENV.to_s.downcase)) ? 'live' : 'test' end |
.const_missing(sym) ⇒ Module
Loads submodules on demand, so that dependencies are not required.
68 69 70 71 72 73 |
# File 'lib/adyen.rb', line 68 def self.const_missing(sym) require "adyen/#{sym.to_s.downcase}" return Adyen.const_get(sym) rescue Exception super(sym) end |
.environment(override = nil) ⇒ 'test', 'live'
Returns the current Adyen environment, either test or live.
It will return the override
value if set, it will return the value set using environment= otherwise. If this value also isn’t set, the environment is determined with autodetect_environment.
54 55 56 |
# File 'lib/adyen.rb', line 54 def self.environment(override = nil) override || @environment || Adyen.autodetect_environment end |
.environment=(env) ⇒ Object
Setter voor the current Adyen environment.
42 43 44 |
# File 'lib/adyen.rb', line 42 def self.environment=(env) @environment = env end |
.load_config(hash, mod = Adyen) ⇒ Object
Loads configuration settings from a Hash.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/adyen.rb', line 25 def self.load_config(hash, mod = Adyen) hash.each do |key, value| if key.to_s =~ /^[a-z]/ && mod.respond_to?(:"#{key}=") mod.send(:"#{key}=", value) elsif key.to_s =~ /^[A-Z]/ self.load_config(value, mod.const_get(key)) else raise "Unknown configuration variable: '#{key}' for #{mod}" end end end |