Class: PayU::Configuration

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

Constant Summary collapse

PRODUCTION_ENV_NAME =
"production"
SANDBOX_HOST_URI =
"https://secure.snd.payu.com/"
PRODUCTION_HOST_URI =
"https://secure.payu.com/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



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

def initialize
  @env = PRODUCTION_ENV_NAME
end

Instance Attribute Details

#envObject

Returns the value of attribute env.



23
24
25
# File 'lib/payu.rb', line 23

def env
  @env
end

#notify_urlObject

Returns the value of attribute notify_url.



23
24
25
# File 'lib/payu.rb', line 23

def notify_url
  @notify_url
end

#oauth_client_idObject

Returns the value of attribute oauth_client_id.



23
24
25
# File 'lib/payu.rb', line 23

def oauth_client_id
  @oauth_client_id
end

#oauth_client_secretObject

Returns the value of attribute oauth_client_secret.



23
24
25
# File 'lib/payu.rb', line 23

def oauth_client_secret
  @oauth_client_secret
end

#pos_idObject

Returns the value of attribute pos_id.



23
24
25
# File 'lib/payu.rb', line 23

def pos_id
  @pos_id
end

#second_keyObject

Returns the value of attribute second_key.



23
24
25
# File 'lib/payu.rb', line 23

def second_key
  @second_key
end

Instance Method Details

#hostObject



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

def host
  production? ? PRODUCTION_HOST_URI : SANDBOX_HOST_URI
end

#production?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/payu.rb', line 33

def production?
  @env == PRODUCTION_ENV_NAME
end