Package com.balancedpayments.errors

Examples of com.balancedpayments.errors.APIError


            HttpResponse response,
            String body,
            Map<String, Object> payload) throws APIError {

        if (!payload.containsKey("errors")) {
            throw new APIError(response, body, payload);
        }
        else {
            Map<String, Object> entity = (Map<String, Object>) ((ArrayList) payload.get("errors")).get(0);
            String category_code = (String) entity.get("category_code");

            // http://stackoverflow.com/questions/3434466/creating-a-factory-method-in-java-that-doesnt-rely-on-if-else
            if (InsufficientFunds.CODES.contains(category_code))
                throw new InsufficientFunds(response, body, entity);
            else if (Declined.CODES.contains(category_code))
                throw new Declined(response, body, entity);
            else if (DuplicateAccountEmailAddress.CODES.contains(category_code))
                throw new DuplicateAccountEmailAddress(response, body, entity);
            else if (BankAccountVerificationFailure.CODES.contains(category_code))
                throw new BankAccountVerificationFailure(response, body, entity);

            throw new APIError(response, body, entity);
        }
    }
View Full Code Here


        else if (DuplicateAccountEmailAddress.CODES.contains(category_code))
            throw new DuplicateAccountEmailAddress(response, body, entity);
        else if (BankAccountVerificationFailure.CODES.contains(category_code))
            throw new BankAccountVerificationFailure(response, body, entity);

        throw new APIError(response, body, entity);
    }
View Full Code Here

        else if (DuplicateAccountEmailAddress.CODES.contains(category_code))
            throw new DuplicateAccountEmailAddress(response, body, payload);
        else if (BankAccountVerificationFailure.CODES.contains(category_code))
            throw new BankAccountVerificationFailure(response, body, payload);

        throw new APIError(response, body, payload);
    }
View Full Code Here

        else if (DuplicateAccountEmailAddress.CODES.contains(category_code))
            throw new DuplicateAccountEmailAddress(response, body, payload);
        else if (BankAccountVerificationFailure.CODES.contains(category_code))
            throw new BankAccountVerificationFailure(response, body, payload);
       
        throw new APIError(response, body, payload);
    }
View Full Code Here

        else if (Declined.CODES.contains(category_code))
            throw new Declined(response, body, payload);
        else if (DuplicateAccountEmailAddress.CODES.contains(category_code))
            throw new DuplicateAccountEmailAddress(response, body, payload);
       
        throw new APIError(response, body, payload);
    }
View Full Code Here

        else if (DuplicateAccountEmailAddress.CODES.contains(category_code))
            throw new DuplicateAccountEmailAddress(response, body, payload);
        else if (BankAccountVerificationFailure.CODES.contains(category_code))
            throw new BankAccountVerificationFailure(response, body, payload);

        throw new APIError(response, body, payload);
    }
View Full Code Here

TOP

Related Classes of com.balancedpayments.errors.APIError

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.