Method: Datatrans::Config#initialize
- Defined in:
- lib/datatrans/config.rb
permalink #initialize(options = {}) ⇒ Config
Configure with following options
-
:merchant_id (required)
-
:sign_key (defaults to false)
-
:environment (defaults to :development, available environments are defined in ENVIRONMENTS)
-
:proxy (a hash containing :http_proxyaddr, :http_proxyport, :http_proxyuser, :http_proxypass)
33 34 35 36 37 38 39 |
# File 'lib/datatrans/config.rb', line 33 def initialize( = {}) @merchant_id = [:merchant_id] raise ArgumentError.new(":merchant_id is required") unless self.merchant_id self.environment = [:environment] || DEFAULT_ENVIRONMENT @sign_key = [:sign_key] || DEFAULT_SIGN_KEY @proxy = [:proxy] || {} end |