com.ibm.commerce.subscription.commands

Class SubscriptionCancelOrderCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, SubscriptionCancelOrderCmd, 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 SubscriptionCancelOrderCmdImpl
    extends TaskCommandImpl
    implements SubscriptionCancelOrderCmd
    This class implements the methods to cancel the parent order of a recurring order and the parent order item in case of subscription. In case of subscriptions, it additionally handles refunds as subscriptions provide upfront payment. This class takes into account the amount paid and the number of shipments received by the shopper before the cancellation, to calculate the refund amount. Before cancelling the parent order or the parent order item, it checks to see if any child orders were created for the recurring order or subscription. It sends a cancel request to the order only if no child orders have been created.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SubscriptionCancelOrderCmdImpl

        public SubscriptionCancelOrderCmdImpl()
        Default constructor for the class.
    • Method Detail

      • processSubscriptionParentOrderItemCancel

        public void processSubscriptionParentOrderItemCancel(java.lang.String orderId,
                                                             java.lang.String orderItemId,
                                                             java.lang.String subscriptionId,
                                                             Subscription phySubscription)
                                                      throws OrderException
        This method is used to cancel the parent order item of a subscription
        Specified by:
        processSubscriptionParentOrderItemCancel in interface SubscriptionCancelOrderCmd
        Parameters:
        orderId - The ID of the order being cancelled
        orderItemId - The ID of the order item being cancelled
        subscriptionId - The ID of the subscription being cancelled
        phySubscription - The subscription physical data object
        Throws:
        OrderException
      • processRecurringOrderParentOrderCancel

        public void processRecurringOrderParentOrderCancel(java.lang.String orderId,
                                                           java.lang.String subscriptionId,
                                                           Subscription phySubscription)
                                                    throws OrderException
        This method is used to cancel the parent order of a recurring order
        Specified by:
        processRecurringOrderParentOrderCancel in interface SubscriptionCancelOrderCmd
        Parameters:
        orderId - The order ID to be cancelled
        subscriptionId - The ID of the subscription being cancelled
        phySubscription - The subscription physical data object
        Throws:
        OrderException
      • performExecute

        public void performExecute()
                            throws ECException
        This method invokes the processRecurringOrderParentOrderCancel method to cancel parent orders of recurring orders or the processSubscriptionParentOrderItemCancel method to cancel parent order item of subscriptions
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • getSubscriptionIdentifier

        public java.lang.String getSubscriptionIdentifier()
        Returns the subscription ID.
        Returns:
        The subscription ID
      • setSubscriptionIdentifier

        public void setSubscriptionIdentifier(java.lang.String subscriptionId)
        Sets the ID of the subscription whose parent order or parent order item is to be canceled.
        Specified by:
        setSubscriptionIdentifier in interface SubscriptionCancelOrderCmd
        Parameters:
        subscriptionId - The subscription ID.