Exemple #1
0
 public IActionResult TransferMoney(string accountNumber, string toAccountNumber, decimal amount)
 {
     try
     {
         return(Ok(transactionbussinessLayer.TransferMoney(accountNumber, toAccountNumber, amount)));
     }
     catch (InsufficientBalanceException e)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, new Response {
             Message = e.Message
         }));
     }
     catch (AccountDoesNotExistException e)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, new Response {
             Message = e.Message
         }));
     }
     catch (Exception e)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, new Response {
             Message = e.Message
         }));
     }
 }