@RequestMapping(value = "/authorizeViewTransaction", method = RequestMethod.POST)
 public String authorizeViewTransactions(Model model, HttpSession session) throws IOException {
   String uniqId = session.getAttribute("uniqueid").toString();
   ExternalUser externalUser = databaseConnector.getExternalUserByUniqId(uniqId);
   externalUser.setAuthtrans("y");
   databaseConnector.updateExternalUser(externalUser);
   return "redirect:";
 }
  @RequestMapping(value = "/credit_money", method = RequestMethod.POST)
  public String creditmoneyPageAction(
      @ModelAttribute("creditOp") Transactions transactionObj, Model model, HttpSession session) {
    logger.info("Inside credit money op POST");
    logger.info("Current Balance" + transactionObj.getBalance());
    /** To display user profile */
    UserInfo UI = new UserInfo();
    DatabaseConnectors dbcon = new DatabaseConnectors();
    UI = dbcon.getUserInfoByUniqId((String) session.getAttribute("uniqueid"));

    String utype = null;
    String str1 = (String) session.getAttribute("uniqueid");

    System.out.println(str1);
    String str2 = str1.substring(0, 2);

    if (str2.equals("ei")) {
      utype = "Single User";
    } else if (str2.equals("em")) {
      utype = "Merchant";
    } else if (str2.equals("ir")) {
      utype = "Internal User";
    } else if (str2.equals("im")) {
      utype = "Manager";
    } else if (str2.equals("admin")) {
      utype = "Administrator";
    }

    model.addAttribute("firstName", UI.getFirstName());
    model.addAttribute("lastName", UI.getLastName());
    model.addAttribute("Username", UI.getUsername());
    model.addAttribute("email", UI.getEmailId());

    model.addAttribute("streetAddress", UI.getAddress());
    model.addAttribute("city", UI.getCity());
    model.addAttribute("state", UI.getState());
    model.addAttribute("country", UI.getCountry());
    model.addAttribute("zip", UI.getZipcode());
    model.addAttribute("contactNo", UI.getContactNo());
    model.addAttribute("userType", utype);

    String uniqueID = (String) session.getAttribute("uniqueid");
    // String uniqueID ="EM123";
    ExternalUser extUser = databaseConnector.getExternalUserByUniqId(uniqueID);

    model.addAttribute("accountno", extUser.getAccountno());

    transactionObj.setBalance(extUser.getBalance());
    float amount = transactionObj.getTransactionAmount();
    float currentBalance = transactionObj.getBalance();
    logger.info("balance :", currentBalance);
    // credit amount from current account balance
    transactionObj.setUniqId(uniqueID);
    transactionObj.setDescription("credited amount: " + amount);
    transactionObj.setTransactionType("credit");
    transactionObj.setBalance(currentBalance + amount);
    transactionObj.setStatus("Pending");
    extUser.setBalance(currentBalance + amount);
    databaseConnector.updateExternalUser(extUser);
    databaseConnector.saveTransaction(transactionObj);

    TempTransactions temp = new TempTransactions();
    temp.setBalance(transactionObj.getBalance());

    model.addAttribute("debitOp", transactionObj);
    model.addAttribute("creditOp", transactionObj);
    model.addAttribute("checkAccBal", transactionObj.getBalance());
    model.addAttribute("transferOp", temp);
    model.addAttribute("paymerchantOp", temp);
    model.addAttribute("UpdateProfile", new UserInfo());
    List<Transactions> obj = displaytransaction(session);
    if (obj == null) {
      model.addAttribute("transactionOp", null);
    } else {
      model.addAttribute("transactionOp", obj);
    }

    logger.info("Leaving credit money POST");
    return "extUserHomePage";
  }