com.ibm.commerce.edp.commands

Class PrimePaymentCmdImpl

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

    Behaviour:

    • It is called by the ProcessOrderCmdImpl Task Command to prepare an order for payment using payments rules component. If unsuccessful, the command throws the ECSystemException
    • The PrimePayment business event is associated with the order capture. When the order is captured, this event provides some guarantee that the customer has funds to pay for the order. Like storeAndValidate event, the purpose of this event is for the merchant to find out whether a payment is bad before the customer is disengaged. An event-driven payments order and payment instructions are created during the processing of this type of event. An event-driven payments order corresponds to the payment portion of a WebSphere Commerce order, and can have multiple releases associated with it.

    Input parameters:

    orderId A Long that indicates the id of the current order.
    inTotalAmount An int that indicates the total order amount.
    inInitialAmount An int that indicates the initial amount.
    itpPaymentAttributes A TypedProperty that the represents the paymentAttributes property of the command.
    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

      • PrimePaymentCmdImpl

        public PrimePaymentCmdImpl()
    • Method Detail

      • getAccount

        public AccountAccessBean getAccount()

        This method returns the AccountAccessBean representing the account if an account ID is present.

        If no account ID is set, null is returned.

        This method will first check if the local variable iabAccount is set. If not, it will attempt to retrieve the AccountAccessBean using the specified account ID.

        Returns:
        The reference to the account access bean(AccountAccessBean) if account ID is present; null otherwise .
      • setAccountId

        public void setAccountId(java.lang.Long n)
        This method sets the account ID. This is the common account ID if one is specified by the trading agreements used by the order items of the order being processed. If there is no common account ID, this method should not be called.
        Parameters:
        n - A Long that specifies the account ID.
      • getAccountId

        public java.lang.Long getAccountId()
        This method returns the common account ID if one is specified by the trading agreements used by the order items of the order being processed. If there is no account associated with any of the trading agreements, null is returned.
        Returns:
        A Long that specifies the account ID.
      • setBuyerPOId

        public void setBuyerPOId(java.lang.Long n)
        This method sets the buyerPO ID. This is the internal ID of the BuyerPO record associated with the purchase order number specified by the buyer. If no purchase order number is specified, this method should not be called.
        Parameters:
        n - A Long that specifies the buyerPO ID.
      • getBuyerPOId

        public java.lang.Long getBuyerPOId()
        This method returns the internal ID of the BuyerPO record if a buyer purchase order number is specified. Otherwise returns a null.
        Returns:
        A Long that specifies the internal ID of the BuyerPO record or null.
      • setEDPWarning

        public void setEDPWarning(java.lang.String warning)
        This method sets the payment rule warning information.
        Parameters:
        warning - A String that specifies the payment rule warning information to set.
      • getEDPWarning

        public java.lang.String getEDPWarning()
        This method returns the payment rule warning information.
        Specified by:
        getEDPWarning in interface PrimePaymentCmd
        Returns:
        A String that specifies the payment rule warning information.
      • setInitialAmount

        public void setInitialAmount(java.math.BigDecimal initialAmount)
        This method sets the initial amount.
        Specified by:
        setInitialAmount in interface PrimePaymentCmd
        Parameters:
        initialAmount - A BigDecimal that specifies the initial amount to set.
      • getInitialAmount

        public java.math.BigDecimal getInitialAmount()
        This method returns the initial amount.
        Returns:
        A BigDecimal that specifies the initial amount.
      • setOrderAccessBean

        public void setOrderAccessBean(OrderAccessBean abOrder)
        This method sets a reference to the order access bean.
        Parameters:
        abOrder - An OrderAccessBean that represents the reference to the order access bean.
      • 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.
      • getPONumber

        public java.lang.String getPONumber()
        This method just returns null.
        Returns:
        null
      • setPaymentAttributes

        public void setPaymentAttributes(TypedProperty paymentAttributes)
        This method sets the paymentAttributes property of the command.
        Specified by:
        setPaymentAttributes in interface PrimePaymentCmd
        Parameters:
        paymentAttributes - A TypedProperty that represents the requestProperties object that contains all the command parameters that are to be passed to this command. It supports both wallet based and non-wallet based payments
      • setPaymentMethodId

        public void setPaymentMethodId(java.lang.String nPayMthdId)

        This method sets the payment method ID to be used with the payments rules subcomponent.

        This method is to be used when there is only a single payment method for the entire order.

        Specified by:
        setPaymentMethodId in interface PrimePaymentCmd
        Parameters:
        nPayMthdId - A String that specifies the payments rules payment method ID.
      • getPaymentMethodId

        public java.lang.String getPaymentMethodId()
        This method returns the payment method ID to be used for the payment of the order.
        Returns:
        A String that specifies the payment method ID.
      • 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.
      • setTotalAmount

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

        public java.math.BigDecimal getTotalAmount()
        This method returns the total order amount.
        Returns:
        A BigDecimal that specifies the total order amounts; null may be returned
      • executePrimePaymentTCs

        public void executePrimePaymentTCs()
                                    throws ECException
        Do nothing
        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 processes the foreground tasks.

        This method firstly updates the initial amount of the edp order. If current initial amount of the edp order is zero, we just set the request initial amount to it. And if current initial amount of the edp order is not zero, we should check if it is equal to the request initial amount.

        Then it calculates the actions for PrimePayment business event through reading the Payment Rules Configuration.

        Throws:
        EDPException - This exception is thrown in case of failure.
        ECException - This exception is thrown in case of failure.