internal static string CheckVoucher(string strVoucherCop) { string strc, strcRef; string valor = ""; if (strVoucherCop == null) { return(""); } if (!string.IsNullOrWhiteSpace(strVoucherCop)) { if (strVoucherCop.Contains(":")) { strVoucherCop = Globales.DecryptString(strVoucherCop, "KEY CREDIT CARD KEY", true); } if (strVoucherCop.Contains("@lsn POR ESTE PAGARE ME OBLIGO INCONDI")) { strVoucherCop = strVoucherCop.Substring(0, strVoucherCop.IndexOf("@lsn POR ESTE PAGARE ME OBLIGO INCONDI")); } //Falta cositas del voucher checar en cpIntegracion.bas cliente strVoucherCop = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(strVoucherCop)); strVoucherCop = strVoucherCop.Replace("MXN", "MXN "); valor = strVoucherCop; } return(valor); }
private void Window_Loaded(object sender, RoutedEventArgs e) { Globales.ip = ConfigurationManager.AppSettings["ip"]; Globales.ipPub = ConfigurationManager.AppSettings["ipPub"]; Globales.ipPrep = ConfigurationManager.AppSettings["ipPrep"]; Globales.ipvip = ConfigurationManager.AppSettings["ipvip"]; Globales.ipPoints2 = ConfigurationManager.AppSettings["ipPoints2"]; Globales.ipfe = ConfigurationManager.AppSettings["ipfe"]; Globales.ipLoginInstalador = ConfigurationManager.AppSettings["ipLoginInstalador"]; Globales.ipFirmaPanel = ConfigurationManager.AppSettings["ipFirmaPanel"]; Globales.ipKeyWeb = ConfigurationManager.AppSettings["ipKeyWeb"]; Globales.VersionApp = ConfigurationManager.AppSettings["versionApp"]; Globales.VersionPcPay = ConfigurationManager.AppSettings["versionPcPay"]; Globales.ip = Globales.DecryptString(Globales.ip, Globales.KEY_RC4, true); Globales.ipPub = Globales.DecryptString(Globales.ipPub, Globales.KEY_RC4, true); Globales.ipPrep = Globales.DecryptString(Globales.ipPrep, Globales.KEY_RC4, true); Globales.ipvip = Globales.DecryptString(Globales.ipvip, Globales.KEY_RC4, true); Globales.ipPoints2 = Globales.DecryptString(Globales.ipPoints2, Globales.KEY_RC4, true); Globales.ipfe = Globales.DecryptString(Globales.ipfe, Globales.KEY_RC4, true); Globales.ipLoginInstalador = Globales.DecryptString(Globales.ipLoginInstalador, Globales.KEY_RC4, true); Globales.ipFirmaPanel = Globales.DecryptString(Globales.ipFirmaPanel, Globales.KEY_RC4, true); Globales.ipKeyWeb = Globales.DecryptString(Globales.ipKeyWeb, Globales.KEY_RC4, true); txtUser.Focus(); }
public void frmLogin1_Loaded(object sender, RoutedEventArgs e) { try { Program.ip = Globales.DecryptString(Program.ip, Globales.KEY_RC4, true); Program.ipPub = Globales.DecryptString(Program.ipPub, Globales.KEY_RC4, true); Program.ipPrep = Globales.DecryptString(Program.ipPrep, Globales.KEY_RC4, true); Program.ipvip = Globales.DecryptString(Program.ipvip, Globales.KEY_RC4, true); Program.ipPoints2 = Globales.DecryptString(Program.ipPoints2, Globales.KEY_RC4, true); Program.ipfe = Globales.DecryptString(Program.ipfe, Globales.KEY_RC4, true); Program.ipLoginInstalador = Globales.DecryptString(Program.ipLoginInstalador, Globales.KEY_RC4, true); Program.ipFirmaPanel = Globales.DecryptString(Program.ipFirmaPanel, Globales.KEY_RC4, true); Program.ipKeyWeb = Globales.DecryptString(Program.ipKeyWeb, Globales.KEY_RC4, true); modMIT.URLLOGIN = Globales.ip + "/pgs/pcpayLogin8"; Program.NombreWebForm = NOMBRE_GENERAL + " - frmLogin1_Loaded"; Utils.DeshabilitaBotonCerrar(this, false); Utils.DeshabilitaMenuSistema(this); Utils.RedimensionaForm(this); TypeUsuario.strVersion = Utils.GetVersionApp(); lblVersion.Content = "Versión " + TypeUsuario.strVersion; txtUser.Focus(); if (!Program.ip.Equals("https://ssl.e-pago.com.mx")) { this.Title = this.Title + " " + Program.ip; } if (Program.ip.Equals("https://170.20.25.26:8080")) { this.Title = Program.ip + " Chinese Testing..."; } if (Utils.ObtieneParametrosMIT("Instalador").Equals("1")) { TypeUsuario.IsADO = "1"; Program.cpIntegraEMV.dbgSetUrlInstalador(Program.ipLoginInstalador); lblUser.Content = "Instalador:"; } else { TypeUsuario.IsADO = "-1"; TypeUsuario.isCDP = true; lblUser.Content = "Usuario:"; } } catch (Exception ex) { } }
private void CmdEnviar_Click(object sender, RoutedEventArgs e) { try { Globales.strNombreFP = NOMBRE_GENERAL + ".CmdEnviar_Click()"; Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; string mensaje = string.Empty; dynamic Impte; dynamic IsAmex, strCadEncriptar, CadAmex; Impte = Globales.FormatMoneda(lblimportepreventa.Content.ToString()); IsAmex = false; Globales.cpHTTP_Clear(); Globales.cpHTTP_sURL_cpCUCT = TypeUsuario.Url; strCadEncriptar = "&folio=" + lbloperacion.Content.ToString() + "&empresa=" + TypeUsuario.Id_Company + "&sucursal=" + TypeUsuario.Id_Branch + "&op=reimpvouchtermica" + "&co=true"; strCadEncriptar = strCadEncriptar.Replace("\r", ""); strCadEncriptar = strCadEncriptar.Replace("\t", ""); Globales.cpHTTP_cadena1 = "enc=" + Globales.encryptString(strCadEncriptar, Globales.KEY_RC4, true); if (Globales.cpHTTP_SendcpCUCT()) { Mouse.OverrideCursor = null; int InSrt = Globales.cpHTTP_sResult.IndexOf(System.Environment.NewLine); if (InSrt == -1) { InSrt = 0; } InSrt++; string cadena = Utils.Mid(Globales.cpHTTP_sResult, InSrt + 2); cadena = cadena.Replace(System.Environment.NewLine, ""); cadena = cadena.Replace("\r", ""); cadena = cadena.Replace("\t", ""); CadAmex = Globales.DecryptString(cadena, "KEY CREDIT CARD KEY", true); } Continuar: if (string.IsNullOrWhiteSpace(Propina.Text)) { Globales.MessageBoxMit("Introduzca la propina."); Propina.Focus(); } else { CmdEnviar.IsEnabled = false; Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; string strTypeC = string.Empty; Globales.cpIntegracion_Clear(); Globales.cpIntegracion_sURL_cpINTEGRA = Globales.URL_DLL_CIERREPREVENTA; Globales.cpIntegraEMV.dbgSetUrl(Globales.URL_3GATE); Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; Globales.cpIntegraEMV.sndCierrePreventaMOTO(TypeUsuario.usu, TypeUsuario.Pass, "", TypeUsuario.Id_Company, TypeUsuario.Id_Branch, TypeUsuario.country, Impte, Propina.Text, lbloperacion.Content.ToString()); Globales.cpIntegracion_sResult = Globales.cpIntegraEMV.getRspXML() + "<propina>" + Propina.Text + "</propina>"; Globales.cpIntegracion_sResult = Globales.cpIntegracion_sResult.Replace("<amount/>", "<amount>" + Impte + "</amount>"); Mouse.OverrideCursor = null; string caso = Globales.GetDataXml("response", Globales.cpIntegracion_sResult).ToLower(); switch (caso) { case "approved": Propina.IsEnabled = false; mensaje = string.Format("Aut. {0}", Globales.GetDataXml("auth", Globales.cpIntegracion_sResult)); Globales.MessageBoxMitApproved(mensaje, "Cierre Preventa Aprobado"); TypeUsuario.strVoucherCoP = Globales.GetDataXml("voucher", Globales.cpIntegracion_sResult).Trim(); TypeUsuario.strVoucherCoP = Globales.GetDataXml("voucher", Globales.cpIntegracion_sResult).Trim(); // //'************************************************************************************************ // // ''********************************** FIRMA EN PANEL ********************************************* // // 'VALIDACIONES PARA LA FIRMA EN PANEL string textoAgua = string.Empty; textoAgua = "Folio: " + Globales.cpIntegraEMV.getRspOperationNumber() + System.Environment.NewLine; textoAgua += "Auth: " + Globales.cpIntegraEMV.getRspAuth() + System.Environment.NewLine; textoAgua += "Importe: " + Globales.cpIntegraEMV.getTx_Amount() + System.Environment.NewLine; textoAgua += "Fecha: " + Globales.cpIntegraEMV.getRspDate() + System.Environment.NewLine; textoAgua += "Merchant: " + Globales.cpIntegraEMV.getRspDsMerchant() + System.Environment.NewLine; textoAgua += " " + System.Environment.NewLine; textoAgua += ";___________________" + System.Environment.NewLine; textoAgua += "FIRMA DIGITALIZADA:" + System.Environment.NewLine; // '************************************************************************************************ // 'valida si la tarjeta es Chip and Pin bool IsChipAndPin = false; bool esQPS = false; string cadenaHexFirma = string.Empty; int tipoVta = 1; var aux = Globales.cpIntegraEMV.chkCc_IsPin(); if (Globales.cpIntegraEMV.chkCc_IsPin() == "01") { IsChipAndPin = true; } if (Globales.cpIntegraEMV.getRspVoucher().Contains("@cnn Autorizado sin Firma ") && tipoVta == 1 && !IsChipAndPin) { esQPS = true; } // '************************************************************************************************ // 'Si la PinPad no soporta Firma en Panel y no es touch, sigue el flujo normal de PcPay if (!Globales.cpIntegraEMV.EsTouch() && !Globales.cpIntegraEMV.getRspSoportaFirmaPanel()) { // Then goto GoImpresion; } // '************************************************************************************************ // 'Si la PinPad Soporta Firma en Panel y no es touch, if (!Globales.cpIntegraEMV.EsTouch() && Globales.cpIntegraEMV.getRspSoportaFirmaPanel()) { // 'Llama a la función de obtener la firma en Panel Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; cadenaHexFirma = Globales.cpIntegraEMV.sndObtieneFirmaPanel(false, textoAgua, Globales.cpIntegraEMV.getRspVoucher(), IsChipAndPin, Globales.cpIntegraEMV.chkPp_Trademark(), (short)tipoVta, esQPS); Mouse.OverrideCursor = null; if (!cadenaHexFirma.Contains("Error")) { // 'Llama a la funcion de Guardar la firma if (Globales.cpIntegraEMV.sndGuardaFirmaPanel(cadenaHexFirma, Globales.ipFirmaPanel, Globales.cpIntegraEMV.getRspOperationNumber(), Globales.cpIntegraEMV.chkPp_Serial())) { imgEmailFirmaPanel.Visibility = Visibility.Visible; } } else { Globales.MessageBoxMit("No se pudo obtener la imagen del PinPad"); } goto GoImpresion; } if (Globales.cpIntegraEMV.EsTouch()) { if (TypeUsuario.UtilizarCapacidadTouch && TypeUsuario.EnviarVoucherMail) { if (!Globales.ObtieneFirmaPanel(Globales.ipFirmaPanel, textoAgua, (short)tipoVta, IsChipAndPin, esQPS)) { goto GoImpresion; } else { goto finaliza; } } if (TypeUsuario.UtilizarCapacidadTouch && !TypeUsuario.EnviarVoucherMail) { //Llama a la función de obtener la firma en Panel cadenaHexFirma = Globales.cpIntegraEMV.sndObtieneFirmaPanel(true, textoAgua, Globales.cpIntegraEMV.getRspVoucher(), IsChipAndPin, Globales.cpIntegraEMV.chkPp_Trademark(), (short)tipoVta, esQPS); if (!cadenaHexFirma.Contains("Error")) { // 'Llama a la funcion de Guardar la firma if (Globales.cpIntegraEMV.sndGuardaFirmaPanel(cadenaHexFirma, Globales.ipFirmaPanel, Globales.cpIntegraEMV.getRspOperationNumber(), Globales.cpIntegraEMV.chkPp_Serial())) { imgEmailFirmaPanel.Visibility = Visibility.Visible; } } else { Globales.MessageBoxMit("No se pudo obtener la imagen del PinPad"); } goto GoImpresion; } if (!TypeUsuario.UtilizarCapacidadTouch && !TypeUsuario.EnviarVoucherMail) { if (Globales.cpIntegraEMV.getRspSoportaFirmaPanel()) { // 'Llama a la función de obtener la firma en Panel cadenaHexFirma = Globales.cpIntegraEMV.sndObtieneFirmaPanel(false, textoAgua, Globales.cpIntegraEMV.getRspVoucher(), IsChipAndPin, Globales.cpIntegraEMV.chkPp_Trademark(), (short)tipoVta, esQPS); if (!cadenaHexFirma.Contains("Error")) { // 'Llama a la funcion de Guardar la firma if (Globales.cpIntegraEMV.sndGuardaFirmaPanel(cadenaHexFirma, Globales.ipFirmaPanel, Globales.cpIntegraEMV.getRspOperationNumber(), Globales.cpIntegraEMV.chkPp_Serial())) { imgEmailFirmaPanel.Visibility = Visibility.Visible; } } else { Globales.MessageBoxMit("No se pudo obtener la imagen del PinPad" + "\n" + cadenaHexFirma); } } goto GoImpresion; } } // '************************************************************************************************************ GoImpresion: escogerImpresora(); finaliza: //'fin del case if (TypeUsuario.IsAQ) { Globales.VerificaVoucher(); } cmdVoucher.Visibility = Visibility.Visible; CmdEnviar.Visibility = Visibility.Hidden; if (Globales.FacturaE == "1") { if (Globales.MessageConfirm("¿Desea factura electrónica?")) { frmPreguntaFactura frmPregunta = new frmPreguntaFactura(); frmPregunta.abrirFrmAhora = abrirFrmNuevo; frmPregunta.cerraPage = cierra; abrirFrmNuevo(frmPregunta, "Factura Electronica"); Mouse.OverrideCursor = null; return; } else { Globales.XMLFacturaE = ""; } } break; case "denied": Propina.IsEnabled = false; mensaje = Globales.msjRech + ": " + Globales.GetDataXml("cd_response", Globales.cpIntegracion_sResult) + " " + Globales.GetDataXml("friendly_response", Globales.cpIntegracion_sResult); Globales.MessageBoxMitDenied(mensaje); CmdEnviar.Visibility = Visibility.Hidden; break; case "error": mensaje = Globales.GetDataXml("nb_error", Globales.cpIntegracion_sResult); Globales.MessageBoxMitError(mensaje); CmdEnviar.Visibility = Visibility.Visible; break; default: mensaje = "Verifique su conexión de Internet."; Globales.MessageBoxMitError(mensaje); CmdEnviar.Visibility = Visibility.Visible; break; } Mouse.OverrideCursor = null; CmdEnviar.IsEnabled = true; } } catch { } }