Class: MastercardCoreSdk::Core::ApiConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/mastercard_core_sdk/core/api_config.rb

Overview

Set environment details require to call mastercard api.

Constant Summary collapse

CONFIG_NAME_HEADER =
"__config_name__"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, consumer_key, private_key, host_url, additional_properties = {}) ⇒ ApiConfig

Constructs ApiConfig object.

Parameters:

  • name

    the environment name. e.g. “SANDBOX”

  • consumer_key

    the consumer key (Generated from mastercard developer zone).

  • private_key

    the private key, to be fetched from the certificate.

  • host_url

    the environment host url. e.g. “sandbox.api.mastercard.com

  • additional_properties (defaults to: {})

    the additional properties for plugins information.



15
16
17
18
19
20
21
# File 'lib/mastercard_core_sdk/core/api_config.rb', line 15

def initialize(name, consumer_key, private_key, host_url, additional_properties = {})
  @name = name
  @consumer_key = consumer_key
  @private_key = private_key
  @host_url = host_url 
  @additional_properties = additional_properties
end

Instance Attribute Details

#additional_propertiesObject

Returns the value of attribute additional_properties.



7
8
9
# File 'lib/mastercard_core_sdk/core/api_config.rb', line 7

def additional_properties
  @additional_properties
end

#consumer_keyObject

Returns the value of attribute consumer_key.



7
8
9
# File 'lib/mastercard_core_sdk/core/api_config.rb', line 7

def consumer_key
  @consumer_key
end

#host_urlObject

Returns the value of attribute host_url.



7
8
9
# File 'lib/mastercard_core_sdk/core/api_config.rb', line 7

def host_url
  @host_url
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/mastercard_core_sdk/core/api_config.rb', line 7

def name
  @name
end

#private_keyObject

Returns the value of attribute private_key.



7
8
9
# File 'lib/mastercard_core_sdk/core/api_config.rb', line 7

def private_key
  @private_key
end