Class: Payture::Ewallet::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/payture/ewallet/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Config

Returns a new instance of Config.



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/payture/ewallet/config.rb', line 16

def initialize(**options)
  @host = options[:host]
  @merchant_id = options[:merchant_id]
  @password = options[:password]
  @currency = options[:currency]
  @logger = options[:logger]
  @timeout = options[:timeout]
  @open_timeout = options[:open_timeout]

  check_required_fields!
  update_money_rounding_mode
end

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



9
10
11
# File 'lib/payture/ewallet/config.rb', line 9

def currency
  @currency
end

#hostObject (readonly)

required



6
7
8
# File 'lib/payture/ewallet/config.rb', line 6

def host
  @host
end

#loggerObject (readonly)

optional



12
13
14
# File 'lib/payture/ewallet/config.rb', line 12

def logger
  @logger
end

#merchant_idObject (readonly)

Returns the value of attribute merchant_id.



7
8
9
# File 'lib/payture/ewallet/config.rb', line 7

def merchant_id
  @merchant_id
end

#open_timeoutObject (readonly)

Returns the value of attribute open_timeout.



14
15
16
# File 'lib/payture/ewallet/config.rb', line 14

def open_timeout
  @open_timeout
end

#passwordObject (readonly)

Returns the value of attribute password.



8
9
10
# File 'lib/payture/ewallet/config.rb', line 8

def password
  @password
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



13
14
15
# File 'lib/payture/ewallet/config.rb', line 13

def timeout
  @timeout
end

Instance Method Details

#base_urlObject



29
30
31
# File 'lib/payture/ewallet/config.rb', line 29

def base_url
  "http://#{host}/vwapi"
end