Class: Payoneer::Configuration

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

Constant Summary collapse

DEVELOPMENT_ENVIRONMENT =
'development'
PRODUCTION_ENVIRONMENT =
'production'
DEVELOPMENT_API_URL =
'https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx?'
PRODUCTION_API_URL =
'https://api.payoneer.com/Payouts/HttpApi/API.aspx?'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
# File 'lib/payoneer/configuration.rb', line 10

def initialize
  @environment = DEVELOPMENT_ENVIRONMENT
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



8
9
10
# File 'lib/payoneer/configuration.rb', line 8

def environment
  @environment
end

#partner_api_passwordObject

Returns the value of attribute partner_api_password.



8
9
10
# File 'lib/payoneer/configuration.rb', line 8

def partner_api_password
  @partner_api_password
end

#partner_idObject

Returns the value of attribute partner_id.



8
9
10
# File 'lib/payoneer/configuration.rb', line 8

def partner_id
  @partner_id
end

#partner_usernameObject

Returns the value of attribute partner_username.



8
9
10
# File 'lib/payoneer/configuration.rb', line 8

def partner_username
  @partner_username
end

Instance Method Details

#api_urlObject



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

def api_url
  environment == PRODUCTION_ENVIRONMENT ? PRODUCTION_API_URL : DEVELOPMENT_API_URL
end

#validate!Object



18
19
20
# File 'lib/payoneer/configuration.rb', line 18

def validate!
  fail Errors::ConfigurationError unless partner_id && partner_username && partner_api_password
end