com.ibm.commerce.returns.commands
Class ReturnProcessCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.ControllerCommandImpl
-
- com.ibm.commerce.returns.commands.ReturnBaseCmdImpl
-
- com.ibm.commerce.returns.commands.ReturnProcessCmdImpl
-
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReturnProcessCmd, Protectable, 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 ReturnProcessCmdImpl extends ReturnBaseCmdImpl implements ReturnProcessCmd
This is the default implementation of the controller commandReturnProcessCmd
interface.Finalizes the agreement between the merchant and the customer as to the terms of a return merchandise authorization (RMA).
Parameters
RMAId
(mandatory)- The Id of the RMA to finalize.
- refundPolicyId (optional)
- The policy Id of the refund mechanism to use. This is mandatory if there is more than one possible refund policy and it was not specified in a prior call to ReturnProcess for this RMA.
- URL (mandatory)
- The URL to redirect to if the RMA is approved.
URL2
(optional)- The URL to redirect to if the RMA is not approved. If not specified, the value specified in the URL parameter will be used.
- RMAExpiryURL (optional)
- The URL to redirect to if the RMA had expired and was re-prepared.
Behaviour
- Checks to see if the RMA exists. If not, ECApplicationException is thrown with message _ERR_RMA_IN_INVALID_STATE_FOR_COMMAND.
- Checks to see if a refund policy has been specified, either within the command call or previously,
or because there is only one choice. If not, returns an error. If not, ECApplicationException
is thrown with
message_ERR_BAD_MISSING_CMD_PARAMETER
. - Checks to see if the RMA has been prepared. If not, ECApplicationException is thrown with message _ERR_RMA_IN_INVALID_STATE_FOR_COMMAND.
- Calls the RePrepareExpiredRMACmd task command to check to see if the
RMAGOODFOR
time frame has expired for any RMA Item. If so, calls the ReturnPrepare command and a redirection will take place to the RMAExpiryURL if it is specified. If the RMAExpiryURL parameter is not specified, then ReturnProcess completes normally. - Calls the CalculateRMAApprovalCmd task command to calculate the overall status of the Return. If
the RMA is approved, then the command marks it as approved (RMA.status='APP'), logs the authorization notice, and
redirects to the URL specified. If the RMA is not approved, then the command marks it as
pending (RMA.status='PND') and redirects to
URL2
. - Calls PrimeRefundCmd to store the refund information in a backend system.
Utilizes these access beans
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.commerce.returns.commands.ReturnProcessCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description ReturnProcessCmdImpl()
ReturnProcessCmdImpl constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AccessVector
getResources()
Gets the vector of resources accessed by this command.void
performExecute()
Execute the command.void
reset()
Reset the command.void
validateParameters()
Check mandatory parameters.-
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, 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, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
-
-
-
-
Constructor Detail
-
ReturnProcessCmdImpl
public ReturnProcessCmdImpl()
ReturnProcessCmdImpl constructor.
-
-
Method Detail
-
getResources
public AccessVector getResources() throws ECException
Gets the vector of resources accessed by this command.- Specified by:
getResources
in interfaceECCommand
- Overrides:
getResources
in classAbstractECTargetableCommand
- Returns:
- AccessVector - a vector of resource action pairs
- Throws:
ECException
- Thrown if WebSphere Commerce problems happen
-
performExecute
public void performExecute() throws ECException
Execute the command.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECApplicationException
- If the RMA is not in the prepared state throws com.ibm.commerce.exception.ECApplicationException with ECMessage.ECMessage._ERR_RMA_IN_INVALID_STATE_FOR_COMMANDECException
-
reset
public void reset()
Reset the command.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
validateParameters
public void validateParameters() throws ECException
Check mandatory parameters.Parameters
- RMA.status
- the status of the RMA must be in process or in edit state
- URL
- The URL to redirect to if the RMA is approved.
- refundPolicyId
- the refundPolicyId id for the RMA.
- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECApplicationException
- If the RMA.status is not in the right state,(Process or edit) throws com.ibm.commerce.exception.ECApplicationException with ECMessage.ECMessage._ERR_RMA_IN_INVALID_STATE_FOR_COMMANDECApplicationException
- If there is no refundPolicyId or if no "approved" redirect URL has been specified, throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETERECException
- RMA.status
-
-