Ejemplo n.º 1
0
        public async Task <IActionResult> CheckOutCallback(int amount, string Authority, string Status)
        {
            if (Status == "NOK")
            {
                cartServices.AddOrderDetailsToCart(UserName);
                return(View("Error", new ErrorViewModel()
                {
                    RequestId = "khkhkhkhkh"
                }));
            }
            var verification = await new Payment(amount)
                               .Verification(Authority);

            ViewResult response;

            if (verification.Status != 100 || !orderServices.PayForOrder(amount, UserName))
            {
                response = View("Error");
                orderServices.CancelingOpenOrder(UserName);
            }
            else
            {
                response = View("Success");
            }
            return(response);
        }