com.ibm.commerce.payment.commands

Class DoPaymentTestCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, DoPaymentPolicyCmd, 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

    Deprecated. 

    public class DoPaymentTestCmdImpl
    extends BusinessPolicyCommandImpl
    implements DoPaymentPolicyCmd
    This DoPaymentTestCmdImpl Task Command Implementation is called by the DoPaymentMPFCmdImpl command to process payment for the order when the TestPaymentMethod policy is used.

    If the command is successful, the command will return the OrderConstants.ORDER_AUTH_ALLOWED status to the calling command.

    If unsuccessful, the command throws the ECApplicationException specifying an Error Code and the Error View named by the constant com.ibm.commerce.DoPaymentPolicyCmd.ERROR_TASK_NAME or the one named by the setErrorViewName() method.

    This implementation of the DoPaymentPolicyCmd Task Command does not have any returnData to pass to the calling command.

    This command uses the following AccessBeans:

    This command calls the following TaskCommands:

    See Also:
    Serialized Form
    • Constructor Detail

      • DoPaymentTestCmdImpl

        public DoPaymentTestCmdImpl()
        Deprecated. 
    • Method Detail

      • getAccount

        public AccountAccessBean getAccount()
        Deprecated. 
        Returns the AccountAccessBean representing the Account associated with the order. If the order has no associated Account, a null is returned.
        Returns:
        the AccountAccessBean or null
      • getContentType

        public java.lang.String getContentType()
        Deprecated. 
        Returns the Content Type (or MIME type) of the return data, or null if the type is not known.
        Specified by:
        getContentType in interface DoPaymentPolicyCmd
        Returns:
        a String containing the name of the MIME type of the return data, or null if the type is not known. Since this command implementation does not have return data, the method returns null.
      • getOrderState

        public java.lang.String getOrderState()
        Deprecated. 
        Returns the single character String value that the called command wants the Calling command to use to set the Status of the order. If the returned String is empty or null, the Calling command will decide the value to use for the Status
        Specified by:
        getOrderState in interface DoPaymentPolicyCmd
        Returns:
        the preferred order state
      • getReturnData

        public byte[] getReturnData()
        Deprecated. 
        Returns the byte Array containing Return Data from the Payment System. The Payment System used by this command does not use Return Data. Therefore return null.
        Specified by:
        getReturnData in interface DoPaymentPolicyCmd
        Returns:
        null
      • isCardExpiryDateValid

        public static boolean isCardExpiryDateValid(int expiryMonth,
                                                    int expiryYear)
        Deprecated. 
        Checks if the specified expiry date (expiryMonth and expiryYear) is valid.
        Parameters:
        expiryMonth - the calender month of the expiry date (1 for January, 2 for February, and so on.)
        expiryYear - the calender year of the expiry date
        Returns:
        ture if the expiry date is valid; false otherwise.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Deprecated. 
        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.
      • removeSpaceAndHyphenFromString

        public static java.lang.String removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
        Deprecated. 
        Returns a new string that is free of any spaces and hyphenated characters. If the supplied string is already free of spaces and hyphens the same string may be returned.
        Parameters:
        aCardNumber - the card number to be examined and stripped
        Returns:
        a string free of spaces and hyphenated characters ('-')
      • reset

        public void reset()
        Deprecated. 
        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
      • setAccount

        public void setAccount(AccountAccessBean abAccount)
        Deprecated. 
        Sets the account property of the command.

        This is optional. Skip this if none of the trading agreements used by the order items of the order are associated with an account.

        Specified by:
        setAccount in interface DoPaymentPolicyCmd
        Parameters:
        abAccount - the AccountAccessBean representing the account the order is associated with
      • setBuyerPOId

        public void setBuyerPOId(java.lang.Long n)
        Deprecated. 
        Sets optional buyerPOId if the customer (buyer) had specified a buyer purchase order number.
        Specified by:
        setBuyerPOId in interface DoPaymentPolicyCmd
        Parameters:
        n - the internal ID of the BuyerPO record representing the purchase order number specified
      • setErrorViewName

        public void setErrorViewName(java.lang.String sEVN)
        Deprecated. 
        Sets the error view to be used to report error. This overrides the default error view of the command.
        Specified by:
        setErrorViewName in interface DoPaymentPolicyCmd
        Parameters:
        sEVN - the Error View name
        See Also:
        DoPaymentPolicyCmd.ERRTASK_NAME
      • setOrder

        public void setOrder(OrderAccessBean ab)
        Deprecated. 
        Sets the order property of the command.
        Specified by:
        setOrder in interface DoPaymentPolicyCmd
        Parameters:
        ab - the OrderAccessBean representing the order for which payment is to be processed.
      • setPaymentAttributes

        public void setPaymentAttributes(TypedProperty paymentAttributes)
        Deprecated. 
        Sets the paymentAttributes property of the command.

        This command requires the following Payment Attributes:

               Keyword                         Value
             ===========        ====================================
             cardBrand          The credit card brand.  Represents the credit card type used.
             cardNumber         The credit card number              
             cardExpiryMonth    The credit card exipration month  
             cardExpiryYear     The credit card exipration year   
         
        Note that this command stores the credit card brand in the PAYMETHOD column of the ORDPAYMTHD table. If the credit card brand specified is longer than five characters it is truncated before being stored in the ORDPAYMTHD table.
        Specified by:
        setPaymentAttributes in interface DoPaymentPolicyCmd
        Parameters:
        paymentAttributes - the TypedProperty object that contains all the command parameters that are passed to this command.
      • setTotalAmount

        public void setTotalAmount(java.math.BigDecimal totalAmount)
        Deprecated. 
        Sets the totalAmount property of the command.
        Specified by:
        setTotalAmount in interface DoPaymentPolicyCmd
        Parameters:
        totalAmount - the total price of the Order for which payment is to be processed.