protected void btnPagoBancomer_Click(object sender, EventArgs e)
        {
            mp_account.Value      = "952";
            mp_product.Value      = "1";
            mp_order.Value        = Convert.ToString(SesionUsu.FichaRefID);
            mp_reference.Value    = SesionUsu.FichaReferencia;
            mp_node.Value         = "0";
            mp_concept.Value      = "99";
            mp_amount.Value       = string.Format("{0:0.00}", SesionUsu.ImpDetalleConcep);
            mp_customername.Value = SesionUsu.UsuNombre + " " + SesionUsu.UsuApaterno + " " + SesionUsu.UsuAMaterno;
            mp_currency.Value     = "1";
            mp_signature.Value    = CNComun.GetSHA256(Convert.ToString(mp_order.Value + mp_reference.Value + mp_amount.Value));
            mp_urlsuccess.Value   = "https://sysweb.unach.mx/FichaReferenciada/Form/Registro_Participantes_P6.aspx"; //"Registro_Participantes_P7.aspx";
            mp_urlfailure.Value   = "https://sysweb.unach.mx/FichaReferenciada/Form/Registro_Participantes_P6.aspx"; // "Registro_Participantes_P7.aspx";

            ClientScript.RegisterStartupScript(this.GetType(), "myScript", "PagBancomer();", true);
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                mp_urlsuccess.Value = "https://sysweb.unach.mx/FichaReferenciada/Form/RespuestaPagoenLinea.aspx"; //"Registro_Participantes_P7.aspx";
                mp_urlfailure.Value = "https://sysweb.unach.mx/FichaReferenciada/Form/RespuestaPagoenLinea.aspx"; // "Registro_Participantes_P7.aspx";



                if (Request.Form["order_m"] != null)
                {
                    mp_order.Value = Request.Form["order_m"];
                }
                if (Request.Form["reference_m"] != null)
                {
                    mp_reference.Value = Request.Form["reference_m"];
                }
                if (Request.Form["amount_m"] != null)
                {
                    mp_amount.Value = Request.Form["amount_m"];
                }
                if (Request.Form["customername_m"] != null)
                {
                    mp_customername.Value = Request.Form["customername_m"];
                }
                if (Request.Form["service_m"] != null)
                {
                    MultiPago objMultipago = new MultiPago();
                    Verificador = string.Empty;
                    if (Request.Form["service_m"] != "0")
                    {
                        objMultipago.Id_Service = Convert.ToInt32(Request.Form["service_m"]);
                        CNMultipago.ObtenerServicio(ref objMultipago, ref Verificador);
                        if (Verificador == "0")
                        {
                            mp_urlsuccess.Value = objMultipago.UrlResp;
                            mp_urlfailure.Value = objMultipago.UrlResp;
                        }
                    }
                }

                mp_account.Value   = "952";
                mp_product.Value   = "1";
                mp_node.Value      = "0";
                mp_concept.Value   = "99";
                mp_amount.Value    = string.Format("{0:0.00}", mp_amount.Value);
                mp_currency.Value  = "1";
                mp_signature.Value = CNComun.GetSHA256(Convert.ToString(mp_order.Value + mp_reference.Value + mp_amount.Value));
                //mp_urlsuccess.Value = "https://sysweb.unach.mx/FichaReferenciada/Form/RespuestaPagoenLinea.aspx"; //"Registro_Participantes_P7.aspx";
                //mp_urlfailure.Value = "https://sysweb.unach.mx/FichaReferenciada/Form/RespuestaPagoenLinea.aspx"; // "Registro_Participantes_P7.aspx";
                ClientScript.RegisterStartupScript(this.GetType(), "myScript", "PagBancomer();", true);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                /*txtmp_account.Text = Request.Form["mp_account"];
                 * txtmp_product.Text = Request.Form["mp_product"];
                 * txtmp_order.Text = Request.Form["mp_order"];
                 * txtmp_reference.Text = Request.Form["mp_reference"];
                 * txtmp_node.Text = Request.Form["mp_node"];
                 * txtmp_concept.Text = Request.Form["mp_concept"];
                 * txtmp_amount.Text = Request.Form["mp_amount"];
                 * txtmp_customername.Text = Request.Form["mp_customername"];
                 * txtmp_currency.Text = Request.Form["mp_currency"];
                 * txtmp_signature.Text = Request.Form["mp_signature"];
                 * txtmp_urlsuccess.Text = Request.Form["mp_urlsuccess"];
                 * txtmp_urlfailure.Text = Request.Form["mp_urlfailure"];*/

                Uri    myReferrer = Request.UrlReferrer;
                string OrigenUrl  = myReferrer.Host.ToString();
                if (OrigenUrl == "prepro.adquiracloud.mx")

                {
                    lblReference.Text = Request.Form["mp_reference"];
                    lblAmount.Text    = string.Format("{0:c}", Convert.ToDouble(Request.Form["mp_amount"]));
                    string CadenaHash = CNComun.GetSHA256(Request.Form["mp_order"] + Request.Form["mp_reference"] + Request.Form["mp_amount"] + Request.Form["mp_authorization"]);
                    if (Request.Form["mp_signature"] == CadenaHash.ToLower())
                    {
                        if (Request.Form["mp_authorization"] != "000000")
                        {
                            lblMsj.Text = "PAGO EXITOSO"; // +CadenaHash;
                        }
                        else
                        {
                            lblMsj.Text = "PAGO EN PROCESO";
                        }
                    }
                    else
                    {
                        lblMsj.Text = "ERROR ..."; // +CadenaHash; // "ERROR";
                    }
                }

                else
                {
                    lblMsj.Text = "ERROR EN URL";
                }
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SesionUsu = (Sesion)Session["SesionFicha"];

            if (!IsPostBack)
            {
                Session["Multipago"] = null;
            }

            else
            {
                if (Session["Multipago"] != null)
                {
                    SesionMultipago = (MultiPago)Session["Multipago"];
                }
            }

            try
            {
                if (Convert.ToString(Request.Form["mp_account"]) != null)
                {
                    SesionMultipago.Account = Convert.ToString(Request.Form["mp_account"]);
                }
                if (Convert.ToString(Request.Form["mp_order"]) != null)
                {
                    SesionMultipago.Order           = Convert.ToString(Request.Form["mp_order"]);
                    SesionMultipago.IdFichaBancaria = Convert.ToInt32(Request.Form["mp_order"]);// SesionUsu.FichaRefID;
                }
                if (Convert.ToString(Request.Form["mp_reference"]) != null)
                {
                    SesionMultipago.Reference = Convert.ToString(Request.Form["mp_reference"]);
                }
                if (Convert.ToString(Request.Form["mp_node"]) != null)
                {
                    SesionMultipago.Node = Convert.ToString(Request.Form["mp_node"]);
                }
                if (Convert.ToString(Request.Form["mp_concept"]) != null)
                {
                    SesionMultipago.Concept = Convert.ToString(Request.Form["mp_concept"]);
                }
                if (Convert.ToString(Request.Form["mp_amount"]) != null)
                {
                    SesionMultipago.Amount = string.Format("{0:0.00}", Convert.ToString(Request.Form["mp_amount"]));
                }
                if (Convert.ToString(Request.Form["mp_currency"]) != null)
                {
                    SesionMultipago.Currency = Convert.ToString(Request.Form["mp_currency"]);
                }
                if (Convert.ToString(Request.Form["mp_paymentmethod"]) != null)
                {
                    SesionMultipago.PaymentMethod = Convert.ToString(Request.Form["mp_paymentmethod"]);
                }
                if (Convert.ToString(Request.Form["mp_paymentmethodcomplete"]) != null)
                {
                    SesionMultipago.PaymentMethodComplete = Convert.ToString(Request.Form["mp_paymentmethodcomplete"]);
                }
                if (Convert.ToString(Request.Form["mp_response"]) != null)
                {
                    SesionMultipago.Response = Convert.ToString(Request.Form["mp_response"]);
                }
                if (Convert.ToString(Request.Form["mp_responsecomplete"]) != null)
                {
                    SesionMultipago.ResponseComplete = Convert.ToString(Request.Form["mp_responsecomplete"]);
                }
                if (Convert.ToString(Request.Form["mp_responsemsg"]) != null)
                {
                    SesionMultipago.Responsemsg = Convert.ToString(Request.Form["mp_responsemsg"]);
                }
                if (Convert.ToString(Request.Form["mp_responsemsgcomplete"]) != null)
                {
                    SesionMultipago.ResponseMsgComplete = Convert.ToString(Request.Form["mp_responsemsgcomplete"]);
                }
                if (Convert.ToString(Request.Form["mp_authorization"]) != null)
                {
                    SesionMultipago.Authorization = Convert.ToString(Request.Form["mp_authorization"]);
                }
                if (Convert.ToString(Request.Form["mp_authorizationcomplete"]) != null)
                {
                    SesionMultipago.AuthorizationComplete = Convert.ToString(Request.Form["mp_authorizationcomplete"]);
                }
                if (Convert.ToString(Request.Form["mp_pan"]) != null)
                {
                    SesionMultipago.Pan = Convert.ToString(Request.Form["mp_pan"]);
                }
                if (Convert.ToString(Request.Form["mp_pancomplete"]) != null)
                {
                    SesionMultipago.PanComplete = Convert.ToString(Request.Form["mp_pancomplete"]);
                }
                if (Convert.ToString(Request.Form["mp_date"]) != null)
                {
                    SesionMultipago.Date = Convert.ToString(Request.Form["mp_date"]);
                }
                if (Convert.ToString(Request.Form["mp_signature"]) != null)
                {
                    SesionMultipago.Signature = Convert.ToString(Request.Form["mp_signature"]);
                }
                if (Convert.ToString(Request.Form["mp_customername"]) != null)
                {
                    SesionMultipago.Customername = Convert.ToString(Request.Form["mp_customername"]);
                }
                if (Convert.ToString(Request.Form["mp_promo_msi"]) != null)
                {
                    SesionMultipago.Promo_Msi = Convert.ToString(Request.Form["mp_promo_msi"]);
                }
                if (Convert.ToString(Request.Form["mp_bankcode"]) != null)
                {
                    SesionMultipago.Bankcode = Convert.ToString(Request.Form["mp_bankcode"]);
                }
                if (Convert.ToString(Request.Form["mp_saleid"]) != null)
                {
                    SesionMultipago.Saleid = Convert.ToString(Request.Form["mp_saleid"]);
                }
                if (Convert.ToString(Request.Form["mp_sale_historyid"]) != null)
                {
                    SesionMultipago.Sale_Historyid = Convert.ToString(Request.Form["mp_sale_historyid"]);
                }
                if (Convert.ToString(Request.Form["mp_trx_historyid"]) != null)
                {
                    SesionMultipago.Trx_Historyid = Convert.ToString(Request.Form["mp_trx_historyid"]);
                }
                if (Convert.ToString(Request.Form["mp_trx_historyidcomplete"]) != null)
                {
                    SesionMultipago.Trx_Historyidcomplete = Convert.ToString(Request.Form["mp_trx_historyidcomplete"]);
                }
                if (Convert.ToString(Request.Form["mp_bankname"]) != null)
                {
                    SesionMultipago.Bankname = Convert.ToString(Request.Form["mp_bankname"]);
                }
                if (Convert.ToString(Request.Form["mp_folio"]) != null)
                {
                    SesionMultipago.Folio = Convert.ToString(Request.Form["mp_folio"]);
                }
                if (Convert.ToString(Request.Form["mp_cardholdername"]) != null)
                {
                    SesionMultipago.Cardholdername = Convert.ToString(Request.Form["mp_cardholdername"]);
                }
                if (Convert.ToString(Request.Form["mp_phone"]) != null)
                {
                    SesionMultipago.Phone = Convert.ToString(Request.Form["mp_phone"]);
                }
                if (Convert.ToString(Request.Form["mp_email"]) != null)
                {
                    SesionMultipago.Email = Convert.ToString(Request.Form["mp_email"]);
                }
                if (Convert.ToString(Request.Form["mp_promo"]) != null)
                {
                    SesionMultipago.Promo = Convert.ToString(Request.Form["mp_promo"]);
                }
                if (Convert.ToString(Request.Form["mp_promo_msi_bank"]) != null)
                {
                    SesionMultipago.Promo_msi_bank = Convert.ToString(Request.Form["mp_promo_msi_bank"]);
                }
                if (Convert.ToString(Request.Form["mp_securepayment"]) != null)
                {
                    SesionMultipago.Securepayment = Convert.ToString(Request.Form["mp_securepayment"]);
                }
                if (Convert.ToString(Request.Form["mp_cardtype"]) != null)
                {
                    SesionMultipago.Cardtype = Convert.ToString(Request.Form["mp_cardtype"]);
                }


                if (SesionMultipago != null)
                {
                    lblFolio.Text = SesionMultipago.Order;
                    //lblMedioPago.Text = (SesionMultipago.PaymentMethod == "TDX") ? "VISA/MASTERCARD" : "";
                    lblMedioPago.Text = (SesionMultipago.PaymentMethod == "TDX") ? "VISA/MASTERCARD" : (SesionMultipago.PaymentMethod == "CLABE") ? "CLABE INTERBANCARIA": (SesionMultipago.PaymentMethod == "CIE_INTER") ? "CIE INTERBANCARIO":"";

                    lblReferencia.Text   = SesionMultipago.Reference;
                    lblImporte.Text      = string.Format("{0:c2}", Convert.ToDouble(SesionMultipago.Amount));
                    lblAutorizacion.Text = SesionMultipago.Authorization;
                    lblNumTarjeta.Text   = SesionMultipago.PanComplete;
                    lblFecha.Text        = string.Format("{0:dd/MM/yyyy}", SesionMultipago.Date);
                    if (SesionMultipago.Id_Fact == 0)
                    {
                        Verificador = string.Empty;
                        string Msj = string.Empty;
                        //try
                        //{
                        SesionMultipago.Carrera = "";// SesionUsu.UsuCarrera;
                        SesionMultipago.Origen  = "SYSWEB";
                        Session["Multipago"]    = SesionMultipago;
                        string CadenaHash = CNComun.GetSHA256(SesionMultipago.Order + SesionMultipago.Reference + SesionMultipago.Amount + SesionMultipago.Authorization);

                        if (SesionMultipago.Signature == CadenaHash)
                        {
                            if (SesionMultipago.Authorization != null)
                            {
                                if (SesionMultipago.Authorization.Length >= 1)
                                {
                                    if (SesionMultipago.Authorization != "000000")
                                    {
                                        //Msj = "!PAGO REALIZADO CON ÉXITO¡";
                                        Msj = string.Empty;
                                        divPagoConf.Visible = true;
                                        lblmensaje2.Text    = "Si desea descargar nuevamente su recibo oficial puede hacerlo accediendo al <BR/> Sistema de Recaudación de Ingresos (https://sysweb.unach.mx/ingresos)";
                                    }

                                    else
                                    {
                                        Msj = "Su pago de encuentra en proceso, en dos días hábiles podrá consultar su estatus accediendo al <BR/> Sistema de Recaudación de Ingresos (https://sysweb.unach.mx/ingresos)";  //"PAGO EN PROCESO DE VALIDACIÓN";
                                    }


                                    SesionMultipago.Id_Fact = -1;
                                    CNMultipago.InsertarMultipago_Transaccion(ref SesionMultipago, ref Verificador);
                                    if (Verificador != "0")
                                    {
                                        lblMsj.Text = Verificador;
                                    }
                                    else
                                    {
                                        if (SesionMultipago.Id_Fact == -1)
                                        {
                                            lblMsj.Text = Msj + SesionMultipago.Reference + "***";
                                        }
                                        else
                                        {
                                            SesionMultipago.Id_Fact = SesionMultipago.Id_Fact;
                                            lblMsj.Text             = "*" + Msj + "*";
                                            //ScriptManager.RegisterStartupScript(this, this.GetType(), UniqueID, "VerRecibo(3," + SesionMultipago.Id_Fact + ");", true);
                                            string ruta  = "../Reportes/VisualizadorCrystal.aspx?cverep=3&idFact=" + SesionMultipago.Id_Fact;
                                            string _open = "window.open('" + ruta + "', 'miniContenedor', 'toolbar=yes', 'location=no', 'menubar=yes', 'resizable=yes');";
                                            ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), _open, true);

                                            Session["Multipago"]   = null;
                                            Session["SesionFicha"] = null;
                                            //SesionUsu.FichaReferencia = string.Empty;
                                            //SesionUsu.FichaRefID = 0;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                divPagoConf.Visible   = false;
                                divPagoNoConf.Visible = true;
                            }
                        }

                        else
                        {
                            lblMsj.Text = "ERROR 256";
                        }
                        //}
                        //catch (Exception ex)
                        //{
                        //    lblMsj.Text = lblMsj.Text + ex.Message;
                        //}
                    }
                }
            }
            catch (Exception ex)
            {
                lblMsj.Text = lblMsj.Text + ex.Message;
            }
        }