Class CheckCCNumberCmdImpl

  • All Implemented Interfaces:, ECCommand, ECTargetableCommand, TaskCommand, CheckCCNumberCmd,,,,,,

    public class CheckCCNumberCmdImpl
    extends TaskCommandImpl
    implements CheckCCNumberCmd
    This CheckCCNumberCmd Task Command Implementation performs various checks on the supplied credit card number. The checks to be performed include length and prefix check using the information in the CCCHECK Table (CreditCardCheckAccessBean). And the industry standard Mod-10 check if specified by the entries in the CCHECK Table.

    If the credit card number is found to be invalid. The command throws the ECApplicationException specifying the error view Command named by the errorTaskName command property. And the errorCode specified by

    The Mod-10 Check Algorithm is also known as the LUHN Algorithm.

    This command uses the following AccessBeans:

    This command calls the following TaskCommands:

    • DoLuhnCheckCmd or the Task Command specified by the CreditCardCheckAccessBean.getCheckTaskName(). (This Task Command must be a subclass of DoLuhnCheckCmd.)
    See Also:
    Serialized Form
    • Constructor Detail

      • CheckCCNumberCmdImpl

        public CheckCCNumberCmdImpl()
        CheckCCNumberCmdImpl default constructor.
    • Method Detail

      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command. This is done before the Framework calls the performExecute method of the command.
        Specified by:
        isReadyToCallExecute in interface
        isReadyToCallExecute in class AbstractECTargetableCommand
        true if we can execute the command; false otherwise.
      • reset

        public void reset()
        Resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters. Then make sure those values are no longer needed before calling this method to reset the instance variables of the command.

        This is useful if the command instance is to be called multiple times with different command parameters.

        Specified by:
        reset in interface
        reset in class AbstractECTargetableCommand
      • setCardBrand

        public void setCardBrand(java.lang.String astrCardBrand)
        Sets the cardBrand property of the command.
        Specified by:
        setCardBrand in interface CheckCCNumberCmd
        astrCardBrand - the card brand to be used for setting the command property. (This value is used to compare against the values specified in credit card type column in the CCCHECK Table.)
      • setCardNumber

        public void setCardNumber(java.lang.String astrCardNumber)
        Sets the cardNumber property of the command.
        Specified by:
        setCardNumber in interface CheckCCNumberCmd
        astrCardNumber - the card number to be used for setting the command property.
      • setErrorTaskName

        public void setErrorTaskName(java.lang.String astrErrorTaskName)
        Sets the errorTaskName property of the command. The ErrorTask is an older term for ErrorView.
        Specified by:
        setErrorTaskName in interface CheckCCNumberCmd
        astrErrorTaskName - the name of the Error View to be used for displaying error information to the Shopper.