public async Task <IActionResult> OnPostCheckOutAsync() { Cart = await _basketApi.GetCart("test"); if (!ModelState.IsValid) { return(Page()); } Order.UserName = "******"; Order.TotalPrice = Cart.TotalPrice; await _orderApi.Checkout(Order); await _basketApi.DeleteCart(Cart.Username); return(RedirectToPage("Confirmation", "OrderSubmitted")); }
public async Task <IActionResult> OnPostCheckOutAsync() { username = HttpContext.Session.GetString("username"); Cart = await _basketApi.GetCart(username); if (!ModelState.IsValid) { return(Page()); } Order.UserName = username; Order.TotalPrice = Cart.TotalPrice; await _orderApi.Checkout(Order); await _basketApi.DeleteCart(Order.UserName); return(RedirectToPage("Confirmation", "OrderSubmitted")); }