Conditions | 1 |
Total Lines | 21 |
Code Lines | 18 |
Lines | 21 |
Ratio | 100 % |
Tests | 3 |
CRAP Score | 1 |
Changes | 0 |
1 | """tfd http://www.sat.gob.mx/TimbreFiscalDigital""" |
||
22 | 1 | def __init__( |
|
23 | self, |
||
24 | proveedor: Signer, |
||
25 | uuid: str, |
||
26 | fecha_timbrado: datetime, |
||
27 | sello_cfd: str, |
||
28 | leyenda: str = None, |
||
29 | ): |
||
30 | 1 | super().__init__({ |
|
31 | 'Version': self.version, |
||
32 | 'UUID': uuid, |
||
33 | 'FechaTimbrado': fecha_timbrado or datetime.now(tz=MEXICO_TZ).replace(tzinfo=None), |
||
34 | 'RfcProvCertif': proveedor.rfc_pac, |
||
35 | 'SelloCFD': sello_cfd, |
||
36 | 'NoCertificadoSAT': proveedor.certificate_number, |
||
37 | 'SelloSAT': '', |
||
38 | 'Leyenda': leyenda, |
||
39 | }) |
||
40 | |||
41 | 1 | self['SelloSAT'] = proveedor.sign_sha256( |
|
42 | self.cadena_original().encode() |
||
43 | ) |
||
44 |