Class: CreditGateway::Configuration

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

Constant Summary collapse

BASE_URLS =
{
  production: 'https://api.connector.crifrealtime.com',
  sandbox: 'https://api-sandbox.connector.crifrealtime.com'
}.freeze
AUTH_URLS =
{
  production: 'https://api.connector.crifrealtime.com',
  sandbox: 'https://api-sandbox.connector.crifrealtime.com'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



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

def initialize
  @client_id = ''
  @client_secret = ''
  @country = nil
  @environment = :sandbox # can be either :sandbox or :production
  @debug = false
  @verbose = false
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



14
15
16
# File 'lib/credit_gateway/configuration.rb', line 14

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



14
15
16
# File 'lib/credit_gateway/configuration.rb', line 14

def client_secret
  @client_secret
end

#countryObject

Returns the value of attribute country.



14
15
16
# File 'lib/credit_gateway/configuration.rb', line 14

def country
  @country
end

#debugObject

Returns the value of attribute debug.



14
15
16
# File 'lib/credit_gateway/configuration.rb', line 14

def debug
  @debug
end

#environmentObject

Returns the value of attribute environment.



14
15
16
# File 'lib/credit_gateway/configuration.rb', line 14

def environment
  @environment
end

#verboseObject

Returns the value of attribute verbose.



14
15
16
# File 'lib/credit_gateway/configuration.rb', line 14

def verbose
  @verbose
end

Instance Method Details

#auth_urlObject



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

def auth_url
  AUTH_URLS[environment.to_sym]
end

#base_urlObject



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

def base_url
  BASE_URLS[environment.to_sym]
end