class Payture::Ewallet::Config

Attributes

currency[R]
host[R]

required

logger[R]

optional

merchant_id[R]
open_timeout[R]
password[R]
timeout[R]

Public Class Methods

new(**options) click to toggle source
# 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!
end

Public Instance Methods

base_url() click to toggle source
# File lib/payture/ewallet/config.rb, line 28
def base_url
  "https://#{host}/vwapi"
end

Private Instance Methods

check_required_fields!() click to toggle source
# File lib/payture/ewallet/config.rb, line 34
def check_required_fields!
  unless host && merchant_id && password && currency
    raise ArgumentError,
      'Required options: host, merchant_id, password, currency'
  end
end