com.ibm.commerce.payment.commands
Class DoPaymentCLCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.command.BusinessPolicyCommandImpl
                          |
                          +--com.ibm.commerce.payment.commands.DoPaymentCLCmdImpl
All Implemented Interfaces:
BusinessPolicyCommand, DoPaymentPolicyCmd, ECCommand, ECTargetableCommand, TaskCommand

public class DoPaymentCLCmdImpl
extends BusinessPolicyCommandImpl
implements DoPaymentPolicyCmd

This DoPaymentPolicy business policy command implementation class is the default implementation class for authorizing payment that specify the "Credit" Payment Policy. Parameter:

Parameter Name Type Descriptions
abOrder OrderAccessBean The Order ID of the Order
bdTotalAmount BigDecimal The Total Amount to be authorized
nPolicyId Long The ID of the Payment Policy to use for the Purchase.
nBuyerPOId Long Optional buyerPOId
errorViewName String Optional error view name passed in by the Caller.

Behavior: Returned Parameters: Default Error View Name: ErrorCodes:
See Also:
Serialized Form

Field Summary
 
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. DoPaymentPolicyCmd
CC_VALID_Y_RANGE, COPYRIGHT, defaultCommandClassName, 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
DoPaymentCLCmdImpl()
           
 
Method Summary
protected   AccountAccessBean getAccount()
          Returns the AccountAccessBean representing the Account associated with the order.
protected  java.lang.Long getAccountId()
          Returns the account ID of the Account associated with the order.
protected  java.lang.Long getBuyerPOId()
          Returns the internal ID of the BuyerPO record if a buyer purchase order number is specified.
 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.Long getCreditLineId()
          Returns the internal ID of the CreditLine record representing the credit line the account holder (buyer organization) has with the seller.
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 being processed.
 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()
          Returns the TypedProperty object containing the payment attributes passed to this command by the calling command.
 byte[] getReturnData()
          Returns the byte Array containing Return Data from the Payment System.
protected  java.math.BigDecimal getTotalAmount()
          Returns the total order amount passed to the command by the caller.
 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.
 void reset()
          Resets the instance variables of the command.
 void setAccount( AccountAccessBean abAccount)
          Sets the account property of the command.
 void setBuyerPOId(java.lang.Long n)
          Sets the optional buyerPOId if the customer (buyer) had specified a buyer purchase order number.
protected  void setCreditLineId(java.lang.Long n)
          Sets the internal ID of the CreditLine record representing the credit line the account holder (buyer organization) has with the seller.
 void setErrorViewName(java.lang.String sEVN)
          Sets the error view to be used to report error.
 void setOrder( OrderAccessBean ab)
          Sets the order property of the command.
 void setOrderState(java.lang.String s)
          Sets the order state to be returned to the caller.
 void setPaymentAttributes( TypedProperty paymentAttributes)
          Sets the paymentAttributes property of the command.
 void setTotalAmount(java.math.BigDecimal totalAmount)
          Sets the totalAmount property of the command.
protected  void updateOrderPaymentMethod()
          This is called by performExecute to update the ORDPAYMTHD table.
 
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
 

Constructor Detail

DoPaymentCLCmdImpl

public DoPaymentCLCmdImpl()
Method Detail

getAccount

protected AccountAccessBean getAccount()
Returns the AccountAccessBean representing the Account associated with the order.
Returns:
the AccountAccessBean

getAccountId

protected java.lang.Long getAccountId()
                               throws javax.ejb.CreateException,
                                      javax.ejb.FinderException,
                                      javax.naming.NamingException,
                                      java.rmi.RemoteException
Returns the account ID of the Account associated with the order.
Returns:
the account ID
Throws:
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException

getBuyerPOId

protected java.lang.Long getBuyerPOId()
Returns the internal ID of the BuyerPO record if a buyer purchase order number is specified. Otherwise returns a null.
Returns:
the internal ID of the BuyerPO record or null

getContentType

public java.lang.String getContentType()
Returns the Content Type (or MIME type) of the return data, or null if the type is not known.
Specified by:
getContentType in interface DoPaymentPolicyCmd
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 returns null.

getCreditLineId

protected java.lang.Long getCreditLineId()
Returns the internal ID of the CreditLine record representing the credit line the account holder (buyer organization) has with the seller.
Returns:
the internal ID of the CreditLine record

getErrorViewName

protected java.lang.String getErrorViewName()
Returns the name of the error view to use for reporting error.
Returns:
the error view name

getOrder

protected OrderAccessBean getOrder()
Returns the OrderAccessBean representing the order being processed.
Returns:
the OrderAccessBean.

getOrderState

public 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. If the returned String is empty or null, the Calling command will decide the value to use for the Status
Specified by:
getOrderState in interface DoPaymentPolicyCmd
Returns:
the preferred order state

getPaymentAttributes

protected TypedProperty getPaymentAttributes()
Returns the TypedProperty object containing the payment attributes passed to this command by the calling command.
Returns:
the payment attributes

getReturnData

public byte[] getReturnData()
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 interface DoPaymentPolicyCmd
Returns:
null

getTotalAmount

protected java.math.BigDecimal getTotalAmount()
Returns the total order amount passed to the command by the caller.
Returns:
the total order amount in the currency of the order

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.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true if we can execute the command; false otherwise.

performExecute

public void performExecute()
                    throws ECException
Performs the main business logic of the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

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.

Overrides:
reset in class AbstractECTargetableCommand

setAccount

public void setAccount(AccountAccessBean abAccount)
Sets the account property of the command.
Specified by:
setAccount in interface DoPaymentPolicyCmd
Parameters:
abAccount - the AccountAccessBean representing the account the order is associated with

setBuyerPOId

public void setBuyerPOId(java.lang.Long n)
Sets the optional buyerPOId if the customer (buyer) had specified a buyer purchase order number.
Specified by:
setBuyerPOId in interface DoPaymentPolicyCmd
Parameters:
n - the internal ID of the BuyerPO record representing the purchase order number specified

setCreditLineId

protected void setCreditLineId(java.lang.Long n)
Sets the internal ID of the CreditLine record representing the credit line the account holder (buyer organization) has with the seller.
Parameters:
n - the internal ID of the CreditLine record

setErrorViewName

public void setErrorViewName(java.lang.String sEVN)
Sets the error view to be used to report error. This overrides the default error view of the command.
Specified by:
setErrorViewName in interface DoPaymentPolicyCmd
Parameters:
sEVN - the Error View name
See Also:
ERRTASK_NAME

setOrder

public void setOrder(OrderAccessBean ab)
Sets the order property of the command.
Specified by:
setOrder in interface DoPaymentPolicyCmd
Parameters:
ab - the OrderAccessBean representing the order for which payment is to be processed

setOrderState

public void setOrderState(java.lang.String s)
Sets the order state to be returned to the caller. This is the order state that the command would like the order to be moved to. It is up to the caller of this command to change the order status accordingly.

setPaymentAttributes

public void setPaymentAttributes(TypedProperty paymentAttributes)
Sets the paymentAttributes property of the command.
Specified by:
setPaymentAttributes in interface DoPaymentPolicyCmd
Parameters:
paymentAttributes - the TypedProperty object that contains all the command parameters to be passed to this command.

setTotalAmount

public void setTotalAmount(java.math.BigDecimal totalAmount)
Sets the totalAmount property of the command.
Specified by:
setTotalAmount in interface DoPaymentPolicyCmd
Parameters:
totalAmount - the total price of the Order for which payment is to be processed.

updateOrderPaymentMethod

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