Пример #1
0
        public enumRetornoSitef IniciaSitefDebito()
        {
            LogUtil.Debug(string.Format("##Sitef.IniciandoConsultaDebito## CLIENTE {0}", this.ClienteID));

            oSitef = new SiTefMKTClass();
            oSitef.configura(IP, terminal, empresa);

            if (this.ConsultaCartaoDebito() != enumRetornoSitef.Ok)
            {
                if (string.IsNullOrEmpty(this.CodigoRespostaSitefVenda))
                {
                    throw new Exception("Houve uma falha na comunicação, por favor, aguarde alguns instantes e tente novamente");
                }
                else
                {
                    throw new Exception(this.CodigoRespostaSitefVenda + " - " + this.MensagemVenda);
                }
            }


            if (this.EfetuaVendaDebito() != enumRetornoSitef.Ok)
            {
                if ((!string.IsNullOrEmpty(this.CodigoRespostaSitefVenda) && this.CodigoRespostaSitefVenda.Contains("S0")) ||
                    (string.IsNullOrEmpty(this.CodigoRespostaSitefVenda + this.MensagemVenda)))
                {
                    throw new TimeoutException("Houve uma falha na comunicação, por favor, aguarde alguns instantes e tente novamente");
                }
                else
                {
                    throw new Exception(this.CodigoRespostaSitefVenda + " - " + this.MensagemVenda);
                }
            }
            return(enumRetornoSitef.Ok);
        }
Пример #2
0
        /// <summary>
        /// Inicia o Sitef, Configurando IP, Terminal e Empresa
        /// </summary>
        /// <returns></returns>
        public enumRetornoSitef IniciaSitef()
        {
            oSitef = new SiTefMKTClass();
            oSitef.configura(IP, terminal, empresa);

            if (this.EfetuaVenda() != enumRetornoSitef.Ok)
            {
                if ((!string.IsNullOrEmpty(this.CodigoRespostaSitefVenda) && this.CodigoRespostaSitefVenda.Contains("S0")) ||
                    (string.IsNullOrEmpty(this.CodigoRespostaSitefVenda + this.MensagemVenda)))
                {
                    throw new TimeoutException("Houve uma falha na comunicação, por favor, aguarde alguns instantes e tente novamente");
                }
                else
                {
                    throw new Exception(this.CodigoRespostaSitefVenda + " - " + this.MensagemVenda);
                }
            }
            return(enumRetornoSitef.Ok);
        }
Пример #3
0
        /// <summary>
        /// Inicia o Sitef, Configurando IP, Terminal e Empresa
        /// </summary>
        /// <returns></returns>
        public enumRetornoSitef IniciaConsulta()
        {
            oSitef = new SiTefMKTClass();
            oSitef.configura(IP, terminal, empresa);

            //return enumRetornoSitef.Ok;

            if (this.ConsultaCartao() != enumRetornoSitef.Ok)
            {
                if (string.IsNullOrEmpty(this.CodigoRespostaSitefVenda))
                {
                    throw new Exception("Houve uma falha na comunicação, por favor, aguarde alguns instantes e tente novamente");
                }
                else
                {
                    throw new Exception(this.CodigoRespostaSitefVenda + " - " + this.MensagemVenda);
                }
            }
            return(enumRetornoSitef.Ok);
        }