Ejemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            BarclaysPayment = await _context.BarclaysPayment.FirstOrDefaultAsync(m => m.BarclaysPaymentID == id);

            if (BarclaysPayment == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            BarclaysPayment = await _context.BarclaysPayment
                              .Include(b => b.PaymentReason).FirstOrDefaultAsync(m => m.BarclaysPaymentID == id);

            if (BarclaysPayment == null)
            {
                return(NotFound());
            }
            ViewData["PaymentReasonID"] = new SelectList(_context.PaymentReason, "PaymentReasonID", "PaymentReasonID");
            return(Page());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            BarclaysPayment = await _context.BarclaysPayment.FindAsync(id);

            if (BarclaysPayment != null)
            {
                _context.BarclaysPayment.Remove(BarclaysPayment);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Ejemplo n.º 4
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync(BarclaysPayment model)
        {
            FormSubmitted = true;
            FormSaved     = true;

            //if (!ModelState.IsValid)
            //{
            //    FormSaved = false;
            //    FormErrors = string.Join("; ", ModelState.Values
            //                            .SelectMany(x => x.Errors)
            //                            .Select(x => x.ErrorMessage));
            //}

            BarclaysPayment.UniquePaymentRef = Guid.NewGuid();
            BarclaysPayment.PSPID            = _configuration.GetSection("SystemSettings")["PSPID"];
            BarclaysPayment.CURRENCY         = _configuration.GetSection("SystemSettings")["Currency"];
            BarclaysPayment.LANGUAGE         = "en_GB";
            BarclaysPayment.TITLE            = _configuration.GetSection("SystemSettings")["BarclaysTitle"];
            BarclaysPayment.BGCOLOR          = "";
            BarclaysPayment.TXTCOLOR         = "";
            BarclaysPayment.TBLBGCOLOR       = "";
            BarclaysPayment.TBLTXTCOLOR      = "";
            BarclaysPayment.BUTTONBGCOLOR    = "";
            BarclaysPayment.BUTTONTXTCOLOR   = "";
            BarclaysPayment.LOGO             = "https://apps.wlc.ac.uk/BarclaysPayments/images/CollegeLogo.png";
            BarclaysPayment.FONTTYPE         = "";
            BarclaysPayment.ACCEPTURL        = "https://www.wlc.ac.uk";
            BarclaysPayment.DECLINEURL       = "https://www.wlc.ac.uk";
            BarclaysPayment.EXCEPTIONURL     = "https://www.wlc.ac.uk";
            BarclaysPayment.CANCELURL        = "https://www.wlc.ac.uk";
            BarclaysPayment.CreatedDate      = DateTime.Now;
            BarclaysPayment.CreatedBy        = User.Identity.Name.Split('\\').Last();

            _context.BarclaysPayment.Add(BarclaysPayment);
            await _context.SaveChangesAsync();

            UniquePaymentRef = BarclaysPayment.UniquePaymentRef;

            return(Page());
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> OnGetAsync()
        {
            FormSubmitted = false;

            PaymentReason = await _context.PaymentReason
                            .OrderBy(r => r.SortOrder)
                            .ThenBy(r => r.Description)
                            .Select(
                r => new SelectListItem
            {
                Value = r.PaymentReasonID,
                Text  = r.Description
            }
                )
                            .AsNoTracking()
                            .ToListAsync();

            SHAPassphrase = _configuration.GetSection("SystemSettings")["SHAPassphrase"];
            string paymentSystem = _configuration.GetSection("SystemSettings")["PaymentSystem"];

            string paymentURL = null;

            if (paymentSystem == "LIVE")
            {
                FormDestinationID = _configuration.GetSection("SystemSettings")["PaymentURLLive"];
            }
            else
            {
                FormDestinationID = _configuration.GetSection("SystemSettings")["PaymentURLTest"];
            }

            BarclaysPayment = new BarclaysPayment
            {
                UniquePaymentRef = Guid.NewGuid(),
                PaymentURL       = paymentURL,
                PSPID            = _configuration.GetSection("SystemSettings")["PSPID"],
                //ORDERID = "1234",
                //AMOUNT = 1500,
                CURRENCY = _configuration.GetSection("SystemSettings")["Currency"],
                LANGUAGE = "en_GB",
                //CN = "Robin Wilson",
                //EMAIL = "*****@*****.**",
                //OWNERZIP = "W14 9BL",
                //OWNERADDRESS = "West London College",
                //OWNERCTY = "Hammersmith",
                //OWNERTOWN = "London",
                //OWNERTELNO = "07712345678",
                SHASIGN        = "",
                TITLE          = _configuration.GetSection("SystemSettings")["BarclaysTitle"],
                BGCOLOR        = "",
                TXTCOLOR       = "",
                TBLBGCOLOR     = "",
                TBLTXTCOLOR    = "",
                BUTTONBGCOLOR  = "",
                BUTTONTXTCOLOR = "",
                LOGO           = "https://apps.wlc.ac.uk/BarclaysPayments/images/CollegeLogo.png",
                FONTTYPE       = "",
                ACCEPTURL      = "https://www.wlc.ac.uk",
                DECLINEURL     = "https://www.wlc.ac.uk",
                EXCEPTIONURL   = "https://www.wlc.ac.uk",
                CANCELURL      = "https://www.wlc.ac.uk",
                CreatedDate    = DateTime.Now,
                CreatedBy      = User.Identity.Name.Split('\\').Last()
            };

            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(
            string ielts,
            string TestType,
            string reffname,
            string refsname,
            string ref1,
            string ref2,
            string confirmref1,
            string confirmref2,
            string email,
            string email2,
            decimal tpymt,
            DateTime TestDate,
            string dep,
            bool mockexam1,
            bool refbooks,
            bool DuplicateCertificate,
            bool TransferFees,
            bool EnquiryOnResult,
            int formId,
            string oid
            )
        {
            FormSubmitted = false;

            SHAPassphrase = _configuration.GetSection("SystemSettings")["SHAPassphrase"];
            string paymentSystem = _configuration.GetSection("SystemSettings")["PaymentSystem"];

            string paymentURL = null;

            if (paymentSystem == "LIVE")
            {
                FormDestinationID = _configuration.GetSection("SystemSettings")["PaymentURLLive"];
            }
            else
            {
                FormDestinationID = _configuration.GetSection("SystemSettings")["PaymentURLTest"];
            }

            string userID = "IELTS";

            if (User.Identity.Name != null)
            {
                userID = User.Identity.Name.Split('\\').Last();
            }

            BarclaysPayment = new BarclaysPayment
            {
                UniquePaymentRef = Guid.NewGuid(),
                PaymentURL       = paymentURL,
                PSPID            = _configuration.GetSection("SystemSettings")["PSPID"],
                ORDERID          = oid,
                PaymentReasonID  = "IELTS",
                AMOUNT           = tpymt,
                CURRENCY         = _configuration.GetSection("SystemSettings")["Currency"],
                LANGUAGE         = "en_GB",
                CN    = reffname + " " + refsname,
                EMAIL = email,
                //OWNERZIP = "W14 9BL",
                //OWNERADDRESS = "West London College",
                //OWNERCTY = "Hammersmith",
                //OWNERTOWN = "London",
                //OWNERTELNO = "07712345678",
                SHASIGN        = "",
                TITLE          = _configuration.GetSection("SystemSettings")["BarclaysTitle"],
                BGCOLOR        = "",
                TXTCOLOR       = "",
                TBLBGCOLOR     = "",
                TBLTXTCOLOR    = "",
                BUTTONBGCOLOR  = "",
                BUTTONTXTCOLOR = "",
                LOGO           = "https://apps.wlc.ac.uk/BarclaysPayments/images/CollegeLogo.png",
                FONTTYPE       = "",
                ACCEPTURL      = "https://www.wlc.ac.uk",
                DECLINEURL     = "https://www.wlc.ac.uk",
                EXCEPTIONURL   = "https://www.wlc.ac.uk",
                CANCELURL      = "https://www.wlc.ac.uk",
                CreatedDate    = DateTime.Now,
                CreatedBy      = userID
            };

            _context.BarclaysPayment.Add(BarclaysPayment);
            await _context.SaveChangesAsync();

            IELTSOrder = new IELTSOrder
            {
                BarclaysPaymentID = BarclaysPayment.BarclaysPaymentID,
                IELTSTestDate     = TestDate,
                TestType          = TestType,
                OrderStatusID     = 1 //To-Do
            };

            if (ielts == "ieltsexam")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexam")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexam2")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexam2")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexam3")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexam3")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexamTFL")
            {
                IELTSTestAmount = await _context.IELTSPrice
                                  .Where(p => p.Code == "ieltsexamTFL")
                                  .FirstOrDefaultAsync();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }

            if (mockexam1 == true)
            {
                PracticeTestAmount = await _context.IELTSPrice
                                     .Where(p => p.Code == "mockexam1")
                                     .FirstOrDefaultAsync();

                IELTSOrder.PracticeTestAmount = PracticeTestAmount.Price;
                PracticeTestAmountValue       = PracticeTestAmount.Price;
            }

            if (mockexam1 == true)
            {
                PracticeMaterialsAmount = await _context.IELTSPrice
                                          .Where(p => p.Code == "refbooks")
                                          .FirstOrDefaultAsync();

                IELTSOrder.PracticeMaterialsAmount = PracticeMaterialsAmount.Price;
                PracticeMaterialsAmountValue       = PracticeMaterialsAmount.Price;
            }

            _context.IELTSOrder.Add(IELTSOrder);
            await _context.SaveChangesAsync();

            PracticeTestDate = TestDate;

            UniquePaymentRef = BarclaysPayment.UniquePaymentRef;

            //Update Payment Reference
            BarclaysPayment.ORDERID = IELTSOrder.IELTSOrderID + "-" + IELTSOrder.TestType + "-" + BarclaysPayment.ORDERID;
            await _context.SaveChangesAsync();

            return(Page());
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync(
            BarclaysPayment model,
            string ielts,
            DateTime TestDate,
            string TestType,
            bool mockexam1,
            bool ieltsexam,
            bool ieltsexam2
            )
        {
            FormSubmitted = true;
            FormSaved     = true;

            //if (!ModelState.IsValid)
            //{
            //    FormSaved = false;
            //    FormErrors = string.Join("; ", ModelState.Values
            //                            .SelectMany(x => x.Errors)
            //                            .Select(x => x.ErrorMessage));
            //}

            string userID = "IELTS";

            if (User.Identity.Name != null)
            {
                userID = User.Identity.Name.Split('\\').Last();
            }

            BarclaysPayment.UniquePaymentRef = Guid.NewGuid();
            BarclaysPayment.PSPID            = _configuration.GetSection("SystemSettings")["PSPID"];
            BarclaysPayment.CURRENCY         = _configuration.GetSection("SystemSettings")["Currency"];
            BarclaysPayment.LANGUAGE         = "en_GB";
            BarclaysPayment.TITLE            = _configuration.GetSection("SystemSettings")["BarclaysTitle"];
            BarclaysPayment.BGCOLOR          = "";
            BarclaysPayment.TXTCOLOR         = "";
            BarclaysPayment.TBLBGCOLOR       = "";
            BarclaysPayment.TBLTXTCOLOR      = "";
            BarclaysPayment.BUTTONBGCOLOR    = "";
            BarclaysPayment.BUTTONTXTCOLOR   = "";
            BarclaysPayment.LOGO             = "https://apps.wlc.ac.uk/BarclaysPayments/images/CollegeLogo.png";
            BarclaysPayment.FONTTYPE         = "";
            BarclaysPayment.ACCEPTURL        = "https://www.wlc.ac.uk";
            BarclaysPayment.DECLINEURL       = "https://www.wlc.ac.uk";
            BarclaysPayment.EXCEPTIONURL     = "https://www.wlc.ac.uk";
            BarclaysPayment.CANCELURL        = "https://www.wlc.ac.uk";
            BarclaysPayment.CreatedDate      = DateTime.Now;
            //BarclaysPayment.CreatedBy = User.Identity.Name.Split('\\').Last();
            BarclaysPayment.CreatedBy = userID;

            _context.BarclaysPayment.Add(BarclaysPayment);
            await _context.SaveChangesAsync();



            IELTSOrder = new IELTSOrder
            {
                BarclaysPaymentID = BarclaysPayment.BarclaysPaymentID,
                IELTSTestDate     = TestDate,
                TestType          = TestType
            };

            if (ielts == "ieltsexam" || ieltsexam == true)
            {
                IELTSTestAmount = IELTSPrice
                                  .Where(p => p.Code == "ieltsexam")
                                  .FirstOrDefault();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexam2" || ieltsexam2 == true)
            {
                IELTSTestAmount = IELTSPrice
                                  .Where(p => p.Code == "ieltsexam2")
                                  .FirstOrDefault();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }
            else if (ielts == "ieltsexamTFL")
            {
                IELTSTestAmount = IELTSPrice
                                  .Where(p => p.Code == "ieltsexamTFL")
                                  .FirstOrDefault();

                IELTSOrder.IELTSTestAmount = IELTSTestAmount.Price;
                IELTSTestAmountValue       = IELTSTestAmount.Price;
            }

            if (mockexam1 == true)
            {
                PracticeTestAmount = IELTSPrice
                                     .Where(p => p.Code == "mockexam1")
                                     .FirstOrDefault();

                IELTSOrder.PracticeTestAmount = PracticeTestAmount.Price;
                PracticeTestAmountValue       = PracticeTestAmount.Price;
            }

            if (mockexam1 == true)
            {
                PracticeMaterialsAmount = IELTSPrice
                                          .Where(p => p.Code == "refbooks")
                                          .FirstOrDefault();

                IELTSOrder.PracticeMaterialsAmount = PracticeMaterialsAmount.Price;
                PracticeMaterialsAmountValue       = PracticeMaterialsAmount.Price;
            }

            _context.IELTSOrder.Add(IELTSOrder);
            await _context.SaveChangesAsync();

            PracticeTestDate = TestDate;

            UniquePaymentRef = BarclaysPayment.UniquePaymentRef;

            //Update Payment Reference
            BarclaysPayment.ORDERID = IELTSOrder.IELTSOrderID + "-" + IELTSOrder.TestType + "-" + BarclaysPayment.ORDERID;

            return(Page());
        }