Class: Gestpay::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/gestpay/configuration.rb

Constant Summary collapse

CURRENCY_MAPPING =
{
  'EUR' => '242',
  'ITL' => '18',
  'BRL' => '234',
  'USD' => '1',
  'JPY' => '71',
  'HKD' => '103'
}
LANGUAGE_MAPPING =
{
  'ITA' => '1'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



18
19
20
21
22
23
# File 'lib/gestpay/configuration.rb', line 18

def initialize
  @environment = ENV['GESTPAY_ENVIRONMENT'] || :test
  @account     = ENV['GESTPAY_ACCOUNT']
  @currency    = 'EUR'
  @language    = 'ITA'
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



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

def 
  @account
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#environmentObject

Returns the value of attribute environment.



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

def environment
  @environment
end

#languageObject

Returns the value of attribute language.



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

def language
  @language
end

Instance Method Details

#currency_codeObject



25
26
27
# File 'lib/gestpay/configuration.rb', line 25

def currency_code
  CURRENCY_MAPPING[@currency]
end

#language_codeObject



29
30
31
# File 'lib/gestpay/configuration.rb', line 29

def language_code
  LANGUAGE_MAPPING[@language]
end