sdk/src/main/java/com/worldpay/cse/WorldpayCSE.java
public String encrypt(WPCardData cardData) throws WPCSEException {

        Set<Integer> errors = new WPCardValidator().validateCardData(cardData);
        if (errors.isEmpty()) {
            if (publicKey != null) {
                return performEncryption(cardData.toString());
            } else {
                throw new WPCSEException("Public key not set");
            }
        } else {
            throw new WPCSEInvalidCardData(errors);
        }
    }
/**
     * Validates and encrypts the supplied card data. If any validation error occurs, it will throw a
     * {@link WPCSEInvalidCardData} exception that contains all error codes.
     *
     * @param cardData An object containing information about the card details to encrypt.
     * @return The encrypted data to be submitted for processing, or null if a validation error occurs.
     *
     * @throws WPCSEException could be an instance of {@link WPCSEInvalidCardData} or other generic instance.
     */
Validates and encrypts the supplied card data. If any validation error occurs, it will throw a
WPCSEInvalidCardData exception that contains all error codes.

@param cardData An object containing information about the card details to encrypt.
@return The encrypted data to be submitted for processing, or null if a validation error occurs.

@throws WPCSEException could be an instance of  WPCSEInvalidCardData or other generic instance.
Validates and encrypts the supplied card data . If any validation error occurs it will throw a WPCSEInvalidCardData exception that contains all error codes . @param cardData An object containing information about the card details to encrypt . @return The encrypted data to be submitted for processing or null if a validation error occurs . @throws WPCSEException could be an instance of WPCSEInvalidCardData or other generic instance .
public String encrypt(WPCardData cardData) throws WPCSEException {
        Set<Integer> errors = new WPCardValidator().validateCardData(cardData);
        if (errors.isEmpty()) {
            if (publicKey != null) {
                return performEncryption(cardData.toString());
            } else {
                throw new WPCSEException("Public key not set");
            }
        } else {
            throw new WPCSEInvalidCardData(errors);
        }
    }
public String encrypt ( WPCardData cardData ) throws WPCSEException { Set < Integer > errors = new WPCardValidator ( ) . validateCardData ( cardData ) ; if ( errors . isEmpty ( ) ) { if ( publicKey != null ) { return performEncryption ( cardData . toString ( ) ) ; } else { throw new WPCSEException ( "Public key not set" ) ; } } else { throw new WPCSEInvalidCardData ( errors ) ; } }
Validates and encrypts the supplied card data.
Validates and encrypts the supplied card data .