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");