Bom dia a todos!
Estou com problema para testar o cancelamento no ambiente de homologação no estado de Goiás.
O certificado do componente está correto, pego pra verificar o CNPJ em acbrnfe1.SSL.acbrNFe1.SSL.CertCNPJ.
O CNPJ do emitente eu pego pra verificar em acbrNFe1.NotasFiscais.Items[0].NFe.Emit.CNPJCPF.
Os dois acima são identicos.
A nota fiscal passa normalmente, quando vou testar o cancelamento volta a rejeição 213, CNPJ-Base do emitente difere do CNPJ-Base do Certificado digital.
carrego a NFe pelo xml, carrego o certificado pelo caminho do pfx no acbrNFe1.Configuracoes.Certificados.ArquivoPFX e a senha no acbrNFe1.Configuracoes.Certificados.Senha.
SSLCryptlib = cryOpenSSL
SSLHttpLib = HttpOpenSSL
SSLlib = libOpenSSL
SSLXMLSignLib = xsLibXml2
Código:
acbrNFe1.NotasFiscais.Clear;
acbrNFe1.NotasFiscais.LoadFromFile(QrySai.FieldByName('arqnfe').AsString);
acbrNFe1.Configuracoes.Certificados.ArquivoPFX:=QryEmpresa.FieldByName('pathcertificado').AsString;
acbrNFe1.Configuracoes.Certificados.Senha:=QryEmpresa.FieldByName('senhacertificado').AsString;
ACBrNFe1.EventoNFe.Evento.Clear;
vNumeroLote:=StrToInt(FormatDateTime('yymmddhhmm',now));
with ACBrNFe1.EventoNFe.Evento.New do begin
if cbAmbiente.ItemIndex=0 then InfEvento.tpAmb := taProducao else InfEvento.tpAmb := taHomologacao;
infEvento.chNFe := formCancelamento.edCancChave.Text;
infEvento.CNPJ := QryCli.FieldByName('cgc').AsString;
infEvento.dhEvento := now;
infEvento.tpEvento := teCancelamento;
infEvento.detEvento.xJust := formCancelamento.edCancJustificativa.Text;
infEvento.detEvento.nProt := copy(formCancelamento.edCancProtocolo.Text,0,15);
end;
ShowMessage('Certificado:'+acbrNFe1.SSL.CertCNPJ+'-');
ShowMessage('Empresa+'+acbrNFe1.NotasFiscais.Items[0].NFe.Emit.CNPJCPF+'-');
ACBrNFe1.EnviarEvento(vNumeroLote);
if acbrNFe1.WebServices.EnvEvento.EventoRetorno.retEvento.Items[0].RetInfEvento.cStat=101 then begin
Se alguem puder me ajudar!