public async Task <IActionResult> MakeWithdrawal(MakeWithdrawalPaymentTransactionVM withdrawalPaymentTransaction) { try { await _paymentTransactionService.MakeWithdrawalPaymentTransaction(withdrawalPaymentTransaction.UniqueMasterCitizenNumber, withdrawalPaymentTransaction.Password, withdrawalPaymentTransaction.Amount); return(RedirectToAction(nameof(MyPaymentTransactions), new { password = withdrawalPaymentTransaction.Password, uniqueMasterCitizenNumber = withdrawalPaymentTransaction.UniqueMasterCitizenNumber })); } catch (Exception e) { ViewData["Error"] = e.Message; return(View(withdrawalPaymentTransaction)); } }
public async Task <IActionResult> MakeWithdrawal(string password, string uniqueMasterCitizenNumber) { MakeWithdrawalPaymentTransactionVM makeWithdrawalPaymentTransactionVM; try { WalletDTO wallet = await _walletService.GetWalletByUniqueMasterCitizenNumberAndPassword(uniqueMasterCitizenNumber, password); makeWithdrawalPaymentTransactionVM = new MakeWithdrawalPaymentTransactionVM(wallet.CurrentAmount, uniqueMasterCitizenNumber, password, "", true); return(View(makeWithdrawalPaymentTransactionVM)); } catch (Exception) { makeWithdrawalPaymentTransactionVM = new MakeWithdrawalPaymentTransactionVM(0, uniqueMasterCitizenNumber, password, "Enter valid unique master citizen number and password", false); return(View(makeWithdrawalPaymentTransactionVM)); } }