Class DoPaymentCmdImpl
- 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.TaskCommandImpl
-
- com.ibm.commerce.payment.commands.DoPaymentCmdImpl
-
- All Implemented Interfaces:
- com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, DoPaymentCmd, 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
Deprecated.Replaced byPrimePaymentCmdImpl
public class DoPaymentCmdImpl extends TaskCommandImpl implements DoPaymentCmd
ThisDoPaymentCmd
Task Command Implementation is called by theOrderProcessCmd
Controller Command to process payment for an order.If the command is successful, the
OrderProcessCmd
will set the Order status to the value specified by this command.If unsuccessful, the command throws the ECApplicationException specifying an Error Code and the Error View named by the constant com.ibm.commerce.DoPaymentCmd.ERROR_TASK_NAME.
This implementation of the
DoPaymentCmd
Task Command does not have any returnData for theOrderProcessCmd
.Note: This is a sample only and must NOT be used for production. This sample does not use any of the new features (such as Contracts and Availability-To-Promise) introduced with WebSphere Commerce.
This command uses the following AccessBeans:
This command calls the following TaskCommands:
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.commerce.payment.commands.DoPaymentCmd
CC_VALID_Y_RANGE, defaultCommandClassName, ERR_CODE_BAD_CCNUM, ERR_CODE_BAD_SYS, ERR_CODE_BAD_XDATE, ERR_CODE_MISSING_PARAM, ERRTASK_NAME, MESSAGE_FOR_BUYER, NAME, NVP_field, NVP_FIELD, PM_MESSAGE_FOR_BUYER, PM_MESSAGE_FOR_MERCHANT, PM_PRIMARY_RC, PM_SECONDARY_RC, WCSHOSTNAME, WCSWEBSERVERPORT, WEBPATH
-
-
Constructor Summary
Constructors Constructor and Description DoPaymentCmdImpl()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description java.lang.String
getContentType()
Deprecated.Returns the Content Type (or MIME type) of the return data, ornull
if the type is not known.java.lang.String
getOrderState()
Deprecated.Returns the single character String value that the called command wants the Calling command to use to set the Status of the order.byte[]
getReturnData()
Deprecated.Returns the byte Array containing Return Data from the Payment System.static boolean
isCardExpiryDateValid(int expiryMonth, int expiryYear)
Deprecated.Checks if the specified expiry date (expiryMonth and expiryYear) is valid.boolean
isReadyToCallExecute()
Deprecated.This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command.void
performExecute()
Deprecated.Performs the main business logic of the command.static java.lang.String
removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
Deprecated.Returns a new string that is free of any spaces and hyphenated characters.void
reset()
Deprecated.Resets the instance variables of the command.void
setOrderId(java.lang.Long orderId)
Deprecated.Sets the orderId property of the command.void
setPaymentAttributes(TypedProperty paymentAttributes)
Deprecated.Sets the paymentAttributes property of the command.void
setTotalAmount(java.math.BigDecimal totalAmount)
Deprecated.Sets the totalAmount property of the command.void
validateParameters()
Deprecated.Checks the validity of customer-supplied parameters.-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, 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.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.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
-
-
-
Method Detail
-
getContentType
public java.lang.String getContentType()
Deprecated.Returns the Content Type (or MIME type) of the return data, ornull
if the type is not known.- Specified by:
getContentType
in interfaceDoPaymentCmd
- Returns:
- a
String
containing the name of the MIME type of the return data, or null if the type is not known. Since this command implementation does not have return data, the method returnsnull
.
-
getOrderState
public java.lang.String getOrderState()
Deprecated.Returns the single character String value that the called command wants the Calling command to use to set the Status of the order. If the returned String is empty or null, the Calling command will decide the value to use for the Status- Specified by:
getOrderState
in interfaceDoPaymentCmd
- Returns:
- the preferred order state
-
getReturnData
public byte[] getReturnData()
Deprecated.Returns the byte Array containing Return Data from the Payment System. The Payment System used by this command does not use Return Data. Therefore return null.- Specified by:
getReturnData
in interfaceDoPaymentCmd
- Returns:
- null
-
isCardExpiryDateValid
public static boolean isCardExpiryDateValid(int expiryMonth, int expiryYear)
Deprecated.Checks if the specified expiry date (expiryMonth and expiryYear) is valid.- Parameters:
expiryMonth
- the calender month of the expiry date (1 for January, 2 for February, and so on.)expiryYear
- the calender year of the expiry date- Returns:
- ture if the expiry date is valid.
-
isReadyToCallExecute
public boolean isReadyToCallExecute()
Deprecated.This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command. This is done before the Framework calls the performExecute method of the command.- Specified by:
isReadyToCallExecute
in interfacecom.ibm.websphere.command.Command
- Overrides:
isReadyToCallExecute
in classAbstractECTargetableCommand
- Returns:
- true if we can execute the command; false otherwise.
-
performExecute
public void performExecute() throws ECException
Deprecated.Performs the main business logic of the command.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
removeSpaceAndHyphenFromString
public static java.lang.String removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
Deprecated.Returns a new string that is free of any spaces and hyphenated characters. If the supplied string is already free of spaces and hyphens the same string may be returned.- Parameters:
aCardNumber
- the card number to be examined and stripped- Returns:
- a string free of spaces and hyphenated characters ('-')
-
reset
public void reset()
Deprecated.Resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters, then make sure those values are no longer needed before calling this method to reset the instance variables of the command.This is useful if the command instance is to be called multiple times with different command parameters.
- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
setOrderId
public void setOrderId(java.lang.Long orderId)
Deprecated.Sets the orderId property of the command.- Specified by:
setOrderId
in interfaceDoPaymentCmd
- Parameters:
orderId
- the order ID of the Order for which payment is to be processed.
-
setPaymentAttributes
public void setPaymentAttributes(TypedProperty paymentAttributes)
Deprecated.Sets the paymentAttributes property of the command.This command requires the following Payment Attributes:
Keyword Value =========== ==================================== cardBrand The credit card brand. Represents the credit card type used. cardNumber The credit card number cardExpiryMonth The credit card exipration month cardExpiryYear The credit card exipration year
Note that this command stores the credit card brand in the PAYMETHOD column of the ORDPAYMTHD table and the size of the column is limited to five characters long.- Specified by:
setPaymentAttributes
in interfaceDoPaymentCmd
- Parameters:
paymentAttributes
- the TypedProperty object that contains all the command parameters passed to this command.- See Also:
DoPaymentMPFCmdImpl
-
setTotalAmount
public void setTotalAmount(java.math.BigDecimal totalAmount)
Deprecated.Sets the totalAmount property of the command.- Specified by:
setTotalAmount
in interfaceDoPaymentCmd
- Parameters:
totalAmount
- the total price of the Order for which payment is to be processed.
-
validateParameters
public void validateParameters() throws ECException
Deprecated.Checks the validity of customer-supplied parameters.- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
-
-