Examples of subtractBalance()


Examples of is.currency.syst.AccountContext.subtractBalance()

        if (account == null) {
            return new EconomyResponse(0.0, 0.0, ResponseType.FAILURE, "That account does not exist");
        } else if (!account.hasBalance(amount)) {
            return new EconomyResponse(0.0, account.getBalance(), ResponseType.FAILURE, "Insufficient funds")
        } else {
            account.subtractBalance(amount);
            return new EconomyResponse(amount, account.getBalance(), ResponseType.SUCCESS, "");
        }
    }

    @Override
View Full Code Here

Examples of is.currency.syst.AccountContext.subtractBalance()

        if (account == null) {
            return new EconomyResponse(0, 0, ResponseType.FAILURE, "That account does not exist!");
        } else if (!account.hasBalance(amount)) {
            return new EconomyResponse(0, account.getBalance(), ResponseType.FAILURE, "That account does not have enough!");
        } else {
            account.subtractBalance(amount);
            return new EconomyResponse(amount, account.getBalance(), ResponseType.SUCCESS, "");
        }
    }

    @Override
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.