Class: Transbank::Patpass::PatpassComercio::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/transbank/sdk/patpass/patpass_comercio/base.rb

Constant Summary collapse

DEFAULT_API_KEY =
'cxxXQgGD9vrVe4M41FIt'.freeze
DEFAULT_COMMERCE_CODE =
'28299257'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



18
19
20
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 18

def api_key
  @api_key
end

.commerce_codeObject

Returns the value of attribute commerce_code.



18
19
20
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 18

def commerce_code
  @commerce_code
end

.integration_typeObject

Returns the value of attribute integration_type.



18
19
20
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 18

def integration_type
  @integration_type
end

.integration_typesObject (readonly)

Returns the value of attribute integration_types.



17
18
19
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 17

def integration_types
  @integration_types
end

Class Method Details

.configure_for_testingObject



38
39
40
41
42
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 38

def configure_for_testing
  @api_key = DEFAULT_API_KEY
  @commerce_code = DEFAULT_COMMERCE_CODE
  self.integration_type = :TEST
end

.current_integration_type_urlObject



27
28
29
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 27

def current_integration_type_url
  @integration_types[@integration_type]
end

.integration_type_url(integration_type) ⇒ Object



20
21
22
23
24
25
# File 'lib/transbank/sdk/patpass/patpass_comercio/base.rb', line 20

def integration_type_url(integration_type)
  type = integration_type.upcase.to_sym
  return @integration_types[type] unless @integration_types[type].nil?
  valid_values = @integration_types.keys.join(', ')
  raise Transbank::Patpass::Errors::IntegrationTypeError, "Invalid integration type, valid values are #{valid_values}"
end