com.ibm.commerce.payment.commands
Class DoDepositPMCmdImpl

com.ibm.commerce.payment.commands.DoDepositPMCmdImpl
All Implemented Interfaces:
BusinessPolicyCommand, DoDepositPolicyCmd, ECCommand, TaskCommand

public class DoDepositPMCmdImpl
implements DoDepositPolicyCmd

This CheckPaymentAcceptPolicy business policy command implementation class is the default implementation class for depositing the payment previously authorized by WebSphere Payment Manager.

Parameter:
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:

Error View Name: ErrorCodes:


Field Summary
static java.lang.String PAYMENT_NUMBER
           
 
Fields inherited from interface com.ibm.commerce.payment.commands.DoDepositPolicyCmd
COPYRIGHT, defaultCommandClassName, ERRTASK_NAME, NAME
 
Constructor Summary
DoDepositPMCmdImpl()
           
 
Method Summary
protected  void convertAmountToStoreDefaultCurrency(java.lang.Long nOrderId)
          This is called by performExecute to convert the Amount to the Store Default Currency
protected  java.lang.String getBuyerLanguageId()
          Get the LanguageId of the Buyer.
protected  java.math.BigDecimal getChargeAmount()
          Retrieve Charge Amount
protected  java.lang.Double getCurrencyFactor()
          Retrieve Currency Factor
 java.math.BigDecimal getDepositAmount()
          Retrieve Deposit Amount
protected  java.lang.String getErrorViewName()
          Retrieve the error view name passed in by the Caller.
protected  OrderAccessBean getOrder()
          Retrieve Order
protected  java.lang.String getStoreDefaultCurrency()
          Retrieve Store Default Currency
 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 setChargeAmount(java.math.BigDecimal n)
          Set Charge Amount
protected  void setCurrencyExponent(java.lang.String astrCurrencyExponent)
          Store Currency Exponent
protected  void setCurrencyFactor(java.lang.Double d)
          Store Currency Factor
 void setDepositAmount(java.math.BigDecimal depositAmount)
          Sets the depositAmount property of the command.
 void setErrorViewName(java.lang.String sEVN)
          Optional error view name passed in by the Caller.
protected  void setNumericCurrencyCode(java.lang.String astrCurrencyCode)
          Set Numeric Currency Code
 void setOrder(OrderAccessBean ab)
          The order to be deposited.
protected  void setPMDepositAmount(java.math.BigInteger depositAmount)
          Set Deposit Amount for WebSphere Payment Manager
protected  void setStoreDefaultCurrency(java.lang.String s)
          Set Store Default Currency
protected  void setupNumericCurrencyCodeAndPMDepositAmount()
          This is called by performExecute to retrieve WebSphere Payment Manager ready amount
protected  void updateOrderPaymentMethod()
          This is called by performExecute to update ORDPAYMTHD table with deposit info
 
Methods inherited from interface com.ibm.commerce.command.BusinessPolicyCommand
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 

Field Detail

PAYMENT_NUMBER

public static final java.lang.String PAYMENT_NUMBER
Constructor Detail

DoDepositPMCmdImpl

public DoDepositPMCmdImpl()
Method Detail

convertAmountToStoreDefaultCurrency

protected void convertAmountToStoreDefaultCurrency(java.lang.Long nOrderId)
                                            throws javax.ejb.CreateException,
                                                   javax.ejb.FinderException,
                                                   javax.naming.NamingException,
                                                   java.rmi.RemoteException,
                                                   ECException
This is called by performExecute to convert the Amount to the Store Default Currency

getBuyerLanguageId

protected java.lang.String getBuyerLanguageId()
                                       throws javax.ejb.CreateException,
                                              javax.ejb.FinderException,
                                              javax.naming.NamingException,
                                              java.rmi.RemoteException
Get the LanguageId of the Buyer. May return null if the memberId is not a UserId or an empty String if the user has no preferred language.
Returns:
java.lang.String

getChargeAmount

protected java.math.BigDecimal getChargeAmount()
Retrieve Charge Amount

getCurrencyFactor

protected java.lang.Double getCurrencyFactor()
Retrieve Currency Factor

getDepositAmount

public java.math.BigDecimal getDepositAmount()
Retrieve Deposit Amount

getErrorViewName

protected java.lang.String getErrorViewName()
Retrieve the error view name passed in by the Caller.

getOrder

protected OrderAccessBean getOrder()
Retrieve Order

getStoreDefaultCurrency

protected java.lang.String getStoreDefaultCurrency()
Retrieve Store Default Currency

isReadyToCallExecute

public boolean isReadyToCallExecute()
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.

performExecute

public void performExecute()
                    throws ECException
Performs the main business logic of the command.
Specified by:
performExecute in interface ECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

query

public java.util.Hashtable query(java.lang.String queryString)
                          throws com.ibm.commerce.payment.commands.CashierException
The Cashier calls this method to construct a Hashtable of keywords and values which result from processing the input query string.

This method is defined by the com.ibm.etill.cashier.Queryable interface.

Parameters:
queryString - a SelectStatement element from a Cashier profile
Throws:
com.ibm.commerce.payment.commands.CashierException - if there is an error creating and populating the result Hashtable.

reset

public void reset()
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.


setChargeAmount

protected void setChargeAmount(java.math.BigDecimal n)
Set Charge Amount

setCurrencyExponent

protected void setCurrencyExponent(java.lang.String astrCurrencyExponent)
Store Currency Exponent

setCurrencyFactor

protected void setCurrencyFactor(java.lang.Double d)
Store Currency Factor

setDepositAmount

public void setDepositAmount(java.math.BigDecimal depositAmount)
Description copied from interface: DoDepositPolicyCmd
Sets the depositAmount property of the command.
Specified by:
setDepositAmount in interface DoDepositPolicyCmd
Following copied from interface: com.ibm.commerce.payment.commands.DoDepositPolicyCmd
Parameters:
depositAmount - the amount to be deposited.

setErrorViewName

public void setErrorViewName(java.lang.String sEVN)
Optional error view name passed in by the Caller.
Specified by:
setErrorViewName in interface DoDepositPolicyCmd

setNumericCurrencyCode

protected void setNumericCurrencyCode(java.lang.String astrCurrencyCode)
Set Numeric Currency Code

setOrder

public void setOrder(OrderAccessBean ab)
The order to be deposited.
Specified by:
setOrder in interface DoDepositPolicyCmd
Following copied from interface: com.ibm.commerce.payment.commands.DoDepositPolicyCmd
Parameters:
abOrder - the OrderAccessBean of the Order for which is going to be deposited.

setPMDepositAmount

protected void setPMDepositAmount(java.math.BigInteger depositAmount)
Set Deposit Amount for WebSphere Payment Manager

setStoreDefaultCurrency

protected void setStoreDefaultCurrency(java.lang.String s)
Set Store Default Currency

setupNumericCurrencyCodeAndPMDepositAmount

protected void setupNumericCurrencyCodeAndPMDepositAmount()
                                                   throws javax.ejb.CreateException,
                                                          javax.ejb.FinderException,
                                                          javax.naming.NamingException,
                                                          java.rmi.RemoteException,
                                                          ECException
This is called by performExecute to retrieve WebSphere Payment Manager ready amount

updateOrderPaymentMethod

protected void updateOrderPaymentMethod()
                                 throws javax.ejb.CreateException,
                                        javax.ejb.FinderException,
                                        javax.naming.NamingException,
                                        java.rmi.RemoteException
This is called by performExecute to update ORDPAYMTHD table with deposit info