public async Task <ActionResult> paymentConfirmationFlw(string reference, string fltRef)
        {
            var tk = await oMoviesModelClass.GetClientProfileDetails("002");

            if (tk == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            if (fltRef != "" && reference != "")
            {
                oGenericViewModel.tk_CinemaTransactionLog = oMoviesModelClass.GetTicketDetails(fltRef);
                oGenericViewModel.TransactionRef          = fltRef;
                var BatchCounter = oMoviesModelClass.GetCurrentCounter();

                var res = oMoviesModelClass.SendGenesisMaturionEmail((oGenericViewModel.tk_CinemaTransactionLog));
                if (res != null)
                {
                    BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_CinemaTransactionLog.ContactEmail, "Payment Receipt - " + oGenericViewModel.tk_CinemaTransactionLog.ReferenceNo, res, null, "*****@*****.**"));
                }

                return(View(oGenericViewModel));
                //return Json(new { error = false, location_url = tk.TicketPlanetEventCallBackUrl }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }

            //return View(oBusViewModel);
            //return Json(new { error = true}, JsonRequestBehavior.AllowGet);
        }
        public void SearchAllEventEmails()
        {
            try
            {
                var events = repoEventCustomer.GetAllNonAsync().ToList();
                if (events.Count() > 0 && events != null)
                {
                    foreach (var p in events)
                    {
                        if (p.IsEmailSent == "N" && p.Status == "SUCCESSFULL" && p.TicketCategory != null && p.Retry < 2)
                        {
                            var res = SendEvent(p);
                            EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_EventCustomers.Email, "Payment Receipt - " + oGenericViewModel.tk_EventCustomers.ReferenceNo, res, null, "*****@*****.**");
                        }

                        p.IsEmailSent = "Y";
                        repoEventCustomer.Update(p);
                        var retV = unitOfWork.CommitNonAsync(1) > 0 ? true : false;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <JsonResult> InitializeFreeEventPayment(string Fullname, string phoneNo, string email, string NoOfPersons,
                                                                  int TicketType)
        {
            oGenericViewModel.rv = new ReturnValues();

            TicketRequestModel ct = new TicketRequestModel();

            ct.Fullname = Fullname;
            ct.phoneNo  = phoneNo;

            ct.email       = email;
            ct.NoOfPersons = Convert.ToInt32(NoOfPersons);

            ct.TicketType = TicketType;

            var BatchCounter = oEventClassModel.GetCurrentCounter();
            var Reference    = RefferenceGenerator.GenerateReference(BatchCounter);
            var rtn          = oEventClassModel.SaveFreeTicketDetails(ct, Reference);

            if (rtn.Itbid != 0)
            {
                var res = oEventClassModel.SendEvent((rtn));
                if (res != null)
                {
                    BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(rtn.Email, "Payment Receipt - " + rtn.ReferenceNo, res, null, "*****@*****.**"));
                }

                return(Json(new { nErrorCode = 0, sErrorText = "Event Registered Successfully" }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { nErrorCode = -1, sErrorText = "Event Failed to Register" }, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> PaymentConfirmationFmflw(string reference, string fltRef)
        {
            //var paystackTransactionAPI = new PaystackTransaction(secretKey);
            var tk = await oMoviesModelClass.GetClientProfileDetails("002");

            if (tk == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            if (fltRef != "" && reference != "")
            {
                //var response = await paystackTransactionAPI.VerifyTransaction(tranxRef);
                //if (response.status)
                //{
                //    oMoviesModelClass.SaveSms(tranxRef);
                //    oMoviesModelClass.UpdatePaymentStatus(tranxRef);
                //    oBusViewModel.tk_CinemaTransactionLog = oMoviesModelClass.GetTicketDetails(tranxRef);
                //    oBusViewModel.TransactionRef = tranxRef;
                //    var BatchCounter = oTicketPlanetModel.GetCurrentCounter();
                //    return View(oBusViewModel);
                //}

                oGenericViewModel.tk_CinemaTransactionLog = oMoviesModelClass.GetTicketDetails(reference);
                oGenericViewModel.TransactionRef          = reference;
                var BatchCounter = oMoviesModelClass.GetCurrentCounter();

                // FilmHouse Call for Setting Customer Details and Getting Booking Reference
                if (oGenericViewModel.tk_CinemaTransactionLog != null)
                {
                    oGenericViewModel.BookingId = await oMoviesModelClass.CompleteTransaction(oGenericViewModel.tk_CinemaTransactionLog.OrderId,
                                                                                              oGenericViewModel.tk_CinemaTransactionLog.ContactFullname, oGenericViewModel.tk_CinemaTransactionLog.ContactEmail,
                                                                                              oGenericViewModel.tk_CinemaTransactionLog.ContactPhoneNo, oGenericViewModel.tk_CinemaTransactionLog.TotalAmount.ToString());


                    if (oGenericViewModel.BookingId != null)
                    {
                        await oMoviesModelClass.UpdateBookingRef(oGenericViewModel.BookingId, reference);

                        var res = oMoviesModelClass.SendFilmHouseEmail((oGenericViewModel.tk_CinemaTransactionLog));
                        if (res != null)
                        {
                            BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_CinemaTransactionLog.ContactEmail, "Payment Receipt - " + oGenericViewModel.BookingId, res, null, "*****@*****.**"));
                        }
                    }
                }

                return(View(oGenericViewModel));
            }

            return(View(oGenericViewModel));
        }
        public async Task <ActionResult> PaymentConfirmationFm()
        {
            var tk = await oMoviesModelClass.GetClientProfileDetails("001");

            if (tk == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            string secretKey = tk.ClientPayStackSecretKey;
            var    paystackTransactionAPI = new PaystackTransaction(secretKey);
            var    tranxRef = HttpContext.Request.QueryString["reference"];

            if (tranxRef != null)
            {
                var response = await paystackTransactionAPI.VerifyTransaction(tranxRef);

                if (response.status)
                {
                    oMoviesModelClass.SaveSms(tranxRef);
                    oMoviesModelClass.UpdatePaymentStatus(tranxRef);
                    oGenericViewModel.tk_CinemaTransactionLog = oMoviesModelClass.GetTicketDetails(tranxRef);
                    oGenericViewModel.TransactionRef          = tranxRef;
                    var BatchCounter = oMoviesModelClass.GetCurrentCounter();

                    #region FilmHouse Call for Setting Customer Details and Getting Booking Reference
                    if (oGenericViewModel.tk_CinemaTransactionLog != null)
                    {
                        oGenericViewModel.BookingId = await oMoviesModelClass.CompleteTransaction(oGenericViewModel.tk_CinemaTransactionLog.OrderId,
                                                                                                  oGenericViewModel.tk_CinemaTransactionLog.ContactFullname, oGenericViewModel.tk_CinemaTransactionLog.ContactEmail,
                                                                                                  oGenericViewModel.tk_CinemaTransactionLog.ContactPhoneNo, oGenericViewModel.tk_CinemaTransactionLog.TotalAmount.ToString());


                        if (oGenericViewModel.BookingId != null)
                        {
                            await oMoviesModelClass.UpdateBookingRef(oGenericViewModel.BookingId, tranxRef);

                            var res = oMoviesModelClass.SendFilmHouseEmail((oGenericViewModel.tk_CinemaTransactionLog));
                            if (res != null)
                            {
                                BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_CinemaTransactionLog.ContactEmail, "Payment Receipt - " + oGenericViewModel.BookingId, res, null, "*****@*****.**"));
                            }
                        }
                    }
                    #endregion

                    return(View(oGenericViewModel));
                }
            }

            return(View(oGenericViewModel));
        }
Exemple #6
0
        public async Task <ActionResult> PaymentConfirmation()
        {
            var tk = oEventClassModel.GetClientProfileDetails("001");

            if (tk == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            string secretKey = tk.ClientPayStackSecretKey;
            var    paystackTransactionAPI = new PaystackTransaction(secretKey);
            var    tranxRef = HttpContext.Request.QueryString["reference"];

            if (tranxRef != null)
            {
                var response = await paystackTransactionAPI.VerifyTransaction(tranxRef);

                if (response.status)
                {
                    oEventClassModel.UpdatePaymentStatus(tranxRef);

                    oGenericViewModel.tk_EventCustomers = oEventClassModel.GetCustomerInfo(tranxRef);
                    oGenericViewModel.tk_Event          = oEventClassModel.GetEventInfo(Convert.ToInt32(oGenericViewModel.tk_EventCustomers.EventId));
                    oGenericViewModel.TransactionRef    = tranxRef;
                    oGenericViewModel.eventCategoryName = oEventClassModel.GetTicketCategory((int)oGenericViewModel.tk_EventCustomers.TicketCategory);
                    oGenericViewModel.EventImagePath    = oEventClassModel.GetEventImagePath((int)oGenericViewModel.tk_EventCustomers.EventId);
                    //Insert Into Transaction Log
                    oEventClassModel.SaveIntoTransactionLog(tranxRef);

                    var res = oEventClassModel.SendEvent((oGenericViewModel.tk_EventCustomers));
                    if (res != null)
                    {
                        BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_EventCustomers.Email, "Payment Receipt - " + oGenericViewModel.tk_EventCustomers.ReferenceNo, res, null, "*****@*****.**"));
                    }

                    return(View(oGenericViewModel));
                }
            }

            return(View(oGenericViewModel));
        }
        public async Task <ActionResult> PaymentConfirmation()
        {
            var tk = await oMoviesModelClass.GetClientProfileDetails("001");

            if (tk == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            string secretKey = tk.ClientPayStackSecretKey;
            var    paystackTransactionAPI = new PaystackTransaction(secretKey);
            var    tranxRef = HttpContext.Request.QueryString["reference"];

            if (tranxRef != null)
            {
                var response = await paystackTransactionAPI.VerifyTransaction(tranxRef);

                if (response.status)
                {
                    oMoviesModelClass.SaveSms(tranxRef);
                    oMoviesModelClass.UpdatePaymentStatus(tranxRef);
                    oGenericViewModel.tk_CinemaTransactionLog = oMoviesModelClass.GetTicketDetails(tranxRef);
                    oGenericViewModel.TransactionRef          = tranxRef;
                    var BatchCounter = oMoviesModelClass.GetCurrentCounter();


                    var res = oMoviesModelClass.SendGenesisMaturionEmail((oGenericViewModel.tk_CinemaTransactionLog));
                    if (res != null)
                    {
                        BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_CinemaTransactionLog.ContactEmail, "Payment Receipt - " + oGenericViewModel.tk_CinemaTransactionLog.ReferenceNo, res, null, "*****@*****.**"));
                    }


                    return(View(oGenericViewModel));
                }
            }

            return(View(oGenericViewModel));
        }
Exemple #8
0
        public async Task <ActionResult> paymentConfirmationFlw(string reference, string flwRef)
        {
            var tk = oEventClassModel.GetClientProfileDetails("002");

            if (tk == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            if (flwRef == "")
            {
                return(RedirectToAction("Index", "Home"));
            }

            if (flwRef != "" && reference != "")
            {
                oGenericViewModel.tk_EventCustomers = oEventClassModel.GetCustomerInfo(flwRef);
                oGenericViewModel.TransactionRef    = flwRef;
                oGenericViewModel.tk_Event          = oEventClassModel.GetEventInfo(Convert.ToInt32(oGenericViewModel.tk_EventCustomers.EventId));
                //var BatchCounter = oEventClassModel.GetCurrentCounter();
                oGenericViewModel.eventCategoryName = oEventClassModel.GetTicketCategory((int)oGenericViewModel.tk_EventCustomers.TicketCategory);
                oGenericViewModel.EventImagePath    = oEventClassModel.GetEventImagePath((int)oGenericViewModel.tk_EventCustomers.EventId);


                var res = oEventClassModel.SendEvent((oGenericViewModel.tk_EventCustomers));
                if (res != null)
                {
                    BackgroundJob.Enqueue(() => EmailNotificationMail.SendEmailPlain(oGenericViewModel.tk_EventCustomers.Email, "Payment Receipt - " + oGenericViewModel.tk_EventCustomers.ReferenceNo, res, null, "*****@*****.**"));
                }

                return(View(oGenericViewModel));
                //return Json(new { error = false, location_url = tk.TicketPlanetEventCallBackUrl }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }