public class PIAddCmdImpl extends AEDPPIEditCtrlCmdImpl implements PIAddCmd
This is the default implementation of the PIAddCmd
controller
command.
Name | Description |
---|---|
orderId |
The identifier of the order to which the payment method is to be added. Mandatory. |
unbound |
The flag that indicates if the payment instruction to be added is an unbound one or not. |
URL |
The URL to be redirected when the command completes successfully. Mandatory. |
piAmount |
The amount in the order currency to be used for this payment method. The
format of this number must fit the rules for a
java.math.BigDecimal object. The number must use a period for
a decimal place. Mandatory |
policyId |
The payment policy identifier. It is the primary key of the payment
business policy table. (Table POLICY with column policytype_id = 'Payment'). If this parameter
is missing, then payMethodId should be mandatory, and this command tries to get the policy identifier from business policy table
via the policy name as payMethodId .
|
payMethodId |
The payment method name. It is the policy name of the payment
business policy table. (Table POLICY with column policytype_id = 'Payment'). If policyId is passed in, this parameter is not required since this command always sets it as the policy name from business policy table via the policyId .
|
protocolData |
Additional name-value pairs that will be passed to the payment plug-in or payment processor as additional data required by that payment protocol. For example, for a credit card, cc_brand=AMEX. |
purchaseorder_id |
The purchase order number specified to the order. This parameter is optional. If it is set, the value of the purchase order number will send back to the response properties to be displayed in the page. |
errorViewName |
The view name which is redirected to when the execution fails. If this
parameter is provided, the default error view name is
PaymentInstructionErrorView . |
billing_address_id |
The billing address identifier in WebSphere Commerce instance. |
paymentTCId |
The payment Term & Condition identifier for this payment instruction. This parameter is used by the business customer. |
valueFromPaymentTC |
The flag to indicate: Whether the payment protocol data should be extracted from the payment Term&Condition identified by paymentTCId parameter. And whether ignore any protocol data passed in the request properties. The value includes "true" and "false", the default value is "false". |
valueFromProfileOrder |
The flag to indicate: whether the payment protocol data should be extracted from the user's quick checkout profile. And whether ignore any protocol data passed in the request properties. The value includes "Y" and "N", the default value is "N". |
"unbound"
is true, this command will invoke the
AddUnboundPITaskCmd to add one unbound/dummy payment instruction
for the given payment method will be created. This payment instruction does not
have any other information.
Else if the unbound
is not passed, or it
is false, then it does the normal logic blow.
Adds a payment instruction to an existing order. Calls the EditCmd
task command to add the payment instruction to the order.
EDPPaymentInstruction
with the payment policy
ID, the amount, and any payment protocol data supplied (protocol data
specified as name-value pairs).EDPPaymentInstruction
to an empty list.EditCmd
task command with the list of payment methods,
the total order amount and the orderId. The total order amount is calculated from total product price, total tax, total
shipping, total shipping tax, total adjustment.EditCmd
,
AddUnboundPITaskCmd
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM Copyright notice field.
|
BILLING_ADDRESS_ID_PROPERTY_NAME, EDP_EDIT_FORCEFLAG, POLICY_ID, PURCHASEORDER_ID_PROPERTY_NAME
defaultCommandClassName, NAME, PAYMENT_INSTRUCTION_ERROR_VIEW
Constructor and Description |
---|
PIAddCmdImpl()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
fetchAddedPaymentInstructionId(EDPEditResults edpEditResults)
This method fetchs the Id of the newly added payment instruction according to the returned edpEditResults
|
java.lang.Long |
getAddedPaymentInstructionId()
This method returns the Id of the added payment instruction
|
void |
performExecute()
This method executes the actual business logic of the command, which adds
a new payment instruction in payment rules subcomponent.
|
void |
reset()
This method resets the command fields.
|
void |
setAddedPaymentInstructionId(java.lang.Long paymentInstructionId)
This method sets the payment instruction Id
|
void |
setRequestProperties(TypedProperty reqProperties)
This method sets the request input parameters.
|
void |
validateParameters()
This method verifies the input parameters.
|
getAmount, getPaymentMethodID, getPiIdNull, getPolicyId, getProtocolData, getResources, getURL, setAmount, setPaymentMethodID, setPolicyId, setProtocolData, setURL
getLocale, getOrderId, getStoreId, setOrderId
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAmount, setPaymentMethodID, setProtocolData, setURL
getLocale, getOrderId, setOrderId
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
fulfills, getOwner
public static final java.lang.String COPYRIGHT
public void setRequestProperties(TypedProperty reqProperties) throws ECException
setRequestProperties
in interface ControllerCommand
setRequestProperties
in class ControllerCommandImpl
reqProperties
- the request input parametersECException
- if something failspublic void setAddedPaymentInstructionId(java.lang.Long paymentInstructionId)
paymentInstructionId
- public java.lang.Long getAddedPaymentInstructionId()
getAddedPaymentInstructionId
in interface PIAddCmd
public void fetchAddedPaymentInstructionId(EDPEditResults edpEditResults)
edpEditResults
- a result object returned from payment rules task commands.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
- if something failspublic void reset()
This method resets the command fields.
After this method is invoked, and proper attributes are set, the command can be executed again.
reset
in interface com.ibm.websphere.command.Command
reset
in class AEDPPIEditCtrlCmdImpl
public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException
- if input parameters are invalid or missing