Package edu.asu.securebanking.model

Examples of edu.asu.securebanking.model.ExternalAccount


    
     double currentBalance = 0.0;
    
   int userId = externalUserTransaction.getUserId();
    
     ExternalAccount externalAccount = externalAccountBO.findUserByid(userId);
      
     if(externalAccount != null)
     {
         currentBalance = externalAccount.getCurrentBalance();
        
         currentBalance += amount;
        
     }

       externalAccount.setCurrentBalance(currentBalance);
      
       externalAccountBO.update(externalAccount);
      
       // Create New Transaction
       externalUserTransaction.setAmountInvolved(amount);
View Full Code Here


   
    public synchronized ModelAndView MerchantCreditSuccess(Principal principal) {
     
      ModelAndView modelAndView = new ModelAndView("MerchantCreditSuccess");
     
      ExternalAccount externalAccount =  externalAccountBO.findAccountByName(principal.getName());

      modelAndView.addObject("message", externalAccount.getCurrentBalance());

      return modelAndView;
    }
View Full Code Here

   @RequestMapping(value="/merchantTransfer")
  
    public synchronized ModelAndView transferMoney(Principal principal) {
    
     String name = principal.getName();
      ExternalAccount currentuser = externalAccountBO.findAccountByName(name);
    
     ExternalUserTransaction transfer = new ExternalUserTransaction();
    
     transfer.setUserId(currentuser.getUserid());
    
     transfer.setAccessGranted(1);
    
     transfer.setStatus("Pending");
    
View Full Code Here

        double currentSourceBalance = 0.0;

        int userId = externalUserTransaction.getUserId();

        ExternalAccount sourceExternalAccount = externalAccountBO.findUserByid(userId);

        if(sourceExternalAccount != null)
        {
          currentSourceBalance = sourceExternalAccount.getCurrentBalance();
        }
        // Check the current Balance  if not return error

        if(currentSourceBalance<amountToTransfer)
        {
          return "redirect:/Merchant/MerchantLessFunds";


        }

        //else process the transaction.
        else
        {

          // Find the account from database where money needs to be transfered.

          String accountNumber = externalUserTransaction.getTransDetail();

          ExternalAccount destinationExternalAccount = merchantsBO.getAccountByAccountNumber(accountNumber);

          if(destinationExternalAccount == null || (sourceExternalAccount.getAccountNo().equals(destinationExternalAccount.getAccountNo())))
          {
            errors = errors + "Please enter valid Account Number;";
            model.addAttribute("transfer", externalUserTransaction);

            model.addAttribute("errors", errors);

            return "MerchantTransfer";


          }

          // Update Source Account Balance
          sourceExternalAccount.setCurrentBalance(currentSourceBalance-amountToTransfer);

          externalAccountBO.update(sourceExternalAccount);

          // Create Transaction For Source Account

          externalUserTransaction.setTransDetail("Transfer To A/C" + accountNumber);

          externalUserTransaction.setAmountInvolved(amountToTransfer*-1);

          externalTransactionBO.save(externalUserTransaction);

          //   Update Destination Account Balance

          double destinationBalance = destinationExternalAccount.getCurrentBalance();

          destinationBalance+=amountToTransfer;

          destinationExternalAccount.setCurrentBalance(destinationBalance);

          externalAccountBO.update(destinationExternalAccount);

          //Create Transaction for Destination Balance    

          externalUserTransaction.setUserId(destinationExternalAccount.getUserid());

          externalUserTransaction.setTransDetail("Transfer From A/C" + sourceExternalAccount.getAccountNo());

          externalUserTransaction.setAmountInvolved(amountToTransfer);

View Full Code Here

  public synchronized ModelAndView MerchantTransferSuccess(Principal principal) {
   
    ModelAndView modelAndView = new ModelAndView("MerchantTransferSuccess");
   
    ExternalAccount externalAccount =  externalAccountBO.findAccountByName(principal.getName());

    modelAndView.addObject("message", externalAccount.getCurrentBalance());

    return modelAndView;
  }
View Full Code Here

   @RequestMapping(value="/merchantCreditCardRequest")
  
    public synchronized ModelAndView creditCardRequest(Principal principal) {
    
     String name = principal.getName();
      ExternalAccount currentuser = externalAccountBO.findAccountByName(name);
    
     
      // Query the credit card request stable to find the request for the account number
      CreditcardRequests creditCardCheck = ccreqsBo.checkForCreditCardNumber(currentuser.getAccountNo());
     
     //if user populate with row
      if(creditCardCheck != null)
      {
        ModelAndView modelAndView = new ModelAndView("MerchantCreditCardRequest");
       
        modelAndView.addObject("creditCard", creditCardCheck);
    
           return modelAndView;
      }
      //If no credit new request and add to credit card request
      else{
       
       
          CreditcardRequests creditCardNewRequest = new CreditcardRequests();
     
          creditCardNewRequest.setApproved("no");
       
          creditCardNewRequest.setAccountNo(currentuser.getAccountNo());
       
        ccreqsBo.save(creditCardNewRequest);
       
        ModelAndView modelAndView = new ModelAndView("MerchantCreditCardRequest");
       
View Full Code Here

                        
                         if(!merchantName.isEmpty())
                         {
                        // query the database get merchant record
                          
                          ExternalAccount merchant =  externalAccountBO.findAccountByName(merchantName);
                          
                           double currentBalance = merchant.getCurrentBalance();
                          
                           currentBalance = currentBalance + publicKey.getAmountInvolved();
                          
                           merchant.setCurrentBalance(currentBalance);
                              
                           externalAccountBO.update(merchant);
                          
                            modelAndView = new ModelAndView("MerchantFileUploadSuccess");
                          
                           modelAndView.addObject("message",currentBalance);
                          
                           pkiBO.delete(publicKey);
                          
                      
                          // Create an External Transaction
                             
                              ExternalUserTransaction external = new ExternalUserTransaction();
                             
                              external.setAccessGranted(1);
                              external.setAmountInvolved(publicKey.getAmountInvolved());
                              external.setStatus("Approved");
                              external.setTransDetail(publicKey.getTransDetail());
                              external.setTransType("Debit");
                              external.setUserId(merchant.getUserid());
                             externalTransactionBO.save(external);

                         }
                       }
                     
View Full Code Here

    if(currentuser.getDeptid() == 1){
      ModelAndView modelAndView = new ModelAndView("salestransactionManagement");
      modelAndView.addObject("currentuser", currentuser);

      ExternalAccount extuser = new ExternalAccount();
      modelAndView.addObject("extuser", extuser);

      System.out.println("enteringcc");
      List<ExternalAccount> ccreqs = extBo.getccreq();
      if(ccreqs != null){
View Full Code Here

 
  @RequestMapping(method = RequestMethod.GET)
  public String initForm(ModelMap model, HttpSession session) {
   
    if(session.getAttribute("passkeycheck") == "true"){
      ExternalAccount user = new ExternalAccount();
     
      //command object
      model.addAttribute("user", user);
  
      //return form view
View Full Code Here

    int empid = 0;
    String email = null;
    String username = name;
    boolean ftl = false;
    InternalAccount ia=null;
    ExternalAccount ea = loginAttemptBO.findAccountByNameExternal(name);
    if(ea == null){
      ia = loginAttemptBO.findAccountByNameInternal(name);
      if(ia != null){
        userid = 0;
        empid = ia.getEmployeeId();
        email = ia.getEmail();
        ftl = ia.getFirstTimeLogin();
      }
    }else{
      //external use case
      userid = ea.getUserid();
      empid = 0;
      email = ea.getEmail();
      ftl = ea.isFirstTimeLogin();
    }
    if(ftl == true){
      // First Time Login
      //store OTP data to otp DB
      OTP instance = new OTP();
View Full Code Here

TOP

Related Classes of edu.asu.securebanking.model.ExternalAccount

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.