com.ibm.commerce.payment.ppc.commands

Class PPCPaymentechBatchCtrlCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.base.helpers.EJBConstants, AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, PPCPaymentechBatchCtrlCmd, Protectable, ECConstants, ToolsControllerCommand, ECToolsConstants, 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 PPCPaymentechBatchCtrlCmdImpl
    extends ToolsControllerCommandImpl
    implements PPCPaymentechBatchCtrlCmd, ECConstants, ECToolsConstants, com.ibm.commerce.base.helpers.EJBConstants
    This is the default implementation of the PPCPaymentechBatchCtrlCmd tools controller command.

    Input parameters:

    Name XPath Description
    merchConfId /XML/merchConfId Mandatory when running as a scheduler. Ignore when batchdId is set.
    batchId /XML/batchId Mandatory when this command is called to process an existing batch. Ignore when running as a scheduler. Note that the batch to be settled should not be in the state of "SENT".
    forceClose /XML/forceClose This parameter indicates that this batch will be closed whatever the result is. Optional.

    Output parameters:

    None.

    Behaviour:

    • As a scheduler.

      It first creates batches for the pending deposit/credit transactions by calling the createBatch API of PluginController. Then it calls the settleBatch API of PluginController to process the new created batch.

      After the batch is sent, it schedules a job of PPCPaymentechBatchGetCtrlCmd who will send RFR to the back end and receive the RFR response for this batch.

    • As a tools controller command.

      It finds the batch according to the batchId by calling the getBatch API and calls the settleBatch API of PluginController to process the batch. Then it schedules a job of PPCPaymentechBatchGetCtrlCmd who will send RFR request to the back end and receive the RFR response for this batch. The field batchId must be set before the command PPCPaymentechBatchGetCtrlCmd is called.

    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

      • PPCPaymentechBatchCtrlCmdImpl

        public PPCPaymentechBatchCtrlCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        This method performs the main business logic of the command.

        If the batchId is not null , it will first get the batch by calling the getBatch API of payment interface. This actually gets the batch from the DB if the state of this batch is not "SENT". Then it settle the batch by calling the settleBatch API of payment interface.

        Else if the batchId is null, it will create batch for related transactions first and then settle this batch by calling the settleBatch API of payment interface.

        After the batch is settled successfully, a new job of GetPaymentechBatch is added to get the result of the batch.

        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 if something goes wrong.
      • setBatchId

        public void setBatchId(java.lang.String batchIdLocal)
        This method sets the batch identifier.
        Specified by:
        setBatchId in interface PPCPaymentechBatchCtrlCmd
        Parameters:
        batchIdLocal - the batch identifier to set.
      • getBatchId

        public java.lang.String getBatchId()
        This method returns the batch identifier.
        Specified by:
        getBatchId in interface PPCPaymentechBatchCtrlCmd
        Returns:
        String the batch identifier.
      • getMerchConfId

        public java.lang.String getMerchConfId()
        This method returns the merchant configuration identifier.
        Specified by:
        getMerchConfId in interface PPCPaymentechBatchCtrlCmd
        Returns:
        String the merchant configuration identifier.
      • setMerchConfId

        public void setMerchConfId(java.lang.String merchConfIdLocal)
        This method sets the merchant configuration identifier.
        Specified by:
        setMerchConfId in interface PPCPaymentechBatchCtrlCmd
        Parameters:
        merchConfIdLocal - the merchant configuration identifier to set.
      • isForceClose

        public boolean isForceClose()
        This method judges if the forceClose flag is set as true or false.
        Returns:
        returns if the forceClose flag is set as true or false
      • setForceClose

        public void setForceClose(boolean thisForceClose)
        This method sets if the forceClose flag is set as true or false.
        Parameters:
        thisForceClose - if the forceClose flag is set as true or false
      • 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 AbstractECTargetableCommand