com.ibm.commerce.payment.commands

Class CheckCCNumberCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CheckCCNumberCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    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 com.ibm.commerce.DoPaymentCmd.ERR_CODE_BAD_CCNUM.

    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 com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        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 com.ibm.websphere.command.Command
        Overrides:
        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
        Parameters:
        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
        Parameters:
        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
        Parameters:
        astrErrorTaskName - the name of the Error View to be used for displaying error information to the Shopper.