Class: Transbank::TransaccionCompleta::Base

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

Constant Summary collapse

DEFAULT_API_KEY =
'579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C'.freeze
DEFAULT_COMMERCE_CODE =
'597055555530'.freeze
DEFAULT_MALL_COMMERCE_CODE =
'597055555551'.freeze
DEFAULT_MALL_CHILD_COMMERCE_CODES =
['597055555552'.freeze, '597055555553'.freeze].freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



20
21
22
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 20

def api_key
  @api_key
end

.commerce_codeObject

Returns the value of attribute commerce_code.



20
21
22
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 20

def commerce_code
  @commerce_code
end

.integration_typeObject

Returns the value of attribute integration_type.



20
21
22
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 20

def integration_type
  @integration_type
end

.integration_typesObject (readonly)

Returns the value of attribute integration_types.



19
20
21
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 19

def integration_types
  @integration_types
end

Class Method Details

.configure_for_testingObject



41
42
43
44
45
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 41

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

.current_integration_type_urlObject



30
31
32
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 30

def current_integration_type_url
  @integration_types[@integration_type]
end

.integration_type_url(integration_type) ⇒ Object



23
24
25
26
27
28
# File 'lib/transbank/sdk/transaccion_completa/base.rb', line 23

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::Webpay::Errors::IntegrationTypeError, "Invalid integration type, valid values are #{valid_values}"
end