Example #1
0
        public static bool IsTransbankReady()
        {
            PipeClient   pipeClient = new PipeClient();
            ServicioPago servicio   = new ServicioPago();

            pipeClient.Message = servicio.BuildMessage(Comandos.Pooling, new List <string> {
                "1"
            });
            // Log.Write("PoolTbk", pipeClient.Message, Evento.Query, Comandos.Pooling);
            pipeClient.SendMessage(Comandos.Pooling);
            try
            {
                if (pipeClient.Resultado.CodigoError == 0)
                {
                    //Log.Write("PoolTbk", pipeClient.Resultado.Data[0], Evento.Response, Comandos.Pooling);
                    return(true);
                }
                else
                {
                    //Log.Write("PoolTbk", pipeClient.Resultado.CodigoError + ": " + pipeClient.Resultado.Data[0], Evento.Response, Comandos.Pooling);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                //Global.log.Error("IsTransbankReady ", ex);

                return(false);
            }
        }
Example #2
0
        public void ActualizarPago(int total, int bonificado, List <int> montos, List <MedioPago> mediosPago)
        {
            try
            {
                PipeClient pipeClient = new PipeClient();

                //Log.Write("RegPagoUpd", pipeClient.Message, Evento.Query, Comandos.PagoUpdate);
                pipeClient.SendMessage(Comandos.PagoUpdate);

                if (pipeClient.Resultado.CodigoError == 0)
                {
                    string msg = string.Join("|", pipeClient.Resultado.Data);
                    // Log.Write("RegPagoUpd", msg, Evento.Response, Comandos.PagoUpdate);
                }
                else
                {
                    // Log.Write("RegPagoUpd", string.Format("{0}: {1}", pipeClient.Resultado.CodigoError, pipeClient.Resultado.Data[0]), Evento.Error, Comandos.PagoUpdate);
                }
            }
            catch (Exception ex)
            {
                // Log.Write("RegPagoUpd", ex.ToString(), Evento.Error, Comandos.PagoUpdate);
                //Global.log.Error("error actualizar pago ", ex);
            }
        }
Example #3
0
        private bool IsPipeServerReady()
        {
            PipeClient pipeClient = new PipeClient();

            try
            {
                pipeClient.Message = BuildMessage(Comandos.EstadoImpresora, new List <string>()
                {
                    "1", "0"
                });
                //Log.Write("IniSrvPago", pipeClient.Message, Evento.Query, Comandos.EstadoImpresora);
                pipeClient.SendMessage(Comandos.EstadoImpresora);

                if (pipeClient.Resultado.CodigoError == 0)
                {
                    string msg = string.Join("|", pipeClient.Resultado.Data);
                    //Log.Write("IniSrvPago", msg, Evento.Response, Comandos.EstadoImpresora);
                    return(true);
                }
                else
                {
                    //Log.Write("IniSrvPago", pipeClient.Resultado.CodigoError + ": " + pipeClient.Resultado.Data[0], Evento.Error, Comandos.EstadoImpresora);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                // Global.log.Error("Error pipe server ready ", ex);
                return(false);
            }
        }
Example #4
0
        public void ObtenerUltimaVenta(string numDoc)
        {
            try
            {
                // >> 0,IdUser
                // << 0,BolNum 1,Monto 2,CampoImpr
                PipeClient pipeClient = new PipeClient();
                // pipeClient.Message = BuildMessage(Comandos.UltimaVenta, new List<string> { Settings.Default.IdKiosco.ToString() });
                //Log.Write("UltVenta", pipeClient.Message, Evento.Query, Comandos.UltimaVenta);
                pipeClient.SendMessage(Comandos.UltimaVenta);

                if (pipeClient.Resultado.CodigoError == 0)
                {
                    string msg = string.Join("|", pipeClient.Resultado.Data);
                    //Log.Write("UltVenta", msg, Evento.Response, Comandos.UltimaVenta);
                    string[] resp = pipeClient.Resultado.Data[0].Split('~');
                    if (resp.Length >= 3)
                    {
                        //if (resp[0] == numDoc && resp[1] == Estado.DetallePago.MontoTransbank.ToString())
                        //{
                        //    Estado.PagoTbk.Voucher = resp[2];
                        //    Estado.PagoTbk.IsPagoOk = true;
                        //}
                    }
                }
                else
                {
                    //Log.Write("UltVenta", pipeClient.Resultado.CodigoError + ": " + pipeClient.Resultado.Data[0], Evento.Response, Comandos.UltimaVenta);
                }
            }
            catch (Exception ex)
            {
                //Global.log.Error("ObtenerUltimaVenta ", ex);
                //Log.Write("UltVenta", ex.ToString(), Evento.Error, Comandos.UltimaVenta);
            }
        }