com.ibm.commerce.edp.commands

Interface EditCmd

  • All Superinterfaces:
    AEDPPaymentTaskCmd, AEDPTaskCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.commerce.command.CacheableECCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ECCommand, java.io.Serializable, com.ibm.websphere.command.TargetableCommand, TaskCommand
    All Known Implementing Classes:
    EditCmdImpl, EditVoidCmdImpl


    public interface EditCmd
    extends AEDPPaymentTaskCmd
    This task command is used to edit payments.

    This command occurs when certain payment information needs to be updated, added, or deleted from an order. EditCmd can occur as long as the order is not closed. For example, EditCmd occur under the following circumstances:

    • New payment instructions are added. For example, The credit card information was incorrect. A new credit card needs to be used if the original card is lost or stolen. The total order amount changes.
    • Payment amounts change. Amounts in payment instructions can increase or decrease because order amounts can change.
    • Payment instructions are canceled. For example, when the number of a stolen credit card needs to be removed or the total order amount changes.
    • Payment information is changed. For example, billing address information or the expiration date on a credit card changes.

    This command is used to ensure the new payment information is valid and the new payment instruction amounts add up to the order amount. It also ensures that if payment instructions are removed, all related payment actions are reversed whenever possible. Payment instructions can be created during the processing of this type of event.

    Payment instructions can be added during StoreAndValidateCmd, after StoreAndValidateCmd and before PrimePaymentCmd, and after PrimePaymentCmd. They can also be added before and after ReservePaymentCmd.

    This command verifies that no payment reservation exists with outstanding releases. For example, if two ReservePaymentCmd occur for an order, there should be two FinalizePaymentCmd for the order (assuming two releases occur; the number of FinalizePaymentCmd corresponds to the number of releases). If the number of FinalizePaymentCmd is 2, an EditCmd can occur. If a FinalizePaymentCmd request still needs to occur, an EditCmd does not occur and an error is returned.

    An EditCmd command can occur if a deposit already happened during the PrimePaymentCmd (or ReservePaymentCmd followed by a FinalizePaymentCmd) as long as the amount does not need to be reduced below the deposited amount. An EditCmd to increase the amount is always allowed. A decrease might not be allowed if funds were already deposited (however, the EditCmd can be forced to allow the increase).

    The possible payment actions associated with this occurrence are not configurable.

    Edits will trigger reversals and validation of payment instructions.�A TriggerPaymentActionsCmd command will trigger equivalent actions for the PrimePaymentCmd.

    If a deposit has already happened against a payment instruction that is being removed, the EditCmd will fail unless it is forced. In this case, a tickler will be created to notify a Customer Support Representative that an amount might need to be refunded to the customer.

    Example: A customer's credit card order has been captured. The customer later contacts the Customer Support Representative to switch brand of credit cards. The Customer Support Representative edits the payment information to make the change and an EditCmd command occurs. In the TriggerPaymantActionsCmd command, the system does the following things. It verifies that the payment instructions can indeed be changed (that is, payments have not already been reserved for the order). It reads the payment action rules required for the payment method.

    The default implementation of this command is EditCmdImpl
    • Field Detail

      • COPYRIGHT

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

        static final java.lang.String defaultCommandClassName
        The default implementation of this command.
        See Also:
        Constant Field Values
      • NAME

        static final java.lang.String NAME
        The full name of this command.
        See Also:
        Constant Field Values
    • Method Detail

      • setForcedPaymentInstructionChangeFlag

        void setForcedPaymentInstructionChangeFlag(boolean forcedChange)
        This method sets the forced flag indicating if the payment instruction change will be forced or not. It is up to the caller to set the forceFlag whether they want to do a forced request or not.
        Parameters:
        forcedChange - A boolean that indicates if the request is forced or not.
      • setOrderAmount

        void setOrderAmount(java.math.BigDecimal orderAmount)
        This method sets the new total order amount.
        Parameters:
        orderAmount - A BigDecimal that specifies the new total order amount.
      • setEditResults

        void setEditResults(EDPEditResults edpEditResults)
        This method sets the aggregated result of each individual payment instruction.
        Parameters:
        edpEditResults - An EDPEditResults that represents the event-driven payment request results.
      • getEditResults

        EDPEditResults getEditResults()
        This method returns the aggregated result of each individual payment instruction.
        Returns:
        An EDPEditResults that represents the event-driven payments request results.
      • setPONumber

        void setPONumber(java.lang.String aPONumber)
        This method sets the purchase order number to be used with the payment instruction. The purchase order number is an optional attribute unless purchase order terms and conditions are being used.
        Parameters:
        aPONumber - A String that specifies the purchase order number.
      • setPaymentInstructions

        void setPaymentInstructions(java.util.ArrayList pis)
        This method sets the list of payment instructions to be modified, created and removed.
        Parameters:
        pis - An ArrayList that represents the payment instructions of the type EDPPaymentInstruction.
      • systemEditableAddOrderAmount

        void systemEditableAddOrderAmount(java.lang.Long edpOrderId,
                                          java.math.BigDecimal addToPIAmount)
                                   throws EDPException,
                                          ECException
        This method adds the order amount to the current order when the order is edited.
        Parameters:
        edpOrderId - A Long that specifies the id of the payment order which will be add amount.
        addToPIAmount - A BigDecimal That specifies the amount which will be added to the order.
        Throws:
        EDPException
        ECException