Class: BrNfe::Servico::Betha::V1::Gateway
- Inherits:
-
Base
- Object
- ActiveModelBase
- Base
- BrNfe::Servico::Base
- Base
- BrNfe::Servico::Betha::V1::Gateway
- Defined in:
- lib/br_nfe/servico/betha/v1/gateway.rb
Direct Known Subclasses
CancelamentoNfs, ConsultaLoteRps, ConsultaNfsPorRps, ConsultaNfse, RecepcaoLoteRps
Instance Attribute Summary
Attributes inherited from BrNfe::Servico::Base
#lote_rps, #numero_lote_rps, #operacao
Attributes inherited from Base
#certificado_password, #certificado_path, #certificado_value, #env
Instance Method Summary collapse
- #content_xml ⇒ Object
- #namespace_identifier ⇒ Object
- #namespaces ⇒ Object
- #request ⇒ Object
- #set_response(resp) ⇒ Object
- #version ⇒ Object
Methods inherited from BrNfe::Servico::Base
Methods inherited from Base
#certificado, #certificado=, #certificado_obrigatorio?, #client_wsdl, #env_namespace, #method_wsdl, #original_response, #response, #wsdl, #wsdl_encoding, #xml_builder
Methods included from Helper::HaveEmitente
Methods inherited from ActiveModelBase
#assign_attributes, #default_values, #initialize
Constructor Details
This class inherits a constructor from BrNfe::Servico::Base
Instance Method Details
#content_xml ⇒ Object
36 37 38 |
# File 'lib/br_nfe/servico/betha/v1/gateway.rb', line 36 def content_xml canonicalize(xml_builder).gsub('<Temp>','').gsub('</Temp>','') end |
#namespace_identifier ⇒ Object
10 11 12 |
# File 'lib/br_nfe/servico/betha/v1/gateway.rb', line 10 def namespace_identifier :ns1 end |
#namespaces ⇒ Object
6 7 8 |
# File 'lib/br_nfe/servico/betha/v1/gateway.rb', line 6 def namespaces {"xmlns:ns1" => "http://www.betha.com.br/e-nota-contribuinte-ws"} end |
#request ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/br_nfe/servico/betha/v1/gateway.rb', line 18 def request set_response( client_wsdl.call("#{method_wsdl}_envio".to_sym, message: "#{content_xml}", attributes: {'xmlns:ns1' => 'http://www.betha.com.br/e-nota-contribuinte-ws'} ) ) rescue Savon::SOAPFault => error return @response = BrNfe::Servico::Response::Default.new(success: false, error_messages: [error.]) end |
#set_response(resp) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/br_nfe/servico/betha/v1/gateway.rb', line 29 def set_response(resp) method_response = (method_wsdl.to_s + "_envio_response").to_sym @builder = BrNfe::Servico::Betha::V1::BuildResponse.new(hash: resp.hash[:envelope][:body][method_response], nfe_method: method_wsdl) @original_response = @builder. @response = @builder.response end |
#version ⇒ Object
14 15 16 |
# File 'lib/br_nfe/servico/betha/v1/gateway.rb', line 14 def version :v1 end |