All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.worldpay.cse.exception.WPCSEInvalidCardData Maven / Gradle / Ivy

Go to download

Android SDK is a library created to help you integrate Worldpay client side encryption into your mobile applications.

There is a newer version: 1.0.4
Show newest version
package com.worldpay.cse.exception;

import java.util.Set;

/**
 * The exception that contains the error codes for the invalid values of the card fields.
 * The list of error codes can be retrieved via {@link WPCSEInvalidCardData#getErrorCodes()}
 */
public class WPCSEInvalidCardData extends WPCSEException {

    public static final String INVALID_CARD_DATA = "Invalid card data";
    private final Set errorCodes;

    /**
     * Creates an exception for Invalid card data with the list of error codes. Each code represent a kind of error for a particular card field
     *
     * @param errorCodes the list of error codes.
     *
     * @see com.worldpay.cse.WPCardValidator
     */
    public WPCSEInvalidCardData(Set errorCodes) {
        super(INVALID_CARD_DATA);
        this.errorCodes = errorCodes;
    }

    /**
     * Returns the list of error codes. The following is the list of error codes mapped to their meanings which
     * would be provided back to the caller app. All these codes are mapped to {@link com.worldpay.cse.WPValidationErrorCodes}
     
    • 101 - Credit card number is empty.
    • 102 - Invalid credit card number, numbers only and should be between 12 and 20 digits.
    • 103 - Invalid credit card number, input doesn't verify Luhn check.
    • 201 - Invalid security code, numbers only and should be between 3 and 4 digits.
    • 301 - Expiry month is empty.
    • 302 - Invalid expiry month; only numbers expected and in XX form (e.g. 09).
    • 303 - Invalid expiry month, should range from 01 to 12.
    • 304 - Expiry year is mandatory.
    • 305 - Invalid expiry year, only numbers expected.
    • 306 - Expiry date is not in the future.
    • 401 - Card holder's name is empty.
    • 402 - Card holder's name exceeds thirty characters.
* @see com.worldpay.cse.WPValidationErrorCodes * * @return a set of integers, which are the error codes */ public Set getErrorCodes() { return errorCodes; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy