com.ibm.commerce.payment.commands
Class DoPaymentPMCmdImpl

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

public class DoPaymentPMCmdImpl
extends BusinessPolicyCommandImpl
implements DoPaymentPolicyCmd, DoInventory

The DoPaymentPMCmdImpl command implements the DoPaymentPolicy business policy command, which is called by the DoPaymentMPFCmdImpl task command to process payment for an order.

The DoPaymentPMCmdImpl command passes environment variables to the Payment Cashier. The Cashier will only use the value from the environment if directed to do so by the Cashier profile specified by the DoPaymentPMCmdImpl command with the Cashier.collectPayment() call.

The following table summarizes the parameters passed to the command and environment variables that the command passes to the Payment Cashier:

 Parameter / Environment variable Description
The following parameters are mandatory parameters received by the DoPaymentPMCmdImpl command from the DoPaymentMPFCmdImpl class.
storeId The value for the store identification number
Order The OrderAccessBean representing the order.
totalAmount The amount of the order to be sent to WebSphere Commerce Payments.
The following parameters are optional parameters received by the DoPaymentPMCmdImpl command from the DoPaymentMPFCmdImpl class.
Account The Account Access Bean of the order.
BuyerPOId The value for the Buyer Purchase Order identification number
ErrorViewName The error view name passed in by the Caller.
The following parameters are optional parameters received by the DoPaymentPMCmdImpl command from the command URL. (through setting PaymentAttributes of the command)
cardExpiryMonth
cardExpiryYear
These two parameters must be specified as a pair -- If one is present, the other must also be present. Otherwise, it is an error.

cardExpiryMonth is a number representing the month of expiration for the payment card. For example, 1 for January, 2 for February, and so on.

cardExpiryYear is the year of expiration for the payment card.

DoPaymentPMCmdImpl will check if the date specified has already expired or if the date is too far in the future (more than 10 years). If the date passes these checks, DoPaymentPMCmdImpl will create a new environment variable called "card_expiry" with the value "yyyymm" from the cardExpiryYear ("yyyy") and cardExpiryMonth left-padded with "0" if the month is less than 10.

cardBrand cardNumber These two parameters must be specified as a pair -- If one is present, the other must also be present. Otherwise, it is an error.

cardBrand represents the type of payment card the customer is using. It must match the BrandID used to configure the WebSphere Commerce Payments Account for the Merchant or Store. The name is case-sensitive.

cardNumber is the payment card number, for example 4111 - 1111- 1111- 1111. Note the embedded blanks, trailing blanks and hyphens. These formats are allowed in WebSphere Commerce, but are not recognized by WebSphere Commerce Payments. DoPaymentPMCmdImpl calls the CheckCCNumberCmd task command to verify the cardNumber for the specified cardBrand. If the number passes the check, DoPaymentPMCmdImpl creates a new environment variable called card_number with all embedded and trailing blanks and embedded "-" removed. The WebSphere Commerce-supplied Cashier profile specifies the card_number environment variable as a value for the WebSphere Commerce Payments "$PAN" parameter which is the WebSphere Commerce Payments parameter name for credit card number and does not allow non-numeric characters.

The following variables are environment variables that are always passed by DoPaymentPMCmdImpl to the Cashier.
storeId The store ID from the storeId parameter above.
orderId The order ID from the Order parameter above.
WebPath The WebSphere Commerce application server web path. (For example,  /webapp/wcs/stores/servlet
WCSHostName The domain-qualified host name of the WebSphere Commerce web server.
WCSWebServerPort The WebSphere Commerce web server port. Generally port 80.
CommandContext Reference to the CommandContext of the command. This is needed if the Cashier Extension needs to call a task command. The CommandContext has many useful methods. See documentation on the CommandContext interface for detail.
buyer_language_id The language ID of the buyer from the Command Context above.
language_encoding The character encoding for the language of the buyer as specified by the entry in the LANGUAGE table for the language ID.
The following Environment variables are mandatory parameters required by WebSphere Commerce Payments for all cassettes for the Cashier.collectPayment call.
CURRENCY  A code indicating the currency AMOUNT is in. This is the numeric currency code as per ISO 4217.
AMOUNT  The total amount of the order. In the case of a backorder a padding, as specified by the BOPMPADFACTOR field in the STORE table, will be added to the total order amount in case the total amount changes later when the inventory is available. The customer will only be charged for the actual amount when the order is released.

The amount is in the currency's smallest denomination. For example, for USD (U.S. dollars), the amount would be in cents, not dollars.

The following Environment variables are used by WebSphere Commerce Payments for all cassettes if present.
AMOUNTEXP10 Amount Exponent (power of 10). The exponential value by which AMOUNT (which is the amount in the sub-unit of a country's currency) is multiplied to get the amount in the country's main currency unit (such as pesos or dollars). For example, you would multiply the amount in cents by 10 to the power "-2" to get the amount in dollars. This value is 0 for countries with no currency sub-unit.

DoPaymentPMCmdImpl always passes this to the Cashier.

PONumber The purchase order number specified by the buyer when submitting the order for processing.

DoPaymentPMCmdImpl passes this to the Cashier if it is present.

The following variables are gathered by DoPaymentPMCmdImpl command from other sources
approval_amount  The amount to be approved in the currency's smallest denomination.

The value for this variable is the same as the value for the AMOUNT variable except for the backorder case. In the event of a backorder situation, a small amount, as specified by the appropriate row in the CURFORMAT table for the store and currency, is used as the approval amount. The full amount will only be authorized when sufficient inventory can be allocated to release the backorder

billtoAddressId  The Address ID of the billto address.

This parameter is either obtained from the order or from the Payment Terms and Conditions. If the Payment Terms and Conditions used includes a billto address, that take precedence over the billto address stored in the addressId field in the Orders table. The DoPaymentPMCmdImpl command uses the information from the Address table to create several billto_xxxx environment variables to pass to the Cashier. The billto_xxx environment variables are described below.

billto_firstname billto_middlename billto_lastname billto_address1 billto_address2 billto_city billto_state billto_country billto_zipcode billto_phone_number billto_email_addr1  These variables are derived from the Address entry identified by billtoAddressId.

These environment variables are in the language entered by the shopper and may not be appropriate for use as values for the $AVS.xxxx parameters for some cassettes. For example, both the Cassette for SET and the Cassette for CyberCash allow only ASCII or English ASCII characters to be used for the $AVS.xxxx parameters and thus cannot use these environment variables unless it is verified that the variables only contain ASCII or English ASCII characters.

billto_country_code  This variable is derived using the Country Code table and the billto_country variable. Certain payment cassette may require this for Address Verification Service (AVS).

If no Country Code entry can be found for the country, a code of "999" will be passed as the value for the billto_country_code environment variable. The country codes are the numeric country codes specified by ISO 3166-1. The numeric codes are maintained by the United Nations Statistics Division in New York. See http://www.un.org/Depts/unsd/methods/m49alpha.htm for the current list.

If the Cashier profile uses billto_country_code you should not allow the customer to enter the country name in a bill-to address form in free-form text. That may result in the server not being able to find an exact match for the country in the country code table. Instead, use a dropdown list of country names for the customer to select as input for the country.

card_number This is derived from the cardNumber variable described above.
card_expiry This is derived from the cardExpiryMonth and the cardExpiryYear variables described above.
currency_alpha_code This currency alpha code is obtained from the Orders table.

Behavior

Returned Parameters:

Default Error View Name:

ErrorCodes:

This command uses the following AccessBeans:

This command calls the following TaskCommands:

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
DoPaymentPMCmdImpl()
           
 
Method Summary
protected  void checkParameters()
          Deprecated. Use validateParameters() instead.
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.String getCurrencyExponent()
          Returns the currency exponent.
protected  java.lang.Double getCurrencyFactor()
          Deprecated.  
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 getErrorViewName()
          Returns the name of the error view to use for reporting error.
static java.lang.String getNiceBytes(byte[] bytes)
           
static java.lang.String getNiceBytes(java.lang.String s)
           
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()
          Returns the numeric currency code.
protected  OrderAccessBean getOrder()
          Returns the OrderAccessBean representing the Order being processed.
 java.lang.String getOrderState()
          Returns the single character String value that this 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.
protected  java.math.BigInteger getPMTotalAmount()
          Returns the total amount normalized for WebSphere Commerce Payments.
protected  java.lang.String getPONumber()
          Returns the PONumber attribute passed to the command by the calling command.
protected  java.lang.String getProfileName()
          Returns the profileName attribute passed to the command by the calling command.
 byte[] getReturnData()
          Returns the byte Array containing Return Data from WebSphere Commerce Payments.
protected  java.math.BigDecimal getTotalAmount()
          Returns the totalAmount attribute passed to the command by the calling command.
 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.
 void setAccount( AccountAccessBean abAccount)
          Sets the account property of the command.
 void setBuyerPOId(java.lang.Long n)
          Sets optional buyerPOId if the customer (buyer) had specified a buyer purchase order number.
protected  void setContentType(java.lang.String sContentType)
          Sets Content Type (or MIME type) of the returned data.
protected  void setCurrencyExponent(java.lang.String astrCurrencyExponent)
          Sets Currency Exponent.
protected  void setCurrencyFactor(java.lang.Double d)
          Deprecated.  
 void setErrorViewName(java.lang.String sEVN)
          Sets the error view to be used to report error.
protected  void setNumericCurrencyCode(java.lang.String astrCurrencyCode)
          Sets Numeric Currency Code.
 void setOrder( OrderAccessBean ab)
          Sets the order property of the command.
protected  void setOrderState(java.lang.String orderState)
          Sets the order state to be returned to the caller.
 void setPaymentAttributes( TypedProperty paymentAttributes)
          Sets the paymentAttributes property of the command.
protected  void setPMTotalAmount(java.math.BigInteger biPMTotalAmount)
          Sets the total amount normalized for input to WebSphere Commerce Payments.
protected  void setPONumber(java.lang.String sPONumber)
          Sets the Purchase Order Number attribute.
protected  void setProfileName(java.lang.String s)
          Sets the Profile Name attribute.
protected  void setReturnData(byte[] ba)
          Sets the Return Data to be returned to the caller.
 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 into a normalized form required for input to WebSphere Commerce Payments.
protected  void updateOrderPaymentMethod()
          This method is called by performExecute to create a new ORDPAYMTHD row with payment info.
 void validateParameters()
          Checks the validity of customer-supplied parameters.
 
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
 
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
 
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
 

Constructor Detail

DoPaymentPMCmdImpl

public DoPaymentPMCmdImpl()
Method Detail

checkParameters

protected void checkParameters()
                        throws ECException
Deprecated. Use validateParameters() instead.
Checks the validity of customer-supplied parameters.
Overrides:
checkParameters in class AbstractECTargetableCommand
Throws:
ECException.
ECException

getAccount

protected AccountAccessBean getAccount()
Returns the AccountAccessBean representing the Account associated with the order. If the order has no associated Account, a null is returned.
Returns:
the AccountAccessBean or null

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. If the order has no associated Account, a null is returned.
Returns:
the account ID or null
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

getCurrencyExponent

protected java.lang.String getCurrencyExponent()
Returns the currency exponent.
Returns:
the currency exponent for the currency of the order

getCurrencyFactor

protected java.lang.Double getCurrencyFactor()
Deprecated.  
Returns the currency factor.

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.

Returns:
the currency factor for the currency of the order

getDBConnection

protected java.sql.Connection getDBConnection()
                                       throws java.sql.SQLException,
ECException
Deprecated.  
Returns the connection to WebSphere Commerce database. The user is responsible to close the connection after use.
Returns:
the database connection to the WebSphere Commerce database
Throws:
java.sql.SQLException
ECException

getDisplayPaymentStateForTrace

protected java.lang.String getDisplayPaymentStateForTrace(int anPaymentState)
Returns the display String represnting the Payment State as returned by WebSphere Commerce Payments for Trace purposes.
Parameters:
anPaymentState - the numeric payment state from WebSphere Commerce Payments.
Returns:
the display String for the specified payment state.

getErrorViewName

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

getNumericCountryCode

protected java.lang.String getNumericCountryCode(java.lang.String productVendor,
                                                 java.lang.String country)
                                          throws ECException
Returns the numeric country/region code for the specified country/region as specified by the product/vendor in the Country Code Table (COUNTCODE).
Parameters:
productVendor - the product/vendor character-code used for the query
country - the country/region name used for the query
Returns:
the String representation of the numeric country/region code.
Throws:
ECException

getNumericCurrencyCode

protected java.lang.String getNumericCurrencyCode()
Returns the numeric currency code.
Returns:
the String representation of the numeric currency code.

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 this command wants the Calling command to use to set the Status of the order. If the returned String is 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

getPMTotalAmount

protected java.math.BigInteger getPMTotalAmount()
Returns the total amount normalized for WebSphere Commerce Payments.
Returns:
the normalized total amount
See Also:
setPMTotalAmount

getPONumber

protected java.lang.String getPONumber()
Returns the PONumber attribute passed to the command by the calling command.
Returns:
the PONumber attribute value
See Also:

getProfileName

protected java.lang.String getProfileName()
Returns the profileName attribute passed to the command by the calling command.
Returns:
the profileName attribute value
See Also:
setPaymentAttributes

getReturnData

public byte[] getReturnData()
Returns the byte Array containing Return Data from WebSphere Commerce Payments. This method returns a zero length byte array if there is no return data from WebSphere Commerce Payments.
Specified by:
getReturnData in interface DoPaymentPolicyCmd
Returns:
the byte Array containing Return Data from WebSphere Commerce Payments

getTotalAmount

protected java.math.BigDecimal getTotalAmount()
Returns the totalAmount attribute passed to the command by the calling command.
Returns:
the total amount of the order 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

getNiceBytes

public static java.lang.String getNiceBytes(java.lang.String s)

getNiceBytes

public static java.lang.String getNiceBytes(byte[] bytes)

query

public java.util.Hashtable query(java.lang.String queryString)
                          throws 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 query string in the form of an SQL Select statement from a Cashier profile
Returns:
a Hashtable with columnName as key and List of Strings as values from the result of the given query.
Throws:
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.

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

setContentType

protected void setContentType(java.lang.String sContentType)
Sets Content Type (or MIME type) of the returned data.
Parameters:
sContentType - the Content Type of the returned data.

setCurrencyExponent

protected void setCurrencyExponent(java.lang.String astrCurrencyExponent)
Sets Currency Exponent.
Parameters:
astrCurrencyExponent - the currency exponent of the currency used for the order

setCurrencyFactor

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

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.

Parameters:
d - the currency factor for the currency used for the order

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

setNumericCurrencyCode

protected void setNumericCurrencyCode(java.lang.String astrCurrencyCode)
Sets Numeric Currency Code.
Parameters:
astrCurrencyCode - the currency code of the currency used for the order

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

protected void setOrderState(java.lang.String orderState)
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.
Parameters:
orderState - a String representing the preferred order state

setPaymentAttributes

public void setPaymentAttributes(TypedProperty paymentAttributes)
Sets the paymentAttributes property of the command.

Some of the Payment Attributes that may be passed to the command are:

       Keyword                         Value
     ===========        ====================================
     PONumber           The purchase order number
     profileName        The name 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   

For this command implementation, the profileName attribute is mandatory. This parameter normally comes from the properties field of the Policy Table entry for the payment policy used. This is the short name of the file on the file system without the .profile extension.

The cardBrand and cardNumber attributes, if specified, must both be present. Same is true for the cardExpiryMonth and the cardExpiryYear attributes.

The cardBrand attribute must match the BrandID used to configure the Merchant Account in WebSphere Commerce Payments. The BrandID is case-sensitive.

The PONumber attribute is required if the Account associated with the trading agreements used for the order includes a Purchase Order Terms and Conditions.

Specified by:
setPaymentAttributes in interface DoPaymentPolicyCmd
Parameters:
paymentAttributes - the TypedProperty object that contains all the command parameters to be passed to this command.

setPMTotalAmount

protected void setPMTotalAmount(java.math.BigInteger biPMTotalAmount)
Sets the total amount normalized for input to WebSphere Commerce Payments.

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.

Parameters:
biPMTotalAmount - the total amount normalized for WebSphere Commerce Payments

setPONumber

protected void setPONumber(java.lang.String sPONumber)
Sets the Purchase Order Number attribute.
Parameters:
sPONumber - the purchase order number

setProfileName

protected void setProfileName(java.lang.String s)
Sets the Profile Name attribute.
Parameters:
s - the profile name
See Also:
setPaymentAttributes

setReturnData

protected void setReturnData(byte[] ba)
Sets the Return Data to be returned to the caller.
Parameters:
ba - the byte array containing the return data

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.

setupNumericCurrencyCodeAndPMTotalAmount

protected void setupNumericCurrencyCodeAndPMTotalAmount()
                                                 throws javax.ejb.CreateException,
                                                        javax.ejb.FinderException,
                                                        javax.naming.NamingException,
                                                        java.rmi.RemoteException,
ECException
This method retrieves the numeric currency code from the SETCURR Table and converts the totalAmount into a normalized form required for input to WebSphere Commerce Payments. The normalized form of the amount is the amount converted to the lowest denomination of the currency. For example, if the amount is US $10.95, the normalized amount is 1095 in cents, which is the lowest denomination for this currency.
Throws:
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException
ECException

updateOrderPaymentMethod

protected void updateOrderPaymentMethod()
                                 throws javax.ejb.CreateException,
                                        javax.ejb.FinderException,
                                        javax.naming.NamingException,
                                        java.rmi.RemoteException
This method is called by performExecute to create a new ORDPAYMTHD row with payment info.
Throws:
javax.ejb.CreateException
javax.ejb.FinderException
javax.naming.NamingException
java.rmi.RemoteException

validateParameters

public void validateParameters()
                        throws ECException
Checks the validity of customer-supplied parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException.
ECException