Class: Transbank::Webpay::Oneclick::Base

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

Constant Summary collapse

DEFAULT_API_KEY =
'579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C'.freeze
DEFAULT_ONECLICK_MALL_COMMERCE_CODE =
'597055555541'.freeze
DEFAULT_ONECLICK_MALL_CHILD_COMMERCE_CODES =
[
  '597055555542'.freeze,
  '597055555543'.freeze
].freeze
DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE =
'597055555547'.freeze
DEFAULT_ONECLICK_MALL_DEFERRED_CHILD_COMMERCE_CODES =
[
  '597055555548'.freeze,
  '597055555549'.freeze
].freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



29
30
31
# File 'lib/transbank/sdk/oneclick/base.rb', line 29

def api_key
  @api_key
end

.commerce_codeObject

Returns the value of attribute commerce_code.



29
30
31
# File 'lib/transbank/sdk/oneclick/base.rb', line 29

def commerce_code
  @commerce_code
end

.integration_typeObject

Returns the value of attribute integration_type.



29
30
31
# File 'lib/transbank/sdk/oneclick/base.rb', line 29

def integration_type
  @integration_type
end

.integration_typesObject (readonly)

Returns the value of attribute integration_types.



28
29
30
# File 'lib/transbank/sdk/oneclick/base.rb', line 28

def integration_types
  @integration_types
end

Class Method Details

.configure_mall_deferred_for_testingObject



55
56
57
58
59
# File 'lib/transbank/sdk/oneclick/base.rb', line 55

def configure_mall_deferred_for_testing
  @api_key = DEFAULT_API_KEY
  @commerce_code = DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE
  self.integration_type = :TEST
end

.configure_mall_for_testingObject



49
50
51
52
53
# File 'lib/transbank/sdk/oneclick/base.rb', line 49

def configure_mall_for_testing
  @api_key = DEFAULT_API_KEY
  @commerce_code = DEFAULT_ONECLICK_MALL_COMMERCE_CODE
  self.integration_type = :TEST
end

.current_integration_type_urlObject



38
39
40
# File 'lib/transbank/sdk/oneclick/base.rb', line 38

def current_integration_type_url
  @integration_types[@integration_type]
end

.integration_type_url(integration_type) ⇒ Object



31
32
33
34
35
36
# File 'lib/transbank/sdk/oneclick/base.rb', line 31

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