com.ibm.commerce.edp.commands

Class TriggerPaymentActionsCmdImpl

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

    Behaviour:

    • The triggerPaymentActions business event usually occurs after a series of edits has been made. Because the system cannot predict how many edits will occur before it should balance amounts, the triggerActions event causes any required payment actions to be executed and puts payments in a consistent state. The triggerActions event is also invoked when temporary connectivity problems have disrupted transactions.
    • This task command should be invoked to synchronize the payment rules after edit requests have taken place. It will try to bring the payment rules data to a 'phase' state (prime/reserve/finalize).
    • If unsuccessful, the command is expected to throw the ECSystemException.

    Input parameters:

    commandContext The command context.
    iabOrder An OrderAccessBean for the current order.
    orderTotalAmount A BigDecimal that specifies the total amount of the order.
    orderInitialAmount A BigDecimal that specifies the initial amount to be used in the trigger payment action business event request.

    Output parameters:

    None.

    Task commands called:

    See Also:
    Serialized Form
    • Constructor Detail

      • TriggerPaymentActionsCmdImpl

        public TriggerPaymentActionsCmdImpl()
    • Method Detail

      • setOrderAccessBean

        public void setOrderAccessBean(OrderAccessBean abOrder)
        This method sets a reference to the order access bean.
        Parameters:
        abOrder - the reference to the order access bean
      • getOrderAccessBean

        public OrderAccessBean getOrderAccessBean()
        This method gets a reference to the order access bean. It will first check if there is a local reference to the order access bean. If not present, it will create a new one.
        Returns:
        A OrderAccessBean that corresponds to the Order to paid for.
      • 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:
        A boolean that is true if the command is ready to execute and false otherwise.
      • performExecute

        public void performExecute()
                            throws ECException
        This method executes the business logic of this command implementation. Firstly it executes the foreground tasks to decide if primePayment or finalizepayment should be executed, then executes the backend tasks through raising Trigger Payment event.
        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 in case of any failure.
      • reset

        public void reset()

        This method 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
      • processFG

        public void processFG()
                       throws EDPException,
                              ECException
        This method executes the foreground tasks. If primePayment is needed, then executes the primePayment business event; If finalizePayment is needed, then executes the finalizePayment business event.
        Throws:
        EDPException - This exception is thrown in case of any failure.
        ECException - This exception is thrown in case of any failure.
      • setInitialAmount

        public void setInitialAmount(java.math.BigDecimal initialAmount)
        This method sets the initial amount to be used in the prime payment request.
        Specified by:
        setInitialAmount in interface TriggerPaymentActionsCmd
        Parameters:
        initialAmount - A BigDecimal that specifies the initial amount to be used in the prime payment request.
      • isProcessBGExecutableInFG

        public boolean isProcessBGExecutableInFG()
        This method returns if the backend tasks could be executed in foreground.
        Overrides:
        isProcessBGExecutableInFG in class AEDPPaymentTaskCmdImpl
        Returns:
        A boolean that indicates if the backend tasks are executable in foreground.
      • setTotalAmount

        public void setTotalAmount(java.math.BigDecimal totalAmount)
        This method sets the total amount of the order.
        Specified by:
        setTotalAmount in interface TriggerPaymentActionsCmd
        Parameters:
        totalAmount - A BigDecimal that specifies the total amount of the order.