Ejemplo n.º 1
0
        protected void PayByWallet_Click(object sender, EventArgs e)
        {
            var values = (string)Session["dataAmort"];

            if (!string.IsNullOrEmpty(values))
            {
                var        arrayValues = values.Split('|');
                BrPayments brPayment   = new BrPayments();
                // (int TypePay, string IdMembershipDetail, int nQuotes, decimal NewAmort, int Rate)

                var    arrayLogin = HttpContext.Current.User.Identity.Name.Split('¬');
                string User       = arrayLogin[1];

                BrTypeChange brTypeChange = new BrTypeChange();
                var          arrayChanges = brTypeChange.GetTypesChange().Split('|');
                BrUser       brUser       = new BrUser();
                var          nroDoc       = brUser.getDoc(arrayLogin[1]);
                int          id           = int.Parse(Session["IdImg"].ToString());

                var      amountAmort  = decimal.Parse(arrayValues[2]);
                var      tcBuy        = decimal.Parse(arrayChanges[1]);
                BrWallet brWallet     = new BrWallet();
                var      amountWallet = decimal.Parse(brWallet.GetAmount(arrayLogin[1]));

                amountWallet = amountWallet * tcBuy;

                var currencyCode = arrayValues[5];
                if (currencyCode == "USD")
                {
                    amountAmort = amountAmort * tcBuy;
                }

                if (amountWallet < amountAmort)
                {
                    MessageError.Text = "Wallet Insuficiente";
                    return;
                }

                var data = brWallet.PutPayAmortization(amountAmort, tcBuy, arrayLogin[1]);

                if (data)
                {
                    var    dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');;
                    string date        = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0];
                    var    hour        = DateTime.Now.ToShortTimeString();
                    var    description = amountAmort + " " + currencyCode;

                    var nombreArchivo = GetRecibo(arrayLogin[1], date, arrayLogin[1], hour, "Adelanto de Cuotas", description);

                    decimal value2 = decimal.Parse(arrayValues[2]);
                    bool    ans    = brPayment.Amortization(2, arrayValues[0], Int32.Parse(arrayValues[1]), value2, Int32.Parse(arrayValues[3]), nombreArchivo);
                }
                Response.Redirect("EndPaymentQuote.aspx");
                return;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string TypeMembership = "";

            #region Declaracion de variables
            string           quotesPendiente = "";
            string           codeCurrencyPay = "";
            string           namePeson = "";
            string[]         dataLogin = null;
            int              typeRegister = 0, numberQuotes = 0, formPay = 0, idMemberDetails = 0;
            string           dataKit = null, dataKitMember = null, dataMemberSinKit;
            string           token = null, userCurrent = null, newUserName = null, emailNewUser = null;
            double           amountPay        = 0;
            bool             isRegister       = false;
            BrUser           brUser           = null;
            BrTypeMembership brTypeMembership = null;
            Email            oEmail           = null;
            BrPayments       brPayments       = null;
            BrConsuption     brConsuption;

            #endregion

            #region Entradas de valores

            var _var = (string)Session["typeRegister"];
            if (!string.IsNullOrEmpty(_var))
            {
                typeRegister = int.Parse(Session["typeRegister"].ToString());
            }
            formPay          = int.Parse("1");
            token            = Request["token"].ToString();
            numberQuotes     = int.Parse(Request["numcuotes"].ToString());
            brUser           = new BrUser();
            brTypeMembership = new BrTypeMembership();
            dataLogin        = HttpContext.Current.User.Identity.Name.Split('¬');
            oEmail           = new Email();
            brPayments       = new BrPayments();
            brConsuption     = new BrConsuption();
            #endregion

            #region Procesos

            userCurrent = dataLogin[0];
            if (dataLogin.Length > 1)
            {
                userCurrent = dataLogin[1];
            }

            #endregion

            #region Registrar Usuario Y Generar Cuenta

            if (formPay == 1)
            {
                if (!string.IsNullOrEmpty((string)Session["SwitchAmort"]))
                {
                    var values      = (string)Session["dataAmort"];
                    var arrayValues = values.Split('|');
                    if (!string.IsNullOrEmpty(values))
                    {
                        brPayments = new BrPayments();
                        PayCulqi   payCulqi   = new PayCulqi();
                        MyMessages myMessages = new MyMessages();
                        // (int TypePay, string IdMembershipDetail, int nQuotes, decimal NewAmort, int Rate)
                        //Get the Email
                        string photo     = "culqi.jpeg";
                        string emailUser = brPayments.PayQuoteMembership(arrayValues[0], "10", photo);

                        bool     ans          = brPayments.Amortization(1, arrayValues[0], Int32.Parse(arrayValues[1]), decimal.Parse(arrayValues[2]), Int32.Parse(arrayValues[3]), photo);
                        string   currencyCode = "PEN";
                        string[] culqiAnwser  = payCulqi.newPayment(emailUser, emailUser, double.Parse(arrayValues[2]), token, numberQuotes, currencyCode).Split('¬');

                        if (culqiAnwser[0] == "true")
                        {
                            bool awnserEmail = oEmail.SubmitEmail(emailUser, "[RIBERA DEL RIO - PAGO]", myMessages.EmailPago());
                            Response.Write("true¬" + culqiAnwser[1]);
                            Session.Remove("SwitchAmort");
                            return;
                        }
                        Response.Redirect("Payments.aspx");
                        return;
                    }
                }
                else if (Session["StatusCalendar"] == null)
                {
                    string dataBdd = Session["datos"].ToString();
                    TypeMembership = (dataBdd.Split('$')[3]).Split('|')[7];
                    // string data2 = (string)Session["civilStatus"];
                    string   data2 = (string)Session["civilState"];
                    string[] oIdMembreship_amount = brUser.RegisterUser(dataBdd, data2).Split('¬');

                    if (oIdMembreship_amount.Length < 2)
                    {
                        Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario");
                        return;
                    }

                    string[] parameterPerson  = dataBdd.Split('$');
                    string[] arraydata        = parameterPerson[0].Split('|');
                    string[] arrayTypeaccount = parameterPerson[2].Split('|');
                    string[] arrayaccount     = parameterPerson[3].Split('|');

                    string parameterAccount = arraydata[5].Trim() + "|" + arrayTypeaccount[7].Trim() + '|' + userCurrent + '|' + oIdMembreship_amount[0];
                    //'999999999999|1|sa|1'
                    newUserName = brUser.GenerateAccount(parameterAccount);



                    if (string.IsNullOrEmpty(newUserName))
                    {
                        Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario");
                        return;
                    }
                }
                else
                {
                    var    calendar       = (string)Session["StatusCalendar"];
                    var    data           = (string)Session["StatusCalendar"];
                    string numCuota       = Session["numCuota"].ToString();
                    var    listParameters = data.Split('|');
                    var    data2          = listParameters[0];
                    string quotePay       = (string)Session["quotePay"];
                    string userName       = User.Identity.Name.Split('¬')[1];
                    TypeMembership = User.Identity.Name.Split('¬')[7];
                    string   emailUser    = brUser.GetPersonalInformation(userName).Split('|')[5];
                    PayCulqi payCulqi     = new PayCulqi();
                    string   currencyCode = "PEN";
                    if (Session["CurrencyCode"] != null)
                    {
                        currencyCode = Session["CurrencyCode"].ToString();
                    }
                    string[] culqiAnwser = payCulqi.newPayment(userCurrent, emailUser, Double.Parse(quotePay), token, numberQuotes, currencyCode).Split('¬');

                    bool awnserEmail = oEmail.SubmitEmail(emailUser, "[RIBERA DEL RIO - PAGO]", "Ud. Ha efectuado su pago en Ribera del Rio con Exito.");
                    if (culqiAnwser[0] == "true")
                    {
                        //enviar recibo
                        var dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');;

                        string tranferId  = culqiAnwser[2];
                        string numReceipt = "0";
                        string date       = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0];
                        string nAffiliate = "";

                        string hour    = DateTime.Now.ToString("HH:mm:ss");
                        string detalle = Double.Parse(quotePay).ToString();

                        namePeson = User.Identity.Name.Split('¬')[0].ToUpper();

                        //cvbc
                        string nameTicket = GetRecibo(tranferId, userName, numReceipt, date,
                                                      nAffiliate, TypeMembership, namePeson, hour, detalle,
                                                      quotesPendiente, " " + numCuota);

                        string EmailUserA = brPayments.PayQuoteMembership(data2, "1", nameTicket);
                        Response.Write("true¬" + culqiAnwser[1]);
                    }
                    else
                    {
                        Response.Write("false¬" + culqiAnwser[1]);
                    }
                    return;
                }
            }
            #endregion

            #region Solo elegio el kit

            if (typeRegister == 1 && formPay == 1)
            {
                string arrayKit = Session["arrayKit"].ToString() + "¬" + newUserName;
                //'2018-10-19¬31¬31¬31¬userName'
                //  isRegister = brUser.PutRegisterkIT(arrayKit);
                string data2 = Session["financedAmount"].ToString();
                if (data2 == "0")
                {
                    data2 = Session["Amount"].ToString();
                }

                string codeCurrency = Session["TypeCurrency"].ToString();

                Int32 ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + newUserName, data2, 1, codeCurrency);

                if (ansNmembershi != 0)
                {
                    isRegister = brUser.PutRegisterkIT(arrayKit, ansNmembershi);
                }
                else
                {
                    Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar");
                    return;
                }
                //monto a pagar
                string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬');
                if (username_idmen_amount_email.Length < 4)
                {
                    Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar");
                    return;
                }
                idMemberDetails             = int.Parse(username_idmen_amount_email[1]);
                amountPay                   = double.Parse(username_idmen_amount_email[2]);
                emailNewUser                = username_idmen_amount_email[3];
                username_idmen_amount_email = null;
            }
            #endregion

            #region Elegio kit mas membresia

            if (typeRegister == 2 && formPay == 1)
            {
                dataKitMember = Session["cronograma"].ToString();

                string[] datos = Session["datos"].ToString().Split('$');

                if (Session["datos"] == null)
                {
                    Response.Write("false¬Ha Ocurrido Un Error, no hay datos.");
                    return;
                }
                string[] arraycontacto = datos[3].Split('|');
                string[] arrayperson   = datos[0].Split('|');

                amountPay = double.Parse(Session["FirtsPay"].ToString());


                if (idMemberDetails <= 0 || amountPay <= 0)
                {
                    Response.Write("false¬Ha Ocurrido Un Error id idMemberDetails vacio,amountPay vacio");
                    return;
                }

                string dni = arrayperson[5];

                newUserName     = arrayperson[0].Substring(0, 1).ToUpper() + arrayperson[1].Substring(0, 1).ToUpper() + dni;
                emailNewUser    = arraycontacto[0].Trim();
                codeCurrencyPay = Session["TypeCurrency"].ToString();


                PayCulqi   payCulqi   = new PayCulqi();
                MyMessages myMessages = new MyMessages();
                //string currencyCode = "PEN";
                string[] culqiAnwser = payCulqi.newPayment(newUserName, emailNewUser, amountPay, token, numberQuotes, codeCurrencyPay).Split('¬');
                if (culqiAnwser[0] == "false")
                {
                    Response.Write("false¬" + culqiAnwser[1]);
                    return;
                }



                /*=====================================================================================================================================================================*/

                //correo = arraycontacto[0];
                namePeson = arrayperson[0] + " " + arrayperson[1];


                string date = dataKitMember.Split('$')[1];

                string[] array1     = Session["cronogramaYa"].ToString().Split('^');
                string[] datosMem   = array1[0].Split('|');
                string[] array2     = array1[1].Split('~');
                string[] cuotas     = array2[0].Split('¬');
                string   cronoActiv = "";
                quotesPendiente = (cuotas.Length - 2).ToString();
                for (int i = 0; i < cuotas.Length - 1; i++)
                {
                    var fila = cuotas[i].Split('|');
                    if (fila[0].Substring(0, 7) != "Inicial")
                    {
                        cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd");
                        //amountFinanciade = double.Parse(fila[2].Replace("S/.", ""));
                        break;
                    }
                    else
                    {
                        cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd") + "¬";
                    }
                }

                string respData = brPayments.PersonGetData(newUserName);
                respData = respData + '^' + dataKitMember;
                // isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName);
                string data2        = Session["financedAmount"].ToString();
                string codeCurrency = Session["TypeCurrency"].ToString();

                Int32  ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + newUserName, data2, 1, codeCurrency);
                string exchange      = Session["carrito"].ToString().Split('|')[4];
                isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName, ansNmembershi, exchange, 1);

                //validamos si tiene consumo


                if (!isRegister)
                {
                    Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario");
                    return;
                }

                BrActivation brActivation = new BrActivation();
                bool         registerActi = brActivation.PutCronograma(cronoActiv, newUserName, ansNmembershi);

                //obtengo el monto a pagar

                string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬');
                if (username_idmen_amount_email.Length < 4)
                {
                    Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar");
                    return;
                }
                idMemberDetails             = int.Parse(username_idmen_amount_email[1]);
                amountPay                   = double.Parse(username_idmen_amount_email[2]);
                emailNewUser                = username_idmen_amount_email[3];
                codeCurrencyPay             = username_idmen_amount_email[4];
                date                        = null;
                username_idmen_amount_email = null;
                dataKitMember               = null;
                respData                    = null;


                /*=============================================================================================================================*/

                var dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');;

                string tranferId    = culqiAnwser[2] == null ? "" : culqiAnwser[2];
                string numReceipt   = "0";
                string datecomplete = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0];
                string nAffiliate   = "";

                string hour    = DateTime.Now.ToString("HH:mm:ss");
                string detalle = amountPay.ToString();


                //cvbc
                string nameTicket = GetRecibo(tranferId, newUserName, numReceipt, datecomplete, nAffiliate, TypeMembership, namePeson, hour, detalle, quotesPendiente, " Inicial 1");


                //marcar como pagado en la tabla membershipdetails
                bool habiliAccount = brUser.enableAcount(idMemberDetails, nameTicket);

                int nAfiliate = int.Parse(brUser.GetNafiliate(idMemberDetails));

                Cronograma2(nAfiliate, codeCurrencyPay);

                // enviar el email de confirmacion con la data y lo redirecciona al post register
                if (!habiliAccount)
                {
                    Response.Write("false¬Ha Ocurrido un Error al Intentar Habilitar Su Cuenta.Sin embargo su Pago fue Exitoso");
                    return;
                }


                string ruta = HttpContext.Current.Server.MapPath("~/Resources/PoliticsPdf/");
                //enviar email con los documentos
                if (typeRegister == 2 && formPay == 1)
                {
                    bool awnserEmailDoc = oEmail.SubmitEmail(emailNewUser, "[RIBERA DEL RIO - BIENVENIDO]", myMessages.DocumentosRegister(newUserName), true, ruta, newUserName);
                }
                else
                {
                    bool awnserEmailDoc = oEmail.SubmitEmailKit(emailNewUser, "[RIBERA DEL RIO - BIENVENIDO]", myMessages.DocumentosRegister(newUserName), true, ruta);
                }


                bool awnserEmail = oEmail.SubmitEmail(emailNewUser, "[RIBERA DEL RIO - PAGO]", myMessages.EmailPago());

                //ejecutamos el core para los puntos de equipo
                // BrCore_Automation brCore_Automation = new BrCore_Automation();
                //bool isCoreRegister = brCore_Automation.ExecuteCore();

                Response.Write("true¬" + culqiAnwser[1]);
                return;
            }
            #endregion
        }
Ejemplo n.º 3
0
        protected void btnEnviarAhora_Click(object sender, EventArgs e)
        {
            var data = (string)Session["dataQuote"];

            if (!string.IsNullOrEmpty(data))
            {
                string IdMembershipPayDetail = data.Split('|')[0];
                var    log  = HttpContext.Current.User.Identity.Name.Split('¬');
                string User = log[1];
                if (!string.IsNullOrEmpty(IdMembershipPayDetail))
                {
                    // string[] parameterPerson = dataPerson.Split('$');
                    // string[] arraydata = parameterPerson[0].Split('|');
                    string[] arraynombreArchivo2 = fuRecibo.FileName.Split('.');

                    int indice = (arraynombreArchivo2.Length - 1);

                    string extension = arraynombreArchivo2[indice];

                    string nombreArchivo = User + "." + extension;

                    brUser = new BrUser();
                    var nroDoc = brUser.getDoc(log[1]);
                    int id     = int.Parse(Session["IdImg"].ToString());
                    nombreArchivo = nroDoc + id.ToString() + "." + extension;

                    string ruta = "~/Resources/RecibosRegister/" + nombreArchivo;
                    fuRecibo.SaveAs(Server.MapPath(ruta));
                    brPayment = new BrPayments();
                    bool ans = brPayment.UploadReceiptCalendar(IdMembershipPayDetail + '|' + nombreArchivo);
                    if (ans)
                    {
                        Session["SwitchEmailPayQuote"] = "1";
                        Response.Redirect("EndPaymentQuote.aspx");
                    }
                    else
                    {
                        Response.Redirect("Index.aspx");
                    }
                }
                else
                {
                    Response.Redirect("Index.aspx");
                }
            }
            else
            {
                var values = (string)Session["dataAmort"];

                if (!string.IsNullOrEmpty(values))
                {
                    var arrayValues = values.Split('|');
                    brPayment = new BrPayments();
                    // (int TypePay, string IdMembershipDetail, int nQuotes, decimal NewAmort, int Rate)
                    string[] arraynombreArchivo2 = fuRecibo.FileName.Split('.');
                    var      log       = HttpContext.Current.User.Identity.Name.Split('¬');
                    string   User      = log[1];
                    int      indice    = (arraynombreArchivo2.Length - 1);
                    string   extension = arraynombreArchivo2[indice];

                    brUser = new BrUser();
                    var    nroDoc        = brUser.getDoc(log[1]);
                    int    id            = int.Parse(Session["IdImg"].ToString());
                    string nombreArchivo = nroDoc + id.ToString() + "." + extension;

                    //string nombreArchivo = arraynombreArchivo2[0] + "." + extension;
                    string ruta = "~/Resources/RecibosRegister/" + nombreArchivo;

                    fuRecibo.SaveAs(Server.MapPath(ruta));
                    decimal value2 = decimal.Parse(arrayValues[2]);
                    bool    ans    = brPayment.Amortization(2, arrayValues[0], Int32.Parse(arrayValues[1]), value2, Int32.Parse(arrayValues[3]), nombreArchivo);

                    Response.Redirect("EndPaymentQuote.aspx");
                    return;
                }
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //declaracion de variables
            int        opcionRegister = 0;
            BrUser     brUser;
            BrPayments brPayments;

            string parameterToken = null;
            string oNumberQuotes  = null;

            this.NumberQuotes = int.Parse(Request["numcuotes"]);

            parameterToken    = Request["token"];
            oNumberQuotes     = Request["numcuotes"];
            this.NumberQuotes = int.Parse(Request["numcuotes"]);
            this.CodeIgnore   = 0;

            //string parameterToken = "";
            if (string.IsNullOrEmpty(parameterToken))
            {
                Response.Write("false¬Ha Ocurrido un Error Al Intentar Token");
                return;
            }
            if (string.IsNullOrEmpty(oNumberQuotes))
            {
                Response.Write("false¬Ha Ocurrido un Error,el numero de Cuotas es Invalido");
                return;
            }


            if (this.NumberQuotes < 1)
            {
                Response.Write("false¬Ha Ocurrido un Error,el numero de Cuotas es Invalido");
                return;
            }
            if (this.NumberQuotes > 32)
            {
                Response.Write("false¬Ha Ocurrido un Error,el numero de Cuotas es Invalido");
                return;
            }

            //Session["datos"] = "samir|torres|cuarto|15-04-2018|M|[email protected]|111112122212|ubigeo|1|20202020845454|EXP|knava|1|50|24";
            /*registes user and general account*/
            if (Session["datos"] != null)
            {
                //cuando va a registrar
                string dataBdd              = Session["datos"].ToString();
                string TypeMembership       = (dataBdd.Split('$')[3]).Split('|')[7];
                BrUser obrUser              = new BrUser();
                string data2                = (string)Session["civilState"];
                string idMembreship_amount  = obrUser.RegisterUser(dataBdd, data2);
                var    oIdMembreship_amount = idMembreship_amount.Split('¬');

                if (oIdMembreship_amount.Length < 2)
                {
                    Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario");
                    return;
                }

                var parameterPerson = dataBdd.Split('$');

                var arraydata        = parameterPerson[0].Split('|');
                var arrayTypeaccount = parameterPerson[2].Split('|');
                var arrayaccount     = parameterPerson[3].Split('|');

                var arrayInfo = HttpContext.Current.User.Identity.Name.Split('¬');

                string padre = arrayInfo[0];
                if (arrayInfo.Length > 1)
                {
                    padre = arrayInfo[1];
                }/*merge*/

                string parameterAccount = arraydata[5].Trim() + "|" + arrayTypeaccount[7].Trim() + '|' + padre + '|' + oIdMembreship_amount[0];
                //'999999999999|1|sa|1'
                this.NewUserName = obrUser.GenerateAccount(parameterAccount);

                if (string.IsNullOrEmpty(this.NewUserName))
                {
                    Response.Write("false¬Ha Ocurrido Un Error al Intentar Generar la Cuenta de Usuario");
                    return;
                }

                brPayments = new BrPayments();

                //IdPerson | empty ^ amountDollars | changeTo | empty | empty | nQuote | InititalDate | InitalAmount | PercentInterest | default:1 | Empty ^ QuoteDate | InitalAmountQuote ~vvhvbnvbnvb|nvbnvbnvbnvb|1|6756575|67567567$2018-09-19
                var listParameters = HttpContext.Current.User.Identity.Name.Split('¬'); //fullName,userName

                var userName = listParameters[0];

                if (listParameters.Length > 1)
                {
                    userName = listParameters[1];
                }
                //sacar monto

                if (!string.IsNullOrEmpty((string)Session["SwitchAmort"]))
                {
                    var values      = (string)Session["dataAmort"];
                    var arrayValues = values.Split('|');
                    if (!string.IsNullOrEmpty(values))
                    {
                        brPayments = new BrPayments();
                        // (int TypePay, string IdMembershipDetail, int nQuotes, decimal NewAmort, int Rate)
                        bool ans = brPayments.Amortization(2, arrayValues[0], Int32.Parse(arrayValues[1]), decimal.Parse(arrayValues[2]), Int32.Parse(arrayValues[3]), "culqi");

                        Response.Redirect("Payments.aspx");
                        return;
                    }
                }
                else if (Session["cronograma"] != null)
                {
                    var  ej = Session["cronograma"].ToString();
                    bool registerCronograma = false;
                    //si es kit  inserte unico '2018-10-19¬31¬31¬31¬HOLA'

                    string fecha = ej.Split('$')[1];

                    //double amountKit = double.Parse("10");
                    //double tpKit = double.Parse(ej.Split('|')[1]);

                    //double totalKit = (amountKit * tpKit);
                    //string arrayKit = fecha + "¬" + totalKit.ToString() + "¬" + totalKit.ToString() + "¬" + totalKit.ToString() + "¬" + this.UserName;

                    //registerCronograma = brPayments.PutRegisterkIT(arrayKit);

                    //if (!registerCronograma)
                    //{
                    //    Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Kit de Inicio");
                    //    return;
                    //}
                    //var ej = "2500|3.25|VE034|VE035|23|2018-09-19|1944|10|1|obs^2018-09-19|1944~nombre|apellido|1|45345345|45345345$2018-10-19";
                    //1|EXP  ^6300.00|3.25|empty|empty|60|2018-10-17|2047.5|10|1|empty^2018-10-17|2047.5~Jose|dcvsdf|1966660000|966660000$2018-11-01
                    string respData = brPayments.PersonGetData(userName);  //1|EXP|knava vs|CLB^3000|3.2|VE034|VE035|24|2018-10-10|soles1000|10|1|obs^2018-10-11|1000~nombres|apellidos|1|73680066|963258741$2018-10-12
                    respData = respData + '^' + ej;
                    brUser   = new BrUser();
                    string data3 = Session["financedAmount"].ToString();
                    //  Int32 ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + userName, data3);
                    // registerCronograma = brPayments.GetCalculatePaymentSchedule(respData, this.NewUserName, ansNmembershi);


                    if (!registerCronograma)
                    {
                        Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario");
                        return;
                    }

                    this.IsCronograma = 1;
                    // en el caso que tenga cronograma de pagos
                    BrUser brUser2 = new BrUser();
                    //this.UserName = "******";
                    //monto a pagar en el registro
                    this.username_idmen_amount_email = brUser2.getAmountPay(this.NewUserName).Split('¬');
                    //username¬amount¬email
                    brUser2 = null;

                    if (this.username_idmen_amount_email.Length < 4)
                    {
                        Response.Write("false¬Ha Ocurrido un Error al Intentar Verificar el Monto a Pagar");
                        return;
                    }

                    if (Session["exonerar"] != null)
                    {
                        if (Session["exonerar"].ToString() == "true")
                        {
                            this.Exonerar = 1;
                        }
                    }


                    var change = HttpContext.Current.User.Identity.Name.Split('¬')[5];
                    //le agrego el monto del kit
                    //username_idmen_amount_email[2] = (double.Parse(username_idmen_amount_email[2]) + (double.Parse("10") * double.Parse(change))).ToString();
                }
                else
                {
                    this.CodeIgnore = 1;
                }
                Email email2 = new Email();
                if (!email2.SubmitEmail(arrayaccount[0].Trim(), "[USUARIO_REGISTRADO]", "Tu usuario Es :" + this.NewUserName.ToUpper() + "\n" + "Tu contraseña es:" + this.NewUserName.ToUpper()))
                {
                    Response.Write("false¬Ha Ocurrido un Error al Intentar Enviarle un Email Con Sus Datos de su Cuenta");
                    return;
                }
                email2 = null;
            }
            else
            {
                if (Session["kit"] != null)
                {
                    this.CodeIgnore = 1;
                }
                else
                {
                    var login = HttpContext.Current.User.Identity.Name.Split('¬');
                    if (login.Length > 1)
                    {
                        this.IdMembreship = int.Parse(Session["numMembershipDet"].ToString());
                        BrUser brUser1 = new BrUser();
                        this.NewUserName = login[1];
                        this.username_idmen_amount_email = brUser1.getAmountPay(this.IdMembreship, this.NewUserName).Split('¬');
                        brUser1 = null;
                        if (this.username_idmen_amount_email.Length < 4)
                        {
                            Response.Write("false¬Ha Ocurrido un Error al Intentar Verificar el Monto a Pagar");
                            return;
                        }
                    }
                    else
                    {
                        Response.Write("false¬Intentelo mas Tarde");
                        return;
                    }
                }
            }
            /*end register user and general account*/


            /*page on line*/

            if (this.CodeIgnore == 0)
            {
                if (username_idmen_amount_email.Length < 4)
                {
                    Response.Write("false¬Ha Ocurrido un Error al Intentar Verificar el Monto a Pagar");
                    return;
                }
            }


            double monto = 0;

            //solo el kit
            if (this.CodeIgnore == 1)
            {
                monto = double.Parse("10") * double.Parse(Session["tipocambio"].ToString());
            }

            if (this.CodeIgnore == 0)
            {
                if (this.Exonerar != 1)
                {
                    monto = double.Parse(username_idmen_amount_email[2]) + (double.Parse("10") * double.Parse(Session["tipocambio"].ToString()));
                }

                else
                {
                    monto = double.Parse(username_idmen_amount_email[2]);
                }
            }


            PayCulqi payCulqi     = new PayCulqi();
            string   currencyCode = "PEN";

            string[] culqiAnwser = payCulqi.newPayment(this.NewUserName, "*****@*****.**", monto, parameterToken, this.NumberQuotes, currencyCode).Split('¬');


            string miemail = "";

            if (this.CodeIgnore == 1)
            {
                miemail = Session["email"].ToString();
            }
            else
            {
                miemail = username_idmen_amount_email[3];
                brUser  = new BrUser();
                bool habiliAccount = brUser.enableAcount(int.Parse(username_idmen_amount_email[1]), "");
                brUser = null;
                //enviar el email de confirmacion con la data y lo redirecciona al post register
                if (!habiliAccount)
                {
                    Response.Write("false¬Ha Ocurrido un Error al Intentar Habilitar Su Cuenta.");
                    return;
                }
            }

            Email email = new Email();

            if (email.SubmitEmail(miemail, "[RIBERA DEL RIO - PAGO]", "Ud. Ha efectuado su pago en Ribera del Rio con Exito."))
            {
                email = null;
                Response.Clear();
                Response.Write("true¬" + culqiAnwser[1]);
                Session["datos"] = null;
                return;
            }
            Response.Write("false");
            return;
        }