java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.command.BusinessPolicyCommandImpl | +--com.ibm.commerce.payment.commands.DoDepositPMCmdImpl
This
DoPaymentPolicyPolicy
business policy command implementation
class is the default implementation class for depositing payment previously
authorized through WebSphere Commerce Payments.
Parameters:
Parameter Name | Type | Descriptions |
order | OrderAccessBean | The Order Access Bean |
depositAmount | BigDecimal | The amount of the deposit |
errorViewName | String | Optional error view name passed in by the Caller. |
Behavior:
Default Error View Name:
ErrorCodes:
PaymentConstants.ERR_CODE_PM_COMM_ERR
(1950) - Communication
to Payment System failed. (Connection to WebSphere Commerce Payments
Failed.)PaymentConstants.ERR_CODE_ORDER_UNKNOWN
(1951) - Order is not
known to the Payment System (Order does not exist as a WebSphere Commerce
Payments Order.)PaymentConstants.ERR_CODE_PM_REJECTED
(1952) - Payment System
rejected the command due to error. (WebSphere Commerce Payments Operation
"p" for StoreId "s" OrderId "m" failed. WebSphere
Commerce Payments PrimaryRC=x, SecondaryRC=y.)This command uses the following AccessBeans:
CurrencyAccessBean
OrderAccessBean
OrderPaymentMethodAccessBean
PaymentJDBCHelperAccessBean
StoreAccessBean
UserAccessBean
This command does not call other TaskCommand.
Field Summary | |
---|---|
static java.lang.String |
PAYMENT_NUMBER |
Fields inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
policyId,
requestProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.payment.commands. DoDepositPolicyCmd |
COPYRIGHT,
defaultCommandClassName,
ERRTASK_NAME,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand |
COPYRIGHT |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
DoDepositPMCmdImpl() |
Method Summary | |
---|---|
protected
void |
convertAmountToStoreDefaultCurrency(java.lang.Long nOrderId) Converts the Deposit Amount in the currency of the order to the default currency of the Store. |
protected
java.lang.String |
getBuyerLanguageId() Get the Language ID of the Buyer. |
protected
java.math.BigDecimal |
getChargeAmount() Returns the Charge Amount. |
protected
java.lang.String |
getCurrencyExponent() Returns the currency exponent. |
protected
java.lang.Double |
getCurrencyFactor() Deprecated. |
java.math.BigDecimal |
getDepositAmount() Gets the depositAmount property of the command. |
protected
java.lang.String |
getErrorViewName() Returns the name of the error view to use for reporting error. |
protected
OrderAccessBean |
getOrder() Returns the OrderAccessBean representing the order whose payment is to be deposited. |
protected
java.lang.String |
getStoreDefaultCurrency() Returns the default currency of the Store. |
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 resulted from processing the input query string against the Commerce Database. |
void |
reset() Resets the instance variables of the command. |
protected
void |
setChargeAmount(java.math.BigDecimal n) Sets the Charge Amount. |
protected
void |
setCurrencyExponent(java.lang.String astrCurrencyExponent) Sets Currency Exponent. |
protected
void |
setCurrencyFactor(java.lang.Double d) Deprecated. |
void |
setDepositAmount(java.math.BigDecimal depositAmount) Sets the depositAmount property of the command. |
void |
setErrorViewName(java.lang.String sEVN) Sets the error view to be used to report error. |
protected
void |
setNumericCurrencyCode(java.lang.String astrCurrencyCode) Sets the numeric currency code |
void |
setOrder(
OrderAccessBean ab) Sets the order property of the command. |
protected
void |
setPMDepositAmount(java.math.BigInteger depositAmount) Sets the deposit amount normalized for input to WebSphere Commerce Payments. |
protected
void |
setStoreDefaultCurrency(java.lang.String s) Sets the Store Default Currency |
protected
void |
setupNumericCurrencyCodeAndPMDepositAmount() This method retrieves the numeric currency code from the SETCURR Table and converts the deposit amount to a normalized form required for input to WebSphere Commerce Payments. |
protected
void |
updateOrderPaymentMethod() Updates ORDPAYMTHD table with deposit info for the order. |
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties,
validateParameters |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
Field Detail |
---|
public static final java.lang.String PAYMENT_NUMBER
Constructor Detail |
---|
public DoDepositPMCmdImpl()
Method Detail |
---|
protected void convertAmountToStoreDefaultCurrency(java.lang.Long nOrderId) throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException, ECException
nOrderId
- the ID of the Order whose payment is to be
depositedjavax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
ECException
protected java.lang.String getBuyerLanguageId() throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
This method may return null if the memberId is not a UserId or an empty String if the user has no preferred language.
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
protected java.math.BigDecimal getChargeAmount()
The Charge Amount is the Deposit Amount converted to the default currency of the Store. If the default currency of the Store is the same as the currency of the order, then the Charge Amount is the same as the Deposit Amount.
protected java.lang.String getCurrencyExponent()
protected java.lang.Double getCurrencyFactor()
Currency factor is the multiplication factor that could be used to convert a currency amount to its lowest denomination. For example, the currency factor for US Dollar is 100. To convert US $5.00 to cents, multiply the currency amount by the currency factor of 100. You get 500 cents.
public java.math.BigDecimal getDepositAmount()
protected java.lang.String getErrorViewName()
protected OrderAccessBean getOrder()
protected java.lang.String getStoreDefaultCurrency()
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
- an SQL Select statement 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 setChargeAmount(java.math.BigDecimal n)
The Charge Amount is the Deposit Amount converted to the default currency of the Store. If the default currency of the Store is the same as the currency of the order, then the Charge Amount is the same as the Deposit Amount.
n
- the amount to be deposited converted to the default
currency of the Storeprotected void setCurrencyExponent(java.lang.String astrCurrencyExponent)
astrCurrencyExponent
- the currency exponent of the currency
used for the orderprotected void setCurrencyFactor(java.lang.Double d)
Currency factor is the multiplication factor that could be used to convert a currency amount to its lowest denomination. For example, the currency factor for US Dollar is 100. To convert US $5.00 to cents, multiply the currency amount by the currency factor of 100. You get 500 cents.
d
- the currency factor for the currency used for the
orderpublic void setDepositAmount(java.math.BigDecimal depositAmount)
setDepositAmount
in interface
DoDepositPolicyCmd
depositAmount
- the amount to be
deposited.public void setErrorViewName(java.lang.String sEVN)
setErrorViewName
in interface
DoDepositPolicyCmd
sEVN
- the Error View nameDoDepositPolicyCmd.ERRTASK_NAME
protected void setNumericCurrencyCode(java.lang.String astrCurrencyCode)
astrCurrencyCode
- the currency code of the currency used for
the orderpublic void setOrder(OrderAccessBean ab)
setOrder
in interface
DoDepositPolicyCmd
ab
- the OrderAccessBean of the Order whose payment is to be
depositedprotected void setPMDepositAmount(java.math.BigInteger depositAmount)
The normalized amount is the amount converted to the smallest denomination for the currency. For example, if the total amount is US $10.95, PMDepositAmount 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 depositAmount.
depositAmount
- the deposit amount normalized for WebSphere
Commerce Paymentsprotected void setStoreDefaultCurrency(java.lang.String s)
s
- the alpha currency code representing the default currency
of the Storeprotected void setupNumericCurrencyCodeAndPMDepositAmount() throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException, ECException
For example, if the amount is US $10.95, the normalized amount is 1095 in cents, which is the lowest denomination for this currency.
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