Class: Superpay::Configuracao

Inherits:
Object
  • Object
show all
Defined in:
lib/superpay/configuracao.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ambienteObject

Returns the value of attribute ambiente.



6
7
8
# File 'lib/superpay/configuracao.rb', line 6

def ambiente
  @ambiente
end

#estabelecimentoObject

Returns the value of attribute estabelecimento.



6
7
8
# File 'lib/superpay/configuracao.rb', line 6

def estabelecimento
  @estabelecimento
end

#senhaObject

Returns the value of attribute senha.



6
7
8
# File 'lib/superpay/configuracao.rb', line 6

def senha
  @senha
end

#usuarioObject

Returns the value of attribute usuario.



6
7
8
# File 'lib/superpay/configuracao.rb', line 6

def usuario
  @usuario
end

Class Method Details

.instanceObject



8
9
10
# File 'lib/superpay/configuracao.rb', line 8

def self.instance
  @__instance__ ||= new
end

Instance Method Details

#ambiente_producao?Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/superpay/configuracao.rb', line 24

def ambiente_producao?
  return (ambiente.to_sym == :producao) if !ambiente.blank?
  return true
end

#ambiente_teste?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/superpay/configuracao.rb', line 20

def ambiente_teste?
  !ambiente_producao?
end

#urlObject



12
13
14
15
16
17
18
# File 'lib/superpay/configuracao.rb', line 12

def url
  if ambiente_producao?
    return 'https://superpay2.superpay.com.br/checkout/servicosPagamentoCompletoWS.Services?wsdl'
  else
    return 'http://homologacao2.superpay.com.br/checkout/servicosPagamentoCompletoWS.Services?wsdl'
  end
end