com.ibm.commerce.edp.commands

Class CheckOrderPaymentAuthorizedCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, AEDPPaymentTaskCmd, AEDPTaskCmd, CheckOrderPaymentAuthorizedCmd, 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 CheckOrderPaymentAuthorizedCmdImpl
    extends AEDPPaymentTaskCmdImpl
    implements CheckOrderPaymentAuthorizedCmd
    This is the default implementation of the CheckOrderPaymentAuthorizedCmd task command.

    Behaviour:

    • It queries the Payment Rule if the total order amount is approved in payment system. If the EDP Order back ground job is pending, return false.
    • If the backend job is working, then it changes the event for this EDP order to a high priority.
    • If the backend job of current EDP order is working, then it sets the flag if the order is totally authorized to false and return.
    • If there is no payment instruction in payment processing for this EDP order. Then it sets the flag if the order is totally authorized to false and return.
    • It goes through all payment instructions in payment processing. If the total approved amount for these payment instructions is bigger than or equals(>=) order total amount. Then it returns the flag if the order is totally authorized to true; otherwise false.

    Input parameters:

    commandContext The command context.
    orderId A Long that specifies the current order id.

    Output parameters:

    None.

    Task commands called:

    None
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CheckOrderPaymentAuthorizedCmdImpl

        public CheckOrderPaymentAuthorizedCmdImpl()
        The default constructor.
    • Method Detail

      • isOrderTotalAuthorized

        public java.lang.Boolean isOrderTotalAuthorized()
        This method returns if the order is totally approved in Payment Rule.
        Specified by:
        isOrderTotalAuthorized in interface CheckOrderPaymentAuthorizedCmd
        Returns:
        A Boolean that specifies if the order is totally approved in Payment Rule.
      • setOrderTotalAuthorized

        public void setOrderTotalAuthorized(java.lang.Boolean authorized)
        This method sets if the order is totally approved in Payment Rule.
        Parameters:
        authorized - A Boolean that represents if the order is totally approved in Payment Rule.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method checks if the command is ready to be executed. This method is called by the WC Command Framework to check if all mandatory parameters have been properly set for this command. This should be done before the Framework calls performExecute() of this command.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        A boolean indicating if the command is ready to execute.
      • performExecute

        public void performExecute()
                            throws ECException
        This method executes the business logic of this command implementation.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - This exception is thrown when any kind of failure in event-driven payments subcomponent.
      • reset

        public void reset()
        Resets the command fields. After this method is invoked, and proper attributes are set, the command can be executed again.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AEDPPaymentTaskCmdImpl