public class DoPaymentCmdImpl extends TaskCommandImpl implements DoPaymentCmd
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 the OrderProcessCmd.
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:
Constructor and Description |
---|
DoPaymentCmdImpl()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String | getCardBrand()
Deprecated.
Gets the credit card brand.
|
protected java.lang.Integer | getCardExpiryMonth()
Deprecated.
Gets the credit card Expiry Month.
|
protected java.lang.Integer | getCardExpiryYear()
Deprecated.
Gets the credit card Expiry Year.
|
protected java.lang.String | getCardNumber()
Deprecated.
Gets the credit card number.
|
java.lang.String | getContentType()
Deprecated.
Returns the Content Type (or MIME type) of the return data, or null if the type is not known.
|
protected java.lang.Long | getOrderId()
Deprecated.
Gets the order ID of the order being processed.
|
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.
|
protected TypedProperty | getPaymentAttributes()
Deprecated.
Returns the TypedProperty object containing the payment attributes passed to this command by the calling command.
|
byte[] | getReturnData()
Deprecated.
Returns the byte Array containing Return Data from the Payment System.
|
protected java.math.BigDecimal | getTotalAmount()
Deprecated.
Returns the total order amount passed to the command by the caller.
|
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.
|
protected void | setCardBrand(java.lang.String cardBrand)
Deprecated.
Sets the credit card brand.
|
protected void | setCardExpiryMonth(java.lang.Integer cardExpiryMonth)
Deprecated.
Sets the credit card Expiry Month.
|
protected void | setCardExpiryYear(java.lang.Integer cardExpiryYear)
Deprecated.
Sets the credit card Expiry Year.
|
protected void | setCardNumber(java.lang.String cardNumber)
Deprecated.
Sets the credit card number.
|
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.
|
protected java.lang.String getCardBrand()
protected java.lang.Integer getCardExpiryMonth()
protected java.lang.Integer getCardExpiryYear()
protected java.lang.String getCardNumber()
public java.lang.String getContentType()
protected java.lang.Long getOrderId()
public java.lang.String getOrderState()
protected TypedProperty getPaymentAttributes()
public byte[] getReturnData()
protected java.math.BigDecimal getTotalAmount()
public static boolean isCardExpiryDateValid(int expiryMonth, int expiryYear)
public boolean isReadyToCallExecute()
public void performExecute() throws ECException
public static java.lang.String removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
public void reset()
This is useful if the command instance is to be called multiple times with different command parameters.
protected void setCardBrand(java.lang.String cardBrand)
protected void setCardExpiryMonth(java.lang.Integer cardExpiryMonth)
protected void setCardExpiryYear(java.lang.Integer cardExpiryYear)
protected void setCardNumber(java.lang.String cardNumber)
public void setOrderId(java.lang.Long orderId)
public void setPaymentAttributes(TypedProperty paymentAttributes)
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 yearNote 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.
public void setTotalAmount(java.math.BigDecimal totalAmount)
public void validateParameters() throws ECException