public string CadenaComprobante(string [] valores, XmlDocument documentoXml) { string resultado = string.Empty; try { EsquemaComprobanteReceptor comprobante = new EsquemaComprobanteReceptor(); comprobante = CrearComprobanteReceptor(valores, documentoXml); resultado = new JavaScriptSerializer().Serialize(comprobante); } catch (Exception ex) { throw new Exception("Error en metodo CadenaComprobanteReceptor", ex); } return(resultado); }
public EsquemaComprobanteReceptor CrearComprobanteReceptor(string [] valores, XmlDocument documentoXml) { //{ "Clave", "FechaEmision", "TipoEmisor", "IdentificacionEmisor", "TipoReceptor","IdentificacionReceptor", "TotalImpuesto", "TotalComprobante" ,"NumeroConsecutivoReceptor"}; EsquemaComprobanteReceptor comprobante = new EsquemaComprobanteReceptor() { clave = valores[0], fecha = DateTime.UtcNow.ToString(EngineData.dateFormat), emisor = new EsquemaComprobanteReceptor.EmisorType() { tipoIdentificacion = valores[2], numeroIdentificacion = valores[3] }, receptor = new EsquemaComprobanteReceptor.ReceptorType() { tipoIdentificacion = valores[4], numeroIdentificacion = valores[5] }, callbackUrl = Valor.UrlDevolucionLlamadaReceptor(), consecutivoReceptor = valores[8], comprobanteXml = ConvertirBase64(documentoXml) }; return(comprobante); }