• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wmixvideo / nfe / #6519

27 Jun 2025 08:00PM UTC coverage: 51.231% (-0.08%) from 51.306%
#6519

push

web-flow
Implementa Classes referente ao Qr-Code 3.0 conforme Nota Técnica 2025.001 v.1.01 (#1048)

4 of 47 new or added lines in 5 files covered. (8.51%)

14006 of 27339 relevant lines covered (51.23%)

0.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/fincatto/documentofiscal/nfe400/utils/qrcode30/NFGeraQRCode30.java
1
package com.fincatto.documentofiscal.nfe400.utils.qrcode30;
2

3
import com.fincatto.documentofiscal.DFAmbiente;
4
import com.fincatto.documentofiscal.nfe.NFeConfig;
5
import com.fincatto.documentofiscal.nfe400.classes.nota.NFNota;
6
import com.fincatto.documentofiscal.utils.DFAssinaturaDigital;
7
import org.apache.commons.lang3.StringUtils;
8

9
/**
10
 * Classe abstrata para a implementação da geração do QRCode 3.0.
11
 * Deve ser feita a implementação para emissão normal (1) e para contingência offline (9).
12
 */
13
public abstract class NFGeraQRCode30 {
14

15
    public static final String VERSAO_QRCODE = "3";
16

17
    protected final NFNota nota;
18
    protected final NFeConfig config;
19

NEW
20
    public NFGeraQRCode30(final NFNota nota, final NFeConfig config) {
×
NEW
21
        this.nota = nota;
×
NEW
22
        this.config = config;
×
NEW
23
    }
×
24

25
    /**
26
     * Método responsável pela geração do qrcode.
27
     *
28
     * @return URL para consulta da nota via qrcode30.
29
     * @throws Exception
30
     */
31
    public abstract String getQRCode() throws Exception;
32

33
    public String getUrlQRCode() {
NEW
34
        String url = this.config.getAmbiente().equals(DFAmbiente.PRODUCAO) ? this.nota.getInfo().getIdentificacao().getUf().getQrCodeProducao() : this.nota.getInfo().getIdentificacao().getUf().getQrCodeHomologacao();
×
35

NEW
36
        if (StringUtils.isBlank(url)) {
×
NEW
37
            throw new IllegalArgumentException("URL para consulta do QRCode nao informada para uf " + this.nota.getInfo().getIdentificacao().getUf() + "!");
×
38
        }
39

NEW
40
        return url;
×
41
    }
42

43
    public String assinar(final String parametros) throws Exception {
NEW
44
        return new DFAssinaturaDigital(config).assinarString(parametros);
×
45
    }
46

47
    public String urlConsultaChaveAcesso() {
NEW
48
        return this.config.getAmbiente().equals(DFAmbiente.PRODUCAO) ? this.nota.getInfo().getIdentificacao().getUf().getConsultaChaveAcessoProducao() : this.nota.getInfo().getIdentificacao().getUf().getConsultaChaveAcessoHomologacao();
×
49
    }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc