Class: BrNfe::Service::Simpliss::V1::Base

Inherits:
Base show all
Defined in:
lib/br_nfe/service/simpliss/v1/base.rb

Instance Attribute Summary

Attributes inherited from Base

#password, #username

Attributes inherited from Base

#certificate_pkcs12_password, #certificate_pkcs12_path, #certificate_pkcs12_value, #env, #ibge_code_of_issuer_city, #ibge_code_of_issuer_uf

Attributes inherited from ActiveModelBase

#reference

Instance Method Summary collapse

Methods inherited from Base

#body_xml_path, #nfse_xml_path, #request, #response_root_path

Methods included from Concerns::ValuesTs::ServiceV1

#ts_aliquota, #ts_art, #ts_bairro, #ts_cep, #ts_cnpj, #ts_codigo_cancelamento_nfse, #ts_codigo_cnae, #ts_codigo_mensagem_alerta, #ts_codigo_municipio_ibge, #ts_codigo_obra, #ts_codigo_tributacao, #ts_codigo_verificacao, #ts_complemento_endereco, #ts_cpf, #ts_date, #ts_datetime, #ts_descricao_mensagem_alerta, #ts_discriminacao, #ts_email, #ts_endereco, #ts_id_tag, #ts_indicacao_cpf_cnpj, #ts_inscricao_municipal, #ts_item_lista_servico, #ts_natureza_operacao, #ts_nome_fantasia, #ts_numero_endereco, #ts_numero_lote, #ts_numero_nfse, #ts_numero_protocolo, #ts_numero_rps, #ts_outras_informacoes, #ts_quantidade_rps, #ts_razao_social, #ts_regime_especial_tributacao, #ts_serie_rps, #ts_sim_nao, #ts_situacao_lote_rps, #ts_status_nfse, #ts_status_rps, #ts_telefone, #ts_tipo_rps, #ts_uf, #ts_valor

Methods inherited from Base

#certificado_obrigatorio?, #certificate, #certificate=, #certificate_key, #certificate_key=, #certificate_pkcs12, #certificate_pkcs12=, #client_wsdl, #env_namespace, #env_test?, #find_xml, #get_xml_dirs, #id_attribute?, #method_wsdl, #original_response, #render_xml, #response, #response_encoding, #sign_xml, #signature_type, #signature_type?, #soap_xml, #ssl_request?, #ssl_version, #tag_xml, #wsdl_encoding, #xml_builder, #xml_default_dir_path, #xml_version

Methods included from Association::HaveEmitente

#emitente, #emitente=

Methods inherited from ActiveModelBase

#assign_attributes, #default_values, #initialize

Constructor Details

This class inherits a constructor from BrNfe::ActiveModelBase

Instance Method Details

#canonicalization_method_algorithmObject



26
27
28
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 26

def canonicalization_method_algorithm
  'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
end

#content_xmlObject

Método é sobrescrito para atender o padrão do órgão emissor. Deve ser enviado o XML da requsiução dentro da tag CDATA seguindo a estrutura requerida.

<b><Tipo de retorno: /b> String XML



71
72
73
74
75
76
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 71

def content_xml
  dados = "<ns3:#{soap_body_root_tag}>"
  dados += xml_builder.html_safe
  dados += "</ns3:#{soap_body_root_tag}>"
  dados
end

#message_namespacesObject



30
31
32
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 30

def message_namespaces
  {}
end

#namespace_for_signatureObject



51
52
53
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 51

def namespace_for_signature
  'ns2:'
end

#namespace_for_tagsObject



47
48
49
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 47

def namespace_for_tags
  'ns1:'
end

#namespace_identifierObject



43
44
45
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 43

def namespace_identifier
  'ns3:'
end

#soap_body_root_tagObject

Método que deve ser sobrescrito em cada subclass. É utilizado para saber qual a tag root de cada requisição

<b><Tipo de retorno: /b> String



60
61
62
63
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 60

def soap_body_root_tag
  # 'recepcionarLoteRps' < Exemplo
  raise "Deve ser sobrescrito nas subclasses"
end

#soap_namespacesObject



34
35
36
37
38
39
40
41
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 34

def soap_namespaces
  super.merge({
    'xmlns:ns1' => "http://www.sistema.com.br/Nfse/arquivos/nfse_3.xsd",
    'xmlns:ns2' => "http://www.w3.org/2000/09/xmldsig#",
    'xmlns:ns3' => "http://www.sistema.com.br/Sistema.Ws.Nfse",
    'xmlns:ns4' => "http://www.sistema.com.br/Sistema.Ws.Nfse.Cn"
  })
end

#wsdlObject



7
8
9
10
11
12
13
14
15
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 7

def wsdl
  if env == :test
    'http://wshomologacao.simplissweb.com.br/nfseservice.svc?wsdl'
  elsif ibge_code_of_issuer_city == '4202008' # Balneário Camboriú
    'http://wsbalneariocamboriu.simplissweb.com.br/nfseservice.svc?wsdl'
  else # Se não encontrar a cidade pega por padrão o WS de homologação
    'http://wshomologacao.simplissweb.com.br/nfseservice.svc?wsdl'
  end
end

#xml_current_dir_pathObject

Declaro que o método ‘render_xml` irá verificar os arquivos também presentes no diretório especificado

Tipo de retorno: Array



22
23
24
# File 'lib/br_nfe/service/simpliss/v1/base.rb', line 22

def xml_current_dir_path
  ["#{BrNfe.root}/lib/br_nfe/service/simpliss/v1/xml"]+super
end