com.ibm.commerce.couponredemption.commands
Class UseCouponIdCmdImpl
com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.couponredemption.commands.UseCouponIdCmdImpl
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, UseCouponIdCmd
- public class UseCouponIdCmdImpl
- extends ControllerCommandImpl
- implements UseCouponIdCmd
This command is invoked when the shopper specifies a set of eCoupon codes explicitly while checking out.
The input to this command is :
The ids of ecoupons that were selected for use with order.
The order under consideration.
If the given set of BCIDs aren't valid for this shopper from the CPWALLET, then an error page is send to the
user. If the above condition is true then, the following steps are performed. The CheckValidityCmd command is called
to find the eCoupons that are not expired and for not expired eCoupons, CheckApplicabilityCmd command is called
to find out which eCoupons are applicable for this order. For applicable coupons, CalculateDiscountAmtCmd command
is called to calculate the discount amount and CouponDSSTaskCmd command is called to check for any conflict.
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties |
couponId
protected java.lang.Long[] couponId
iResourceList
protected java.util.Vector iResourceList
orderId
protected java.lang.Long orderId
processingContext
protected CommandContext processingContext
selectionOK
protected boolean selectionOK
shopperId
protected java.lang.Long shopperId
storeId
protected java.lang.Integer storeId
UseCouponIdCmdImpl
public UseCouponIdCmdImpl()
- UseCouponIdCmdImpl constructor call super.
getResources
public AccessVector getResources()
throws ECSystemException
- Get the resourses.
- Specified by:
getResources
in interface ECCommand
- Overrides:
getResources
in class AbstractECTargetableCommand
- Returns:
- com.ibm.commerce.accesscontrol.AccessVector
- Throws:
ECSystemException
-
performExecute
public void performExecute()
throws ECException
This command is invoked when the shopper specifies a set of eCoupon codes explicitly while checking out.
If the given set of BCIDs aren't valid for this shopper from the CPWALLET, then an error page is send to the
user. If the above condition is true then, the following steps are performed. The CheckValidityCmd command is called
to find the eCoupons that are not expired and for not expired eCoupons, CheckApplicabilityCmd command is called
to find out which eCoupons are applicable for this order. For applicable coupons, CalculateDiscountAmtCmd command
is called to calculate the discount amount and CouponDSSTaskCmd command is called to check for any conflict.
- Specified by:
performExecute
in interface ECCommand
- Overrides:
performExecute
in class AbstractECTargetableCommand
- Throws:
ECException
-
validateParameters
public void validateParameters()
throws ECException
- ControllerCommandImpl calls checkParameter in performExecute.
It is the responsibility of the command writers to implements
this method if they want to perform server side parameter checking.
They should either calls checkParameters inside their performExecute
or calls super.performExecute() as the first statement in the
performExecute method.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECTargetableCommand
- Throws:
CommandException.
-