Skip to main content

Module complement

Module complement 

Source
Expand description

Functions for attaching SEFAZ authorization protocols to signed XML documents. Functions for attaching SEFAZ authorization protocols to signed XML documents.

Each submodule handles one type of protocol attachment:

  • [protocol] — NFe authorization (<nfeProc>)
  • [inutilizacao] — Number voiding (<ProcInutNFe>)
  • [event] — Event protocol (<procEventoNFe>)
  • [b2b] — B2B financial wrapper (<nfeProcB2B>)
  • [cancellation] — Cancellation event attachment
  • [helpers] — Internal XML parsing utilities

Functions§

attach_b2b
Attach a B2B financial tag to an authorized <nfeProc> XML, wrapping both in a <nfeProcB2B> element.
attach_cancellation
Attach a cancellation event response to an authorized <nfeProc> XML, marking the NF-e as locally cancelled.
attach_event_protocol
Attach an event protocol response to the event request, producing the <procEventoNFe> wrapper.
attach_inutilizacao
Attach the SEFAZ inutilizacao response to the request, producing the <ProcInutNFe> wrapper.
attach_protocol
Attach the SEFAZ authorization protocol to a signed NFe XML, producing the <nfeProc> wrapper required for storage and DANFE.
to_authorize
Detect the document type from raw XML and dispatch to the correct protocol-attachment function.