public ResAcc<string> CancelarFactura(string sUuid, string sRfc, byte[] ArchivoPfx, string sContraseniaPfx) { var Res = new ResAcc<string>(); try { var oServicio = new Edicom.CFDiService(); // Se manda cancelar la factura, prueba o normal if (this.Prueba) { Res.Respuesta = "Resultado de prueba. No hay mecanismo de cancelación en Edicom."; } else { CancelaResponse oCancel = oServicio.cancelaCFDi(this.Usuario, this.Contrasenia, sRfc, new string[] { sUuid }, ArchivoPfx, sContraseniaPfx); Res.Respuesta = oCancel.ack; } Res.Exito = true; } catch (Exception e) { Res.Mensaje = e.Message; } return Res; }
public ResAcc <string> CancelarFactura(string sUuid, string sRfc, byte[] ArchivoPfx, string sContraseniaPfx) { var Res = new ResAcc <string>(); try { var oServicio = new Edicom.CFDiService(); // Se manda cancelar la factura, prueba o normal if (this.Prueba) { Res.Respuesta = "Resultado de prueba. No hay mecanismo de cancelación en Edicom."; } else { CancelaResponse oCancel = oServicio.cancelaCFDi(this.Usuario, this.Contrasenia, sRfc, new string[] { sUuid }, ArchivoPfx, sContraseniaPfx); Res.Respuesta = oCancel.ack; } Res.Exito = true; } catch (Exception e) { Res.Mensaje = e.Message; } return(Res); }
public ResAcc <string> TimbrarFactura(byte[] XmlFactura) { var Res = new ResAcc <string>(); try { var oServicio = new Edicom.CFDiService(); byte[] oCfdiZip; // Se llama el servico de Edicom, prueba o normal if (this.Prueba) { oCfdiZip = oServicio.getCfdiTest(this.Usuario, this.Contrasenia, XmlFactura); } else { oCfdiZip = oServicio.getCfdi(this.Usuario, this.Contrasenia, XmlFactura); } var oZip = new AccesoZip(oCfdiZip); var oCfdi = oZip.ObtenerArchivo(FacturaPac.CfdiNombre); Res.Respuesta = Encoding.UTF8.GetString(oCfdi); Res.Exito = true; } catch (Exception e) { Res.Mensaje = e.Message; } return(Res); }
public ResAcc<string> TimbrarFactura(byte[] XmlFactura) { var Res = new ResAcc<string>(); try { var oServicio = new Edicom.CFDiService(); byte[] oCfdiZip; // Se llama el servico de Edicom, prueba o normal if (this.Prueba) oCfdiZip = oServicio.getCfdiTest(this.Usuario, this.Contrasenia, XmlFactura); else oCfdiZip = oServicio.getCfdi(this.Usuario, this.Contrasenia, XmlFactura); var oZip = new AccesoZip(oCfdiZip); var oCfdi = oZip.ObtenerArchivo(FacturaPac.CfdiNombre); Res.Respuesta = Encoding.UTF8.GetString(oCfdi); Res.Exito = true; } catch (Exception e) { Res.Mensaje = e.Message; } return Res; }