Class: WorldpayCnp::Configuration

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

Constant Summary collapse

ENVIRONMENTS =
{
  sandbox: "https://www.testvantivcnp.com/sandbox/communicator/online",
  prelive: "https://payments.vantivprelive.com/vap/communicator/online",
  production: "https://payments.vantivcnp.com/vap/communicator/online"
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Configuration

Returns a new instance of Configuration.



19
20
21
22
# File 'lib/worldpay_cnp/configuration.rb', line 19

def initialize(**options)
  set_defaults
  set_config(options)
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def environment
  @environment
end

#merchant_idObject (readonly)

Returns the value of attribute merchant_id.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def merchant_id
  @merchant_id
end

#passwordObject (readonly)

Returns the value of attribute password.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def password
  @password
end

#proxyObject (readonly)

Returns the value of attribute proxy.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def proxy
  @proxy
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def timeout
  @timeout
end

#usernameObject (readonly)

Returns the value of attribute username.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def username
  @username
end

#versionObject (readonly)

Returns the value of attribute version.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def version
  @version
end

#xml_namespaceObject (readonly)

Returns the value of attribute xml_namespace.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def xml_namespace
  @xml_namespace
end

#xml_request_rootObject (readonly)

Returns the value of attribute xml_request_root.



9
10
11
# File 'lib/worldpay_cnp/configuration.rb', line 9

def xml_request_root
  @xml_request_root
end

Instance Method Details

#api_urlObject



24
25
26
# File 'lib/worldpay_cnp/configuration.rb', line 24

def api_url
  @api_url ||= ENVIRONMENTS[@environment.to_sym]
end