Class AdminOrderCancelCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, AdminOrderCancelCmd, Protectable,,,,,,

    public class AdminOrderCancelCmdImpl
    extends OrderBaseCmdImpl
    implements AdminOrderCancelCmd
    This is the default implementation of the AdminOrderCancelCmd controller command used to cancel order.

    Input parameters:

    Name Description
    orderId The order Id abbreviations. Optional
    URL The redirect URL. Optional
    notifyMerchant The property indicates whether to notify merchant for order cancel. If the value is 1, the command will notify merchant. Otherwise, the command will not notify merchant when the value equals 0. Optional
    notifyShopper The property indicates whether to notify shopper for order cancel. If the value is 1, the command will notify shopper. Otherwise, the command will not notify shopper when the value equals 0. Optional
    forcedCancel The property indicates whether to reverse payment when the deposit has already happened. If the value is true, the command will reverse all approved payment even if deposits have already happened. Optional


    • It calls CancelOrderCmd to cancel payment.
    • If order status equals "I", it calls RemoveJobCmd to remove scheduled order.
    • It calls DoInventoryActionCmd to reverse inventory.
    • If order status equals "W", it calls BusinessFlowEvent to raise the business flow event.
    • It calls CancelPONumberCmd to cancel purchase order number.
    • If notifyMerchant equals 1, it notifies merchant for order cancel.
    • If notifyShopper equals 1, it notifies shopper for order cancel.
    • It calls RaiseOrderEventCmd to raise business event.
    This command calls the following TaskCommands: This command uses the following AccessBeans:
    See Also:
    Serialized Form
    • Field Detail


        public static final java.lang.String CLASSNAME
        The full name of this command.
    • Constructor Detail

      • AdminOrderCancelCmdImpl

        public AdminOrderCancelCmdImpl()
    • Method Detail

      • getOrderId

        public java.lang.Long getOrderId()
        This method returns the id of the order.
        order id.
      • getURL

        public java.lang.String getURL()
        This method returns the URL .
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method is called by the Command Framework to check if URL and orderId 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
        isReadyToCallExecute in class AbstractECTargetableCommand
        true is the command is ready to execute and false otherwise.
      • performOrderCancel

        public static void performOrderCancel(CommandContext cmdCtxt,
                                              OrderAccessBean abOrder,
                                              java.lang.Boolean forcedCancel,
                                              TypedProperty requestProperties)
                                       throws ECException,
        This static method performs an order cancel. It includes CancelOrderCmd to reverse payment, RemoveJobCmd to remove scheduled order, DoInventoryActionCmd to reverse inventory, and BusinessFlowEvent to raise business flow event.
        cmdCtxt - a command context.
        abOrder - an order access bean.
        forcedCancel - a flag of forced cancel(if the flag is true, the command will reverse all approved deposit even if the deposits have already happened)
        requestProperties - a request property.
      • setOrderId

        public void setOrderId(java.lang.Long orderId)
        This method sets the id of the order.
        orderId - order id.
      • setRequestProperties

        public void setRequestProperties(TypedProperty reqProperties)
                                  throws ECException
        This method sets request properties, if the parameter is null or unexpected value, the method will give it default value. The WebController calls the setRequestProperties method before invoking the execute method in this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the request properties and perform parameter checking.
        Specified by:
        setRequestProperties in interface ControllerCommand
        setRequestProperties in class ControllerCommandImpl
        reqProperties - a request property.
      • setURL

        public void setURL(java.lang.String astrURL)
        This method sets the redirect URL property of the command.
        astrURL - the URL to redirect to after the command completes its processing. The payment information is to be appended to this URL as additional name-value pairs in the query string.
      • throwIllegalStatus

        public static void throwIllegalStatus(java.lang.String methodName)
                                       throws ECApplicationException
        This method reports and propagates error for invalid status.
        methodName - a method name.
      • setForcedCancel

        public void setForcedCancel(java.lang.Boolean cancel)
        This method sets the forcedCancel
        cancel - a flag for Event-Driven Payments cancel, false as the default.
      • getForcedCancel

        public java.lang.Boolean getForcedCancel()
        This method gets the forcedCancel
        a flag for Event-Driven Payments cancel, false as the default.