public async Task <JsonResult> FlutterwaveMoviePaymentFM(string Fullname, string phoneNo, string email, string NoOfPersons
                                                                 , string MovieCategory, string Amount, string MovieDay, string MovieTime, string MovieName,
                                                                 string siteId, string orderId, string showtimeId, string MovieCategoryText)
        {
            oGenericViewModel.rv = new ReturnValues();
            string[] id   = MovieCategory.Split('_');
            string[] mDay = MovieDay.Split('_');


            TicketRequestModel ct = new TicketRequestModel();

            ct.Fullname    = Fullname;
            ct.phoneNo     = phoneNo;
            ct.email       = email;
            ct.NoOfPersons = Convert.ToInt32(NoOfPersons);
            ct.Amount      = Amount;
            ct.MovieDate   = MovieDay;
            ct.MovieTime   = MovieTime;
            ct.siteId      = siteId;
            ct.orderId     = orderId;

            ct.cat        = MovieCategoryText;
            ct.showtimeId = showtimeId;
            ct.MovieName  = MovieName;

            ct.TicketCategory = id[1];
            var BatchCounter = oMoviesModelClass.GetCurrentCounter();
            var Reference    = RefferenceGenerator.GenerateReferenceFLW(BatchCounter);
            var rtn          = oMoviesModelClass.SaveTicketDetailsFm(ct, Reference);

            if (rtn.sErrorText == "Success")
            {
                var tk = await oMoviesModelClass.GetClientProfileDetails("002");

                int flutterwaveAmount = oMoviesModelClass.CalculateFlutterAmount(Amount, Convert.ToInt32(NoOfPersons), "");

                FlutterWaveRequestModel rt = new FlutterWaveRequestModel();
                rt.amount = flutterwaveAmount;
                //rt.amount = 5;
                rt.email     = email;
                rt.firstName = Fullname;
                rt.lastName  = Fullname;
                rt.publicKey = tk.MobileClientPayStackSecretKey;
                rt.secretKey = tk.ClientPayStackSecretKey;
                //rt.publicKey = testSecretKey;
                //rt.secretKey = testPublicKeys;
                rt.redirectUrl = tk.TicketPlanetEventCallBackUrl;
                rt.Reference   = Reference;
                rt.phoneNo     = phoneNo;

                return(Json(new { result = rt, error = false }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { error = true }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public async Task <JsonResult> FlutterwaveDubaiPayment(string Fullname, string phoneNo, string email, string NoOfPersons
                                                               , string TicketCategory, string Amount, string comments, int TicketType, string TicketCategoryName, string cardCategory, string Validated, string ReferalId)
        {
            oGenericViewModel.rv = new ReturnValues();

            TicketRequestModel ct = new TicketRequestModel();

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

            ct.email          = email;
            ct.NoOfPersons    = Convert.ToInt32(NoOfPersons);
            ct.TicketCategory = TicketCategory;
            ct.Amount         = Amount;
            //ct.Amount = "5.00";
            //ct.comments = comments;
            ct.TicketType = TicketType;
            ct.ReferalId  = ReferalId == null ? "" : ReferalId;
            //ct.Validated = Validated;

            var BatchCounter = oEventClassModel.GetCurrentCounter();
            var Reference    = RefferenceGenerator.GenerateReferenceFLW(BatchCounter);
            var rtn          = oEventClassModel.SaveTicketDetails(ct, Reference);

            if (rtn.sErrorText == "Success")
            {
                var tk = oEventClassModel.GetClientProfileDetails("002");
                int flutterwaveAmount = oEventClassModel.CalculateFlutterTravelsAmount(Amount, Convert.ToInt32(TicketCategory), TicketCategoryName, Convert.ToInt32(NoOfPersons), cardCategory);

                FlutterWaveRequestModel rt = new FlutterWaveRequestModel();
                rt.amount = flutterwaveAmount;
                //rt.amount = 5;
                rt.email     = email;
                rt.firstName = Fullname;
                rt.lastName  = Fullname;
                rt.publicKey = tk.MobileClientPayStackSecretKey;
                rt.secretKey = tk.ClientPayStackSecretKey;
                //rt.publicKey = testSecretKey;
                //rt.secretKey = testPublicKeys;
                rt.redirectUrl = tk.TicketPlanetEventCallBackUrl;
                rt.Reference   = Reference;
                rt.phoneNo     = phoneNo;

                return(Json(new { result = rt, error = false }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { error = true }, JsonRequestBehavior.AllowGet));
        }
        public async Task <JsonResult> FlutterwaveMoviePaymentPercent(string Fullname, string phoneNo, string email, string NoOfPersons
                                                                      , string MovieCategory, string Amount, string comments, int CinemaLocation, int CinemaCompanyID, string MovieDay, string MovieTime, string MovieName,
                                                                      string IsCoupon, string Coupon, string CouponAgentId, string CouponAssignId, string CouponID, string nErrorCode, string CouponValue)
        {
            oGenericViewModel.rv = new ReturnValues();

            TicketRequestModel ct = new TicketRequestModel();

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

            ct.Amount = Amount;
            var per = 0.1 * Convert.ToInt32(Amount);
            var dec = Convert.ToInt32((Convert.ToInt32(Amount) - per));

            ct.Amount = dec.ToString();
            //ct.Amount = "5.00";
            ct.MovieDate       = MovieDay;
            ct.MovieTime       = MovieTime;
            ct.CinemaCompanyID = CinemaCompanyID;
            ct.CinemaLocation  = CinemaLocation;
            ct.MovieName       = MovieName;
            ct.TicketCategory  = MovieCategory;

            if (!string.IsNullOrEmpty(nErrorCode))
            {
                if (nErrorCode == "1")
                {
                    ct.Coupon         = Coupon;
                    ct.CouponAgentId  = !string.IsNullOrEmpty(CouponAgentId) ? Convert.ToInt32(CouponAgentId) : 0;
                    ct.CouponAssignId = !string.IsNullOrEmpty(CouponAssignId) ? Convert.ToInt32(CouponAssignId) : 0;
                    ct.CouponID       = !string.IsNullOrEmpty(CouponID) ? Convert.ToInt32(CouponID) : 0;
                    ct.IsCoupon       = IsCoupon;
                }
            }
            else
            {
                ct.IsCoupon = "N";
            }

            var BatchCounter = oMoviesModelClass.GetCurrentCounter();
            var Reference    = RefferenceGenerator.GenerateReferenceFLW(BatchCounter);
            var rtn          = oMoviesModelClass.SaveTicketDetails(ct, Reference);

            if (rtn.sErrorText == "Success")
            {
                //string testSecretKey = "FLWSECK_TEST-b252b05cd42022b753045159413ad2ad-X";
                //string testPublicKeys = "FLWPUBK_TEST-1f5f2f2bdd4e5928fdc59fc29296ea91-X";
                var tk = await oMoviesModelClass.GetClientProfileDetails("002");

                int flutterwaveAmount = oMoviesModelClass.CalculateFlutterAmount(Amount, Convert.ToInt32(NoOfPersons), CouponValue);

                FlutterWaveRequestModel rt = new FlutterWaveRequestModel();
                var percent  = 0.1 * flutterwaveAmount;
                var decrease = Convert.ToInt32((flutterwaveAmount - percent));
                rt.amount = decrease;
                //rt.amount = flutterwaveAmount;
                //rt.amount = 5;
                rt.email     = email;
                rt.firstName = Fullname;
                rt.lastName  = Fullname;
                rt.publicKey = tk.MobileClientPayStackSecretKey;
                rt.secretKey = tk.ClientPayStackSecretKey;
                //rt.publicKey = testSecretKey;
                //rt.secretKey = testPublicKeys;
                rt.redirectUrl = tk.TicketPlanetEventCallBackUrl;
                rt.Reference   = Reference;
                rt.phoneNo     = phoneNo;

                return(Json(new { result = rt, error = false }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { error = true }, JsonRequestBehavior.AllowGet));
        }