Examples of WalletIsBlockedException


Examples of com.luxoft.dnepr.courses.regular.unit3.exceptions.WalletIsBlockedException

    }

    @Override
    public void checkWithdrawal(BigDecimal amountToWithdraw) throws WalletIsBlockedException, InsufficientWalletAmountException {
        if (status == WalletStatus.BLOCKED) {
            throw new WalletIsBlockedException(id, WALLET_IS_BLOCKED_MESSAGE);
        }
        if (amountToWithdraw.compareTo(amount) > 0) {
            throw new InsufficientWalletAmountException(id, amountToWithdraw, amount,
                    INSUFFICIENT_WALLET_AMOUNT_MESSAGE
            );
View Full Code Here

Examples of com.luxoft.dnepr.courses.regular.unit3.exceptions.WalletIsBlockedException

    }

    @Override
    public void checkTransfer(BigDecimal amountToTransfer) throws WalletIsBlockedException, LimitExceededException {
        if (status == WalletStatus.BLOCKED) {
            throw new WalletIsBlockedException(id, WALLET_IS_BLOCKED_MESSAGE);
        }
        if (amount.add(amountToTransfer).compareTo(maxAmount) > 1) {
            throw new LimitExceededException(id, amountToTransfer, amount, LIMIT_EXCEEDED_MESSAGE);
        }
    }
View Full Code Here

Examples of com.luxoft.dnepr.courses.regular.unit3.exceptions.WalletIsBlockedException

    }

    @Override
    public void checkWithdrawal(BigDecimal amountToWithdraw) throws WalletIsBlockedException, InsufficientWalletAmountException {
        if (status == WalletStatus.BLOCKED) {
            throw new WalletIsBlockedException(id, "Wallet " + id + " is blocked.");
        }
        if (amount.compareTo(amountToWithdraw) < 0) {
            throw new InsufficientWalletAmountException(id, amountToWithdraw, amount, "Insufficient funds (" +
                    MoneyFormatter.format(amount) + " < " + MoneyFormatter.format(amountToWithdraw) + ")");
        }
View Full Code Here

Examples of com.luxoft.dnepr.courses.regular.unit3.exceptions.WalletIsBlockedException

    }

    @Override
    public void checkTransfer(BigDecimal amountToTransfer) throws WalletIsBlockedException, LimitExceededException {
        if (status == WalletStatus.BLOCKED) {
            throw new WalletIsBlockedException(id, "Wallet " + id + " is blocked.");
        }
        if (maxAmount.compareTo(amount.add(amountToTransfer)) < 0) {
            throw new LimitExceededException(id, amountToTransfer, amount, "Limit exceeded (" +
                    MoneyFormatter.format(amount) + " + " + MoneyFormatter.format(amountToTransfer) +
                    " > " + MoneyFormatter.format(maxAmount) + ")");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.