java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.payment.commands.DoPaymentMPFInternalCmdImpl
This DoPaymentMPFInternalCmd
Task Command Implementation is
called by the DoPaymentMPFCmdImpl
Task Command to process payment
for an order using WebSphere Commerce Payments when the payMethodId url
parameter was specified with the OrderProcess command. This Task Command
Implementation is a renamed version of the original DoPaymentMPFCmdImpl class
and is mainly for backward compatibility. It does not support any of the new
function introduced with WCBE.
This DoPaymentMPFInternalCmd
implementation class is
independent of the payment cassette that would be used to process the payment
for the order. It uses the Cashier profile specified by the payMethodId
parameter to direct the Cashier to gather parameters needed by the payment
cassette. This command implementation supports both non-wallet based payment
cassettes and wallet-based payment cassettes.
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 com.ibm.commerce.DoPaymentCmd.ERROR_TASK_NAME.
The DoPaymentMPFInternalCmdImpl
class may result in non-empty
returnData for the OrderProcessCmd
dependent on the Cassette.
Field Summary | |
---|---|
static java.lang.String |
BILLTO_ADDRESS1 |
static java.lang.String |
BILLTO_CITY |
static java.lang.String |
BILLTO_COUNTRY |
static java.lang.String |
BILLTO_COUNTRY_CODE |
static java.lang.String |
BILLTO_FIRSTNAME |
static java.lang.String |
BILLTO_LASTNAME |
static java.lang.String |
BILLTO_MIDDLENAME |
static java.lang.String |
BILLTO_STATE |
static java.lang.String |
BILLTO_ZIPCODE |
static java.lang.String |
BUYER_LANGUAGE_ID |
static java.lang.String |
CARD_EXPIRY |
static java.lang.String |
CARD_NUMBER |
static java.lang.String |
CURRENCY_ALPHA_CODE |
static java.lang.String |
PAYMTHD_PSRVR |
static java.lang.String |
PAYMTHD_SET |
static int |
PRC_DUPLICATE_OBJECT |
static int |
SRC_CONNECTION_TO_PM_FAILED |
static int |
SRC_INITIALIZATION_MESSAGE |
static int |
SRC_ORDER |
static int |
SRC_USER_NOT_AUTHORIZED |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.payment.commands. DoPaymentMPFInternalCmd |
CC_VALID_Y_RANGE,
COPYRIGHT,
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 |
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand |
COPYRIGHT |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
DoPaymentMPFInternalCmdImpl() |
Method Summary | |
---|---|
protected
void |
checkParameters() Deprecated. Use validateParameters() instead. |
java.lang.String |
getContentType() Returns the Content Type (or MIME type) of the return data, or null if the type is not known. |
protected
java.lang.String |
getCurrencyExponent() Returns the currency exponent. |
protected
java.sql.Connection |
getDBConnection() Deprecated. |
protected
java.lang.String |
getDisplayPaymentStateForTrace(int anPaymentState) Returns the display String represnting the Payment State as returned by WebSphere Commerce Payments for Trace purposes. |
protected
java.lang.String |
getNumericCountryCode(java.lang.String productVendor,
java.lang.String country) Returns the numeric country/region code for the specified country/region as specified by the product/vendor in the Country Code Table (COUNTCODE). |
protected
java.lang.String |
getNumericCurrencyCode() |
protected
OrderAccessBean |
getOrderAccessBean() This method will first check if the local variable is set or not. |
protected
java.lang.Long |
getOrderId() |
java.lang.String |
getOrderState() 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() |
protected
java.lang.Integer |
getPaymentMethodId() |
protected
java.math.BigInteger |
getPMTotalAmount() |
protected
java.lang.String |
getProfileName() |
byte[] |
getReturnData() Returns the byte Array containing Return Data from WebSphere Commerce Payments. |
protected
java.math.BigDecimal |
getTotalAmount() |
boolean |
isReadyToCallExecute() This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command. |
void |
performExecute() Performs the main business logic of the command. |
java.util.Hashtable |
query(java.lang.String queryString) The Cashier calls this method to construct a Hashtable of keywords and values which result from processing the input query string. |
void |
reset() Resets the instance variables of the command. |
protected
void |
setContentType(java.lang.String sContentType) |
protected
void |
setCurrencyExponent(java.lang.String astrCurrencyExponent) |
protected
void |
setNumericCurrencyCode(java.lang.String astrCurrencyCode) |
protected
void |
setOrderAccessBean(
OrderAccessBean abOrder) |
void |
setOrderId(java.lang.Long orderId) Sets the orderId property of the command. |
protected
void |
setOrderState(java.lang.String orderState) Sets the Order State. |
void |
setPaymentAttributes(
TypedProperty paymentAttributes) Sets the paymentAttributes property of the command. |
void |
setPaymentMethodId(java.lang.Integer nPayMthdId) Sets the payment method ID to be used. |
protected
void |
setPMTotalAmount(java.math.BigInteger biPMTotalAmount) Sets the total amount normalized for input to WebSphere Commerce Payments. |
protected
void |
setProfileName(java.lang.String strProfileName) |
protected
void |
setReturnData(byte[] ba) |
void |
setTotalAmount(java.math.BigDecimal totalAmount) Sets the totalAmount property of the command. |
protected
void |
setupNumericCurrencyCodeAndPMTotalAmount() This method retrieves the numeric currency code from the SETCURR Table and converts the totalAmount to a normalized form required for input to WebSphere Commerce Payments. |
protected
void |
setupProfileName(java.lang.Integer nStoreId,
java.lang.Integer nPayMthdId) |
protected
void |
updateOrderPaymentMethod() |
protected
void |
updatePaymentStatus() |
void |
validateParameters() Checks the validity of customer-supplied parameters. |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Field Detail |
---|
public static final int PRC_DUPLICATE_OBJECT
public static final int SRC_INITIALIZATION_MESSAGE
public static final int SRC_ORDER
public static final int SRC_CONNECTION_TO_PM_FAILED
public static final int SRC_USER_NOT_AUTHORIZED
public static final java.lang.String PAYMTHD_SET
public static final java.lang.String PAYMTHD_PSRVR
public static final java.lang.String BILLTO_FIRSTNAME
public static final java.lang.String BILLTO_MIDDLENAME
public static final java.lang.String BILLTO_LASTNAME
public static final java.lang.String BILLTO_ADDRESS1
public static final java.lang.String BILLTO_CITY
public static final java.lang.String BILLTO_STATE
public static final java.lang.String BILLTO_ZIPCODE
public static final java.lang.String BILLTO_COUNTRY
public static final java.lang.String BILLTO_COUNTRY_CODE
public static final java.lang.String CARD_NUMBER
public static final java.lang.String CARD_EXPIRY
public static final java.lang.String CURRENCY_ALPHA_CODE
public static final java.lang.String BUYER_LANGUAGE_ID
Constructor Detail |
---|
public DoPaymentMPFInternalCmdImpl()
Method Detail |
---|
protected void checkParameters() throws ECException
checkParameters
in class
AbstractECTargetableCommand
ECException.
ECException
public java.lang.String getContentType()
null
if the type is not known.
getContentType
in interface
DoPaymentMPFInternalCmd
String
containing the name of the MIME type of the return
data, or null if the type is not knownprotected java.lang.String getCurrencyExponent()
protected java.sql.Connection getDBConnection() throws java.sql.SQLException, ECException
java.sql.SQLException
ECException
protected java.lang.String getDisplayPaymentStateForTrace(int anPaymentState)
anPaymentState
- the numeric payment state from WebSphere
Commerce Payments.protected java.lang.String getNumericCountryCode(java.lang.String productVendor, java.lang.String country) throws ECException
ECException
protected java.lang.String getNumericCurrencyCode()
protected OrderAccessBean getOrderAccessBean()
protected java.lang.Long getOrderId()
public java.lang.String getOrderState()
getOrderState
in interface
DoPaymentMPFInternalCmd
protected TypedProperty getPaymentAttributes()
protected java.lang.Integer getPaymentMethodId()
protected java.math.BigInteger getPMTotalAmount()
protected java.lang.String getProfileName()
public byte[] getReturnData()
getReturnData
in interface
DoPaymentMPFInternalCmd
protected java.math.BigDecimal getTotalAmount()
public boolean isReadyToCallExecute()
isReadyToCallExecute
in class
AbstractECTargetableCommand
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
public java.util.Hashtable query(java.lang.String queryString) throws CashierException
This method is defined by the com.ibm.etill.cashier.Queryable interface.
queryString
- a SelectStatement element from a Cashier
profileCashierException
- if there is an error creating and
populating the result Hashtable.public void reset()
This is useful if the command instance is to be called multiple times with different command parameters.
reset
in class
AbstractECTargetableCommand
protected void setContentType(java.lang.String sContentType)
protected void setCurrencyExponent(java.lang.String astrCurrencyExponent)
protected void setNumericCurrencyCode(java.lang.String astrCurrencyCode)
protected void setOrderAccessBean(OrderAccessBean abOrder)
public void setOrderId(java.lang.Long orderId)
setOrderId
in interface
DoPaymentMPFInternalCmd
orderId
- the order reference number of the Order for which
payment is to be processed.protected void setOrderState(java.lang.String orderState)
orderState
- the single-character state
value.public void setPaymentAttributes(TypedProperty paymentAttributes)
setPaymentAttributes
in interface
DoPaymentMPFInternalCmd
paymentAttributes
- the TypedProperty object that contains all
the command parameters to be passed to this command.
Some of the Payment Attributes that may be passed to the command are:
Keyword Value =========== ==================================== payMethodId PayMthd_Id of the Cashier Profile to use cardBrand The credit card brand. cardNumber The credit card number cardExpiryMonth The credit card exipration month cardExpiryYear The credit card exipration year $XXXXXX Protocol Data Value for $XXXXXXwhere $XXXXXX are special Protocol Data Keyword defined by the payment cassette. (The Protocol Data keywords all start with the "$" character.)
For this command, the payMethodId attribute is mandatory. The cardBrand and cardNumber attributes, if specified, must both be present. Same is true for the cardExpiryMonth and the cardExpiryYear attributes.
Note: The cardBrand attribute must match the BrandID used to configure the Merchant Account in WebSphere Commerce Payments. The BrandID is case-sensitive.
public void setPaymentMethodId(java.lang.Integer nPayMthdId)
nPayMthdId
- the numeric ID of the payment method to be
used.protected void setPMTotalAmount(java.math.BigInteger biPMTotalAmount)
The normalized amount is the amount converted to the smallest denomination for the currency. For example, if the total amount is US $10.95, PMTotalAmount is 1095 in cents, which is the lowest denomination for this currency. If there is no smaller denomination other than the main currency unit for the currency, the normalized amount is the same as the totalAmount.
biPMTotalAmount
- the total amount in the smallest
denomination for the currency.protected void setProfileName(java.lang.String strProfileName)
protected void setReturnData(byte[] ba)
public void setTotalAmount(java.math.BigDecimal totalAmount)
setTotalAmount
in interface
DoPaymentMPFInternalCmd
totalAmount
- the total price of the Order for which payment
is to be processed.protected void setupNumericCurrencyCodeAndPMTotalAmount() throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException, ECException
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
ECException
protected void setupProfileName(java.lang.Integer nStoreId, java.lang.Integer nPayMthdId) throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException, ECException
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
ECException
protected void updateOrderPaymentMethod() throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
protected void updatePaymentStatus() throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException