Package net.octal.banking

Examples of net.octal.banking.BasicBankAccountNumber


            final Account accountFrom = accountService.findAccountById(accountFromId);
            final String bbanEstablishmentCode = request.getParameter("bbanEstablishmentCode");
            final String bbanBranchCode = request.getParameter("bbanBranchCode");
            final String bbanAccountNumber = request.getParameter("bbanAccountNumber");
            final String bbanKey = request.getParameter("bbanKey");
            final BasicBankAccountNumber bban = new BasicBankAccountNumber(bbanEstablishmentCode,
                        bbanBranchCode, bbanAccountNumber, bbanKey);
           
            if (amount > accountFrom.getTotalAmount()) {
                request.setAttribute("error", true);
                request.setAttribute("errorString", "You can't perform this transfert with your account amount");
            }
           
            /*
            if (!bban.isKeyValid()) {
                request.setAttribute("error", true);
                request.setAttribute("errorString", "The BBAN Key is invalid");
                doGet(request, response);
            }
            */

           
            else if (bbanEstablishmentCode.equals(ESTABLISHMENT_CODE)) {
               
                final Long accountToId = Long.parseLong(
                        BasicBankAccountNumber.normalizedAccountNumber(bbanAccountNumber));
                final Account accountTo = accountService.findAccountById(accountToId);
                if (accountTo != null) {
                    transfertService.performAnotherCustomerTransfert(accountFrom, accountTo, bban.toString(),
                                                                     amount, description);

                    request.setAttribute("informationString", "Your transfert has succeeded");
                }
                else
View Full Code Here

TOP

Related Classes of net.octal.banking.BasicBankAccountNumber

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.