com.ibm.commerce.edp.commands

Class FinalizePaymentCmdImpl

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

    Behaviour:

    • It acts as a wrapper for payments rules finalize payment event. This event is associated with the fulfillment of the order release. It ensures that funds have been captured because goods have been shipped. It occurs when the order items in the release are fulfilled (items are boxed and shipped).

    Input parameters:

    orderId A Long that specifies the order ID.
    releaseId A Long that specifies the release id.
    finalizationAmount A BigDecimal that specifies the amount to be finalized.
    commandContext The command context.

    Output parameters:

    None.

    Task commands called:

    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

      • FinalizePaymentCmdImpl

        public FinalizePaymentCmdImpl()
    • Method Detail

      • setFinalizationAmount

        public void setFinalizationAmount(java.math.BigDecimal paramFinalizationAmount)
        This method sets the amount to be finalized.
        Specified by:
        setFinalizationAmount in interface FinalizePaymentCmd
        Parameters:
        paramFinalizationAmount - A BigDecimal that specifies the amount to be finalized.
      • getFinalizationAmount

        public java.math.BigDecimal getFinalizationAmount()
        This method returns the amount to be finalized as a BigDecimal Object.
        Returns:
        A BigDecimal that specifies the amount to be finalized.
      • getOrderAccessBean

        public OrderAccessBean getOrderAccessBean()

        This method returns a reference to the order access bean.

        This method 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.
      • setReleaseId

        public void setReleaseId(java.lang.Long paramReleaseId)
        This method sets the ID of the release for which the amount is being finalized.
        Specified by:
        setReleaseId in interface FinalizePaymentCmd
        Parameters:
        paramReleaseId - A Long that specifies the sets the ID of the release.
      • getReleaseId

        public java.lang.Long getReleaseId()
        This method returns the current release id.
        Returns:
        A Long that specifies the ID of the release for which the amount is being finalized.
      • executeFinalizePaymentTCs

        public void executeFinalizePaymentTCs()
                                       throws ECException
        This method executes the paymentTCs required to call finalizepayment of Payment Rules.
        Throws:
        ECException
      • 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.

        It firstly checks the backend status of edp order, and if it is failed, then directly returns.

        Then it updates the atomic payments with freshly acquired data from the backend. If any pending backend transaction exists, return.

        It calculates the amount still to finalize for current release, and read payment rules configuration to decide what payment actions to execute.

        If anything prevents payment rules from processing finalize payment event successfully in foreground. Tickler will be created because this is the last time payment rules get called in order life cycle

        Throws:
        EDPException
        ECException