public async Task<IActionResult> OnPostCheckOutAsync() { Cart = await _basketApi.GetBasket("test"); if (!ModelState.IsValid) { return Page(); } Order.Username = "******"; Order.TotalPrice = Cart.TotalPrice; await _basketApi.CheckoutBasket(Order); return RedirectToPage("Confirmation", "OrderSubmitted"); }
public async Task <IActionResult> OnPostCheckOutAsync() { Cart = await basketApi.GetBasket("swn").ConfigureAwait(false); if (!ModelState.IsValid) { return(Page()); } Order.UserName = "******"; Order.TotalPrice = Cart.TotalPrice; await basketApi.CheckoutBasket(Order).ConfigureAwait(false); return(RedirectToPage("Confirmation", "OrderSubmitted")); }
public async Task <IActionResult> OnPostCheckOutAsync() { var username = "******"; Cart = await basketApi.GetBasket(username); if (!ModelState.IsValid) { return(Page()); } Order.Username = username; Order.TotalPrice = Cart.TotalPrice; await basketApi.CheckoutBasket(Order); return(RedirectToPage("Confirmation", "OrderSubmitted")); }