private bool AplicarCargos(ref string sNombresPasajeros, int iNumeroPasajero, ucPassangerChargeOfServiceLowFare assignaedPassangers, ref string sRemark) { bool bCargosFallidos = false; string recLoc = String.Empty; StringBuilder sb = new StringBuilder(); if (UsuarioValidoParaCargosPorServicio) { CreditCardInfo info = new CreditCardInfo(); recLoc = lstDatosTarjeta[0].PNR; info.PNR = lstDatosTarjeta[0].PNR; info.Activo = true; info.OrigenVenta = "C"; info.PaxNumber = iNumeroPasajero; info.AnioVencimiento = lstDatosTarjeta[0].AnioVencimiento; info.CodigoSeguridad = lstDatosTarjeta[0].CodigoSeguridad; info.MesVencimiento = lstDatosTarjeta[0].MesVencimiento; info.MontoCargo = lstDatosTarjeta[0].MontoCargo; info.NombreTitular = lstDatosTarjeta[0].NombreTitular; info.NumeroTarjeta = lstDatosTarjeta[0].NumeroTarjeta; info.TipoTarjeta = lstDatosTarjeta[0].TipoTarjeta; ucServicesFeePayApply.lstDatosTarjeta.Add(info); } else { for (int i = 0; i < lstDatosTarjeta.Count; i++) { ChargesPerService.BuilCommandToSendOld(iNumeroPasajero, lstDatosTarjeta[i]); } } return(bCargosFallidos); }
private void ucChargeOfServiceLowFare_Load(object sender, EventArgs e) { _presenter = new ChargeOfServiceLowFarePresenter { Repository = new ChargeOfServiceLowFareRepository(), View = this, OnComplete = OnCompleted }; _presenter.LoadChargeOfServiceComponents(Passangers); UsuarioValidoParaCargosPorServicio = ChargesPerService.ValidateTestingUsers(ChargesPerService.OrigenTipoCargo.BajoCosto); lblLeyendaIva.Visible = UsuarioValidoParaCargosPorServicio; //this.buttonPanel.Location = new Point(this.buttonPanel.Location.X,this.buttonPanel.Location.Y + (160 * VolarisSession.AddPassengerComplete.Count)+ 260); }
private void MandarDin(List <ListaFiltrada> lstListaFiltrada) { for (int i = 0; i < lstListaFiltrada.Count; i++) { if ((lstListaFiltrada[i].ESTATUS == "OK" || lstListaFiltrada[i].ESTATUS == "Cargo Exitoso") && !string.IsNullOrEmpty(lstListaFiltrada[i].AUTORIZACION) && !string.IsNullOrEmpty(lstListaFiltrada[i].OPERACION)) { GeneracionRemarks(); bool isVolverAMandarDIN = ChargesPerService.ExisteCadenaEnRespuestasSabre( ChargesPerService.PreguntasASabre.DIN, ChargesPerService.RespuestasSabre.PAC_TO_VERIFY + "|" + ChargesPerService.RespuestasSabre.SEGMENTS_NOT_IN_DATE_ORDER + "|" + ChargesPerService.RespuestasSabre.WARNING_EDITS + "|" + ChargesPerService.RespuestasSabre.SEGMENTS_NOT_IN_DATE_ORDER_VERIFY_AND_REENTER + "|" + ChargesPerService.RespuestasSabre.VERIFY_ORDER_OF_ITINERARY_SEGMENTS + "|" + ChargesPerService.RespuestasSabre.AIRCRAFT_CHANGE_SEGMENT + "|" + ChargesPerService.RespuestasSabre.MULTIPLE_SEGMENTS_FOR_SAME_FLIGHT); if (isVolverAMandarDIN) { ChargesPerService.ExisteCadenaEnRespuestasSabre(ChargesPerService.PreguntasASabre.DIN, ""); } break; } else if ((lstListaFiltrada[i].ESTATUS == "OK" || lstListaFiltrada[i].ESTATUS == "Cargo Exitoso") && (lstDatosTarjeta[i].TipoTarjeta != "CCAC" && lstDatosTarjeta[i].TipoTarjeta != "CCPV" && lstDatosTarjeta[i].TipoTarjeta != "CCTD")) { GeneracionRemarks(); bool isVolverAMandarDIN = ChargesPerService.ExisteCadenaEnRespuestasSabre( ChargesPerService.PreguntasASabre.DIN, ChargesPerService.RespuestasSabre.PAC_TO_VERIFY + "|" + ChargesPerService.RespuestasSabre.SEGMENTS_NOT_IN_DATE_ORDER + "|" + ChargesPerService.RespuestasSabre.WARNING_EDITS + "|" + ChargesPerService.RespuestasSabre.SEGMENTS_NOT_IN_DATE_ORDER_VERIFY_AND_REENTER + "|" + ChargesPerService.RespuestasSabre.VERIFY_ORDER_OF_ITINERARY_SEGMENTS + "|" + ChargesPerService.RespuestasSabre.AIRCRAFT_CHANGE_SEGMENT + "|" + ChargesPerService.RespuestasSabre.MULTIPLE_SEGMENTS_FOR_SAME_FLIGHT); if (isVolverAMandarDIN) { ChargesPerService.ExisteCadenaEnRespuestasSabre(ChargesPerService.PreguntasASabre.DIN, ""); } break; } } }
public TransaccionesRespuestasEntities Pagar(ref LogServiceFee item, string sNombreTitular, CreditCardInfo dtsTarjeta, int iPaxNumber, int iNumeroIntento) { TransaccionesRespuestasEntities Respuesta = new TransaccionesRespuestasEntities(); try { String sMerchant; String sTipoTarjeta; TransaccionesTarjetaNPService Tran = new TransaccionesTarjetaNPService(); String sCurrency = "MXN"; if (item.sBanco == "CCAC") { sTipoTarjeta = "AMEX"; sMerchant = "33828"; } else { sTipoTarjeta = "VMC"; sMerchant = "33521"; } if (System.Configuration.ConfigurationManager.AppSettings["Ambiente"] == "PRUEBAS") { sMerchant = "07854"; } Respuesta = ChargesPerService.CobroEnLinea(item, sNombreTitular, Respuesta, sMerchant, sTipoTarjeta, Tran, sCurrency, iNumeroIntento, dtsTarjeta, iPaxNumber, recLoc); } catch (Exception ex) { Respuesta.EstatusTransaccion = "Error"; Respuesta.MensajeAmistoso = ex.Message; } return(Respuesta); }
private void HideAndShowCaptureControls(int iCurrentPaxNumberMenosUno, ListItem item) { txtNumberCardCTS.PasswordChar = new char(); switch (item.Value) { case "CASH": txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Visible = false; lblCardNumberCTS.Visible = false; txtDigitoSeguridad.Visible = false; cmbMesVencimiento.Visible = false; cmbAnioVencimiento.Visible = false; txtNombreTarjetahabiente.Visible = false; lblDigitoSeguridad.Visible = false; lblMesVencimiento.Visible = false; lblAnioVencimiento.Visible = false; lblNombreTarjetahabiente.Visible = false; break; case "CH": case "TR": case "TP": switch (item.Value) { case "TP": lblCardNumberCTS.Text = "Número de tarjeta"; txtNumberCardCTS.MaxLength = 16; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; default: lblCardNumberCTS.Text = "Número de cuenta"; txtNumberCardCTS.MaxLength = 4; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; } lblCardNumberCTS.Visible = true; if (item.Value != "TP") { if (string.IsNullOrEmpty(ChargesPerService.DKActual)) { ChargesPerService.RecuperarDK(); } WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetTranferCheckNumber data = new MyCTS.Services.ValidateDKsAndCreditCards.GetTranferCheckNumber(); data = wsServ.GetTranferCheckNumberMyCTS(ChargesPerService.DKActual); txtNumberCardCTS.Text = data.ct_banc_cbr; } else { txtNumberCardCTS.Text = String.Empty; } txtNumberCardCTS.Visible = true; txtDigitoSeguridad.Visible = false; cmbMesVencimiento.Visible = false; cmbAnioVencimiento.Visible = false; txtNombreTarjetahabiente.Visible = false; lblDigitoSeguridad.Visible = false; lblMesVencimiento.Visible = false; lblAnioVencimiento.Visible = false; lblNombreTarjetahabiente.Visible = false; break; default: lblCardNumberCTS.Text = "Número de tarjeta"; txtNumberCardCTS.Visible = true; lblCardNumberCTS.Visible = true; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); txtDigitoSeguridad.Visible = true; cmbMesVencimiento.Visible = true; cmbAnioVencimiento.Visible = true; txtNombreTarjetahabiente.Visible = true; lblDigitoSeguridad.Visible = true; lblMesVencimiento.Visible = true; lblAnioVencimiento.Visible = true; lblNombreTarjetahabiente.Visible = true; btnAccept.Text = "Aplicar cargo en línea"; switch (((ListItem)cmbTypeCard.SelectedItem).Value) { case "AX": txtNumberCardCTS.MaxLength = 16; txtDigitoSeguridad.MaxLength = 4; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; default: txtNumberCardCTS.MaxLength = 16; txtDigitoSeguridad.MaxLength = 3; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; } break; } }
private void ValidacionFormasDePago() { switch (cmbTypeCard.Text) { case "TR - TRANSFERENCIA": case "CASH - EFECTIVO": case "CH - CHEQUE": DeterminaValidacionGeneracionCargo(); break; case "TP - TC UATP": ///Validación para la FoP TP - TC UATP para que al validar las tarjetas, no valide ///todos los campos existentes en la plantilla aunque esten ocultos. Para cualquier ///otro caso se validan todos los campos en la plantilla. if (ValidateCreditCardNumber) { } break; default: if ((string.IsNullOrEmpty(cmbTypeCard.Text) || string.IsNullOrEmpty(txtDigitoSeguridad.Text) || string.IsNullOrEmpty(txtNombreTarjetahabiente.Text) || string.IsNullOrEmpty(cmbTypeCard.Text) || string.IsNullOrEmpty(cmbMesVencimiento.Text) || string.IsNullOrEmpty(cmbAnioVencimiento.Text) || string.IsNullOrEmpty(cmbTypeCard.Text))) { MessageBox.Show("¡Debes ingresar todos los campos!"); return; } //Se validan las fechas ingresadas por el usuario. No deben ser menor a los de la fecha actual int cmboFecYear = Convert.ToInt32(DateTime.Now.Year); int cmboFecMes = Convert.ToInt32(DateTime.Now.Month); int cmbFecYear = Convert.ToInt32(cmbAnioVencimiento.Text); if (cmbTypeCard.Text == "- Selecciona Forma de Pago -") { MessageBox.Show("¡Ingrese la Forma de Pago!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } cmbFecMes = seleccionaMes(); if (cmbFecYear < cmboFecYear) { MessageBox.Show("¡Datos de vigencia de la tarjeta invalido, verifica el año!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); cmbAnioVencimiento.Focus(); return; } if (cmbFecMes < cmboFecMes & cmboFecYear == cmbFecYear) { MessageBox.Show("¡Datos de vigencia de la tarjeta invalido, verifica el mes!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); cmbMesVencimiento.Focus(); return; } if (string.IsNullOrEmpty(txtNumberCardCTS.Text)) { MessageBox.Show("Debes ingresar un número de tarjeta. Ingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Focus(); return; } ChargesPerService.RecuperarDK(); WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.ClientCreditCard clientCreditCard = wsServ.GetClientCreditCardNumber(txtNumberCardCTS.Text, ChargesPerService.DKActual); string creditCard = wsServ.GetCreditCardNumberCTS(txtNumberCardCTS.Text); if (!string.IsNullOrEmpty(creditCard)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta diferente a una de CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Focus(); return; } string clientCreditCardNumber = wsServ.GetClientCreditCardNumberATT(txtNumberCardCTS.Text); if (string.IsNullOrEmpty(clientCreditCardNumber)) { if (ValidateCreditCardNumber) { // No hace nada } } else { if (clientCreditCard.CreditCardNumber != txtNumberCardCTS.Text) { MessageBox.Show("El número de tarjeta ingresado pertenece a un cliente diferente, ingrese un número de tarjeta válido", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Focus(); return; } } if (txtNumberCardCTS.Text == clientCreditCard.CreditCardNumber & ChargesPerService.DKActual == clientCreditCard.Client) { DeterminaValidacionGeneracionCargo(); } break; } if (!VerificarCargoPrevio()) { Pagar(); } else { MessageBox.Show("Ya cuenta con un intento de cargo por servicio previo para hoteles, no es posible realizar un nuevo cargo por servicio para hoteles mediante la interfaz", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
private AssignChargeOfServiceEventArgs GetArguments() { var arguments = new AssignChargeOfServiceEventArgs { Passanger = passangersCombo.SelectedItem as IPassanger, Amount = Convert.ToDecimal(this.amountTextBox.Text), FormOfPayment = creditCardCombo.SelectedItem as FormOfPayment, }; if (arguments.FormOfPayment != null) { arguments.FormOfPayment.CrediCardNumber = this.creditCardTextBox.Text; } // falta agregar el DK bool volaris = true; bool interjet = true; String sValorPNR = String.Empty; if (volaris) { if (ucFirstValidations.dk == null || ucFirstValidations.dk == String.Empty) { ucFirstValidations.dk = sDK; } sValorPNR = sPNR; } else if (interjet) { if (ucFirstValidations.dk == null || ucFirstValidations.dk == String.Empty) { ucFirstValidations.dk = sDK; } sValorPNR = sPNR; } if (ChargesPerService.ValidateTestingUsers(ChargesPerService.OrigenTipoCargo.BajoCosto)) { arguments.DatosTarjeta = new CreditCardInfo(); arguments.DatosTarjeta.NumeroTarjeta = creditCardTextBox.Text; arguments.DatosTarjeta.MesVencimiento = mothCombo.SelectedItem.ToString(); arguments.DatosTarjeta.AnioVencimiento = yearComboBox.SelectedItem.ToString().Substring(2, 2); arguments.DatosTarjeta.NombreTitular = txtNombreTitular.Text; arguments.DatosTarjeta.CodigoSeguridad = txtCodigoSeguridad.Text; arguments.DatosTarjeta.MontoCargo = Convert.ToDecimal(this.amountTextBox.Text); string sFormaDePago = String.Empty; switch (creditCardCombo.SelectedItem.ToString().Trim()) { case "TC AMEX": sFormaDePago = "CCAC"; break; case "TC VISA": case "TC MASTERCARD": sFormaDePago = "CCPV"; break; case "TD VISA": case "TD MASTERCARD": sFormaDePago = "CCTD"; break; case "EFECTIVO": sFormaDePago = "CA"; break; case "CHEQUE": sFormaDePago = "CH"; break; case "TRANSFERENCIA": sFormaDePago = "TR"; break; case "TC UATP": sFormaDePago = "TP"; break; } arguments.DatosTarjeta.TipoTarjeta = sFormaDePago; arguments.DatosTarjeta.PNR = sValorPNR; // Falta agregar el PNR ucChargeOfServiceLowFare.lstDatosTarjeta = new List <CreditCardInfo>(); ucChargeOfServiceLowFare.lstDatosTarjeta.Add(arguments.DatosTarjeta); } return(arguments); }
private bool PayForItemFormPaymentCS(CreditCardInfo dtsTarjeta, int iPaxNumber, ref string Error) { int iPaxFrontNumber = iPaxNumber + 1; TransaccionesRespuestasEntities Respuesta = new TransaccionesRespuestasEntities(); if (dtsTarjeta == null) { return(false); } if (UsuarioValidoParaCargosPorServicio) { if (dtsTarjeta.TipoTarjeta.Equals("CCAC") || dtsTarjeta.TipoTarjeta.Equals("CCPV") || dtsTarjeta.TipoTarjeta.Equals("CCTD")) { try { LogServiceFee item = new LogServiceFee(); String sNombreTransaccion = string.Empty; TransaccionesTarjetaNPService Tran = new TransaccionesTarjetaNPService(); int iCargoAplicado = 0; int iNumeroIntento = 0; // Se guarda en LogServiceFee la respuesta item = new LogServiceFee { id = sNombreTransaccion, sCodigoTarjeta = dtsTarjeta.CodigoSeguridad, sNumTarjeta = dtsTarjeta.NumeroTarjeta, sMesVencimiento = dtsTarjeta.MesVencimiento, sAnioVencimiento = dtsTarjeta.AnioVencimiento, sBanco = dtsTarjeta.TipoTarjeta, sMonto = dtsTarjeta.MontoCargo.ToString(), dtDate = DateTime.Now, sBoletos = dtsTarjeta.Ticket, sRemarks = String.Empty, sRecLoc = recLoc }; // se harcodea el valor del orgId al de CTS, cambiar para cuando se integren mas empresas iNumeroIntento = Tran.GetNumeroIntentos(recLoc, 85); iCargoAplicado = Tran.GetNumeroTransacciones(recLoc, 85); item.id = sNombreTransaccion = "MyCTS-" + dtsTarjeta.OrigenVenta + "-" + recLoc + "-" + iCargoAplicado + "-" + iPaxFrontNumber + "_"; Respuesta = Pagar(ref item, dtsTarjeta.NombreTitular, dtsTarjeta, iPaxFrontNumber, iNumeroIntento); ErrorLogServiceChargeBL.InsertErrorLogServiceCharge(Respuesta.EstatusTransaccion, Respuesta.MensajeAmistoso, Respuesta.NumeroAutorizacion, Respuesta.NumeroOperacion); if (Respuesta.EstatusTransaccion == "Error" || Respuesta.EstatusTransaccion == "Denegada") { char[] caracterSeparador = { '.' }; String[] sErrorCorto = Respuesta.MensajeAmistoso.Split(caracterSeparador, StringSplitOptions.RemoveEmptyEntries); String sErrorParteDos = String.Empty; if (sErrorCorto.Length > 1) { sErrorParteDos = "Transacción rechazada. " + sErrorCorto[1].Trim();; } else { sErrorParteDos = Respuesta.MensajeAmistoso; } Error = Respuesta.MensajeAmistoso; dtsTarjeta.Pagado = false; dtsTarjeta.MensajeError = sErrorParteDos; return(false); } if (string.IsNullOrEmpty(Respuesta.EstatusTransaccion)) { Error = "Error al intentar realizar el cargo"; dtsTarjeta.Pagado = false; dtsTarjeta.MensajeError = Error; return(false); } else { dtsTarjeta.Pagado = true; dtsTarjeta.NumeroAutorizacion = item.sNumAutorizacion; dtsTarjeta.NumeroOperacion = item.sNumOperacion; } } catch (Exception ex) { Error = "Error al intentar conectar con MIT"; dtsTarjeta.Pagado = false; dtsTarjeta.MensajeError = "Error al intentar conectar con MIT"; try { new EventsManager.EventsManager(ex, EventsManager.EventsManager.OrigenError.CapaDePresentacion); } catch (Exception) { new EventsManager.EventsManager(System.Diagnostics.EventLogEntryType.Error, ex); } return(false); } } ChargesPerService.BuilCommandToSend(Respuesta.NumeroOperacion, Respuesta.NumeroAutorizacion, iPaxNumber, dtsTarjeta, OrigenTipo, recLoc); dtsTarjeta.Activo = false; } else { if (OrigenTipo == ChargesPerService.OrigenTipoCargo.Independiente) { ChargesPerService.BuilCommandToSendOld(iPaxNumber, dtsTarjeta); dtsTarjeta.Pagado = true; } } return(true); }
public void PayServiceFee() { frmPreloading frm2 = new frmPreloading(this); frm2.Show(); List <ListaFiltrada> lstListaFiltrada = new List <ListaFiltrada>(); UsuarioValidoParaCargosPorServicio = ChargesPerService.ValidateTestingUsers(OrigenTipo); if ((OrigenTipo != ChargesPerService.OrigenTipoCargo.Independiente) && !UsuarioValidoParaCargosPorServicio) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else { if (OrigenTipo == ChargesPerService.OrigenTipoCargo.BajoCosto) { if (String.IsNullOrEmpty(PNRBajoCostoSabre)) { MessageBox.Show("No ha sido posible generar la factura para el servicio aéreo,\n por tal motivo los cargos por servicio en linea\n no pudieron ser completados", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { using (CommandsAPI objCommand = new CommandsAPI()) { string sabreAnswer = objCommand.SendReceive("*" + PNRBajoCostoSabre); } recLoc = PNRBajoCostoSabre; } } else if (OrigenTipo == ChargesPerService.OrigenTipoCargo.Hoteles || OrigenTipo == ChargesPerService.OrigenTipoCargo.Autos) { TransaccionesRespuestasEntities Respuesta = new TransaccionesRespuestasEntities(); PagarHotel(ref lstListaFiltrada, ref Respuesta); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(ChargesPerService.PreguntasASabre.VERIFICAR_RESERVA); } } else { RecuperarPNR(); } if (tarjeta != null) { lstDatosTarjeta.Add(tarjeta); } if (!string.IsNullOrEmpty(recLoc) && recLoc.Length == 6 && ValidateRegularExpression.ValidatePNR(recLoc) && OrigenTipo != ChargesPerService.OrigenTipoCargo.Hoteles && OrigenTipo != ChargesPerService.OrigenTipoCargo.Autos) { FlujoPagos(); } lstListaFiltrada = FiltrarLista(lstDatosTarjeta); if (!string.IsNullOrEmpty(recLoc) && recLoc.Length == 6 && ValidateRegularExpression.ValidatePNR(recLoc) && OrigenTipo != ChargesPerService.OrigenTipoCargo.Hoteles && OrigenTipo != ChargesPerService.OrigenTipoCargo.Autos) { MandarDin(lstListaFiltrada); } } }
//Evento click del Boton btnTicketEmission private void btnTicketEmission_Click(object sender, EventArgs e) { bool validAuthCode = true; string sabreAnswer = string.Empty; bool UsuarioValidoParaCargosPorServicio = false; // Validamos usuario para generar remark en el caso de las versiones anteriores UsuarioValidoParaCargosPorServicio = UsuarioValidoCargosPorServicio(); if (!UsuarioValidoParaCargosPorServicio) { for (int i = 0; i < ucServicesFeePayApply.lstDatosTarjeta.Count; i++) { if (ucServicesFeePayApply.lstDatosTarjeta[i].MontoCargo != 0) { string sError = string.Empty; ChargesPerService.BuilCommandToSendOld(ucServicesFeePayApply.lstDatosTarjeta[i].PaxNumber, ucServicesFeePayApply.lstDatosTarjeta[i]); } } } if (string.IsNullOrEmpty(ucTicketsEmissionInstructions.CodeAuth.Code)) { if (!string.IsNullOrEmpty(ucFormPayment.CommandGetAuthorizationCode)) { if (!string.IsNullOrEmpty(ucPromo.PromoCode)) { ucFormPayment.CommandGetAuthorizationCode = string.Concat(ucFormPayment.CommandGetAuthorizationCode, "*", ucPromo.PromoCode, "/*C", ucFormPayment.SecurityCode); } else { ucFormPayment.CommandGetAuthorizationCode = string.Concat(ucFormPayment.CommandGetAuthorizationCode, "/*C", ucFormPayment.SecurityCode); } using (CommandsAPI2 objCommand = new CommandsAPI2()) { sabreAnswer = objCommand.SendReceive(ucFormPayment.CommandGetAuthorizationCode, 0, 0, 4000); } ucPromo.PromoCode = string.Empty; if (sabreAnswer.Contains(Resources.TicketEmission.Constants.OK)) { string[] sabreArray = sabreAnswer.Replace("\n", "-").Split('-'); for (int i = 0; i < sabreArray.Length; i++) { int row = 0; int col = 0; CommandsQik.searchResponse(sabreArray[i], Resources.TicketEmission.Constants.OK, ref row, ref col, 1, 2); if (row != 0 || col != 0) { CommandsQik.CopyResponse(sabreArray[i], ref authCode, 1, 4, 6); } } if (!string.IsNullOrEmpty(authCode)) { if (ucTicketsEmissionInstructions.wayPayment == Resources.TicketEmission.Constants.PAYMENT_MIXPAYMENT) { ucFormPayment.FormPayment = string.Concat(ucFormPayment.FormPayment, Resources.TicketEmission.Constants.COMMANDS_AST_Z, authCode, Resources.TicketEmission.Constants.SLASH, ucFormPayment.Amount); } else { ucFormPayment.FormPayment = string.Concat(ucFormPayment.FormPayment, Resources.TicketEmission.Constants.COMMANDS_AST_Z, authCode); } } } else if (sabreAnswer.Contains(Resources.TicketEmission.Constants.INVALID)) { MessageBox.Show("TARJETA RECHAZADA \n" + sabreAnswer, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); validAuthCode = false; } else if (sabreAnswer.Contains(Resources.TicketEmission.Constants.DECLINED)) { MessageBox.Show("TARJETA RECHAZADA \n" + sabreAnswer, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); validAuthCode = false; } else if (sabreAnswer.Contains(Resources.TicketEmission.Constants.INCORRECT_CARD)) { MessageBox.Show("TARJETA RECHAZADA \n" + sabreAnswer, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); validAuthCode = false; } else if (sabreAnswer.Contains(Resources.TicketEmission.Constants.PROCESSING_ERROR)) { MessageBox.Show("TARJETA RECHAZADA \n" + sabreAnswer, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); validAuthCode = false; } else if (sabreAnswer.Contains(Resources.TicketEmission.Constants.REFERRAL)) { MessageBox.Show("TARJETA RECHAZADA \n" + sabreAnswer, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); validAuthCode = false; } //Continua con el flujo de boleto, va al paso 8 if (!validAuthCode) { SetAuthCodeBL.SetErrorCK(ucFirstValidations.LocatorRecord, ucFormPayment.CardType, ucFormPayment.Amount, ucFormPayment.Bank, sabreAnswer, DateTime.Now, ucFormPayment.CommandGetAuthorizationCode); ucFormPayment.CommandGetAuthorizationCode = string.Empty; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UCTICKETSEMISSIONINSTRUCTIONS); } else if (validatebusinessrules) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_ARMED_COMMANDS); } } else { if (validatebusinessrules) { // Aqui se actualizan los boletos en la tabla de log services fee Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_ARMED_COMMANDS); } } } else { if (validatebusinessrules) { AuthCode = ucTicketsEmissionInstructions.CodeAuth.Code; if (ucTicketsEmissionInstructions.wayPayment == Resources.TicketEmission.Constants.PAYMENT_MIXPAYMENT) { ucFormPayment.FormPayment = string.Concat(ucFormPayment.FormPayment, Resources.TicketEmission.Constants.COMMANDS_AST_Z, authCode, Resources.TicketEmission.Constants.SLASH, ucFormPayment.Amount); } else { ucFormPayment.FormPayment = string.Concat(ucFormPayment.FormPayment, Resources.TicketEmission.Constants.COMMANDS_AST_Z, authCode); } Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_ARMED_COMMANDS); } else { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UCTICKETSEMISSIONINSTRUCTIONS); } } }
private bool UsuarioValidoCargosPorServicio() { bool Status = ChargesPerService.ValidateTestingUsers(ChargesPerService.OrigenTipoCargo.FlujoAereo); return(Status); }