pub fn attach_event_protocol(
request_xml: &str,
response_xml: &str,
) -> Result<String, FiscalError>Expand description
Attach an event protocol response to the event request,
producing the <procEventoNFe> wrapper.
Extracts <evento> from request_xml and <retEvento> from
response_xml, validates the event status, and joins them
into a <procEventoNFe> document.
ยงErrors
Returns FiscalError::XmlParsing if:
- Either input is empty
- The
<evento>tag is missing fromrequest_xml - The
<retEvento>tag is missing fromresponse_xml - The
<idLote>tag is missing fromrequest_xmlorresponse_xml - The
idLotevalues differ between request and response
Returns FiscalError::SefazRejection if the event status code
is not valid (135, 136, or 155 for cancellation only).