public IActionResult OnPostEjectMoneyInserted() { UserId = User.FindFirstValue(ClaimTypes.NameIdentifier); ChangeReturned = _sodaMachineLogic.IssueFullRefund(UserId); return(OnGet()); }
private static void CancelTransaction() { var moneyInserted = _sodaMachine.GetMoneyInsertedTotal(userId); _sodaMachine.IssueFullRefund(userId); Console.Clear(); Console.WriteLine($"You have been refunded {string.Format("{0:$ #.00}", moneyInserted)}"); Message(); }
// Used for canceling our deposit public IActionResult OnPostCancel() { UserId = User.FindFirstValue(ClaimTypes.NameIdentifier); DepositedAmount = _sodaMachine.GetMoneyInsertedTotal(UserId); _sodaMachine.IssueFullRefund(UserId); OutputText = $"You have been refunded { string.Format("{0:C}", DepositedAmount) }"; return(RedirectToPage(new { OutputText })); }
private static void CancelTransaction() { var amountDposited = _sodaMachine.GetMoneyInsertedTotal(userId); _sodaMachine.IssueFullRefund(userId); Console.Clear(); Console.WriteLine($"Transaction Canceled. Refunded { String.Format("{0:C}", amountDposited) }."); Console.WriteLine("Press enter to continue..."); Console.ReadLine(); }