Repository navigation
fix(nfe client): signed events and inutilizacao never reached the payload - #167
Merged
rvalyi merged 2 commits intoOct 7, 2026
Merged
Conversation
…load The empty placeholders serialize as self-closing tags (<evento versao="1.00"/>, <inutNFe versao="4.00"/>), so the placeholder expressions never matched and prepare_payload silently sent an empty nfeDadosMsg: cancelamento, CC-e and inutilizacao could not work. - enviar_lote_evento: build the envEvento batch (idLote + placeholder evento) with the global element class and inject the joined signed events, as the MD-e client does. - envia_inutilizacao: also match the self-closing placeholder. - carta_correcao: build the evento global element instead of the Tevento type, which serialized as <TEvento xmlns=""> with ns1 prefixed children. The mocked tests now assert the signed content is in the outgoing payload. Checked against the SVRS homologation environment: CC-e and cancelamento registered (cStat 135), inutilizacao homologated (cStat 102).
Contributor
Author
|
A falha do Python 3.13 é só o |
Member
|
Pode ajustar o fingerprint no PR depois eu vejo de atualizar o esquema. Tem falsos positivos nesses sistema de fingerprint,mas pelo menos deteta as mudanças TB... |
Contributor
Author
|
@rvalyi feito! |
CristianoMafraJunior
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Os placeholders vazios viram tags auto-fechadas (
<evento versao="1.00"/>,<inutNFe versao="4.00"/>). As regex nunca casavam, e oprepare_payloadmandava onfeDadosMsgvazio sem avisar, então cancelamento, CC-e e inutilização peloNfeClientnão funcionavam. A CC-e ainda era montada com o tipoTeventoe saía como<TEvento xmlns="">.enviar_lote_evento: monta oenvEvento(idLote + evento placeholder) com o elemento global e injeta os eventos assinados, como o cliente de MD-e;envia_inutilizacao: a regex aceita o placeholder auto-fechado;carta_correcao: usa o elemento globalevento.Os testes mockados agora conferem que o conteúdo assinado está no payload. Testado em homologação na SVRS (pela OCA/l10n-brazil#4147): CC-e e cancelamento registrados (cStat 135), inutilização homologada (cStat 102).
🤖 Generated with Claude Code