se adiciona comandos soap send-bill-async,send-bill-sync,get-status-zip
FossilOrigin-Name: e3ab64b71d8bfb3acc50f813aec9b97c45cd80c2c4f38e23804d1f17f058ffdf
This commit is contained in:
		| @@ -80,7 +80,7 @@ class ConsultaResolucionesFacturacionPeticion(SOAPService): | ||||
|         return ConsultaResolucionesFacturacionRespuesta.fromdict(as_dict) | ||||
|  | ||||
| @dataclass | ||||
| class SendBillAsync: | ||||
| class SendBillAsync(SOAPService): | ||||
|     fileName: str | ||||
|     contentFile: str | ||||
|  | ||||
| @@ -91,7 +91,7 @@ class SendBillAsync: | ||||
|         return 'SendBillAsync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
|         return {} | ||||
|         return as_dict | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -108,7 +108,7 @@ class SendTestSetAsync(SOAPService): | ||||
|         return 'SendTestSetAsync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
|         return {} | ||||
|         return as_dict | ||||
|  | ||||
| @dataclass | ||||
| class SendBillSync(SOAPService): | ||||
| @@ -122,7 +122,7 @@ class SendBillSync(SOAPService): | ||||
|         return 'SendBillSync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
|         return {} | ||||
|         return as_dict | ||||
|  | ||||
|  | ||||
| @dataclass | ||||
| @@ -136,12 +136,31 @@ class GetStatus(SOAPService): | ||||
|         return 'GetStatus' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
|         return {} | ||||
|         return as_dict | ||||
|  | ||||
| @dataclass | ||||
| class GetStatusZip(SOAPService): | ||||
|     trackId: bytes | ||||
|  | ||||
|     def get_wsdl(self): | ||||
|         return 'https://colombia-dian-webservices-input-sbx.azurewebsites.net/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def get_service(self): | ||||
|         return 'GetStatusZip' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
|         return as_dict | ||||
|  | ||||
|  | ||||
| class Habilitacion: | ||||
|     WSDL = 'https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|  | ||||
|     class SendBillAsync(SendBillAsync): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|  | ||||
|     class SendBillSync(SendBillSync): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
| @@ -153,6 +172,10 @@ class Habilitacion: | ||||
|     class GetStatus(GetStatus): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class GetStatusZip(GetStatusZip): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|          | ||||
|  | ||||
| class DianGateway: | ||||
| @@ -200,12 +223,11 @@ class DianSignatureClient(DianGateway): | ||||
|         from zeep.wsse import utils | ||||
|  | ||||
|         client = zeep.Client(service.get_wsdl(), wsse= | ||||
|                            [ | ||||
|                                BinarySignature( | ||||
|                                    self.private_key_path, self.public_key_path, self.password, | ||||
|                                    signature_method=xmlsec.Transform.RSA_SHA256, | ||||
|                                    digest_method=xmlsec.Transform.SHA256) | ||||
|                            ], | ||||
|                              BinarySignature( | ||||
|                                  self.private_key_path, self.public_key_path, self.password, | ||||
|                                  signature_method=xmlsec.Transform.RSA_SHA256, | ||||
|                                  digest_method=xmlsec.Transform.SHA256) | ||||
|                              , | ||||
|         ) | ||||
|         return client | ||||
|      | ||||
|   | ||||
| @@ -346,6 +346,9 @@ def _verify_envelope_with_key(envelope, key): | ||||
|  | ||||
|     security = header.find(QName(ns.WSSE, "Security")) | ||||
|     signature = security.find(QName(ns.DS, "Signature")) | ||||
|     # la DIAN no cumple a cabalidad token-profile 1.0 | ||||
|     if signature is None: | ||||
|         return SignatureVerificationFailed() | ||||
|  | ||||
|     ctx = xmlsec.SignatureContext() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user