public class PIEditWithMergingProtocolDataCmdImpl extends AEDPPIEditCtrlCmdImpl implements PIEditCmd
This is another implementation of the PIEditCmd
controller
command. It merges the payment protocol data passed in with those
original data stored in database. if some useful protocol data were not passed in, this command will
use the corresponding original data instead to update the payment instruction.
Name | XPath | Description |
---|---|---|
orderId |
/XML/orderId |
The identifier of the order for which the payment method is to be changed. Optional. If it is not passed in, then it will be retrieved via current payment instruction. |
piId |
/XML/piId |
The numeric identifier of the payment instruction to modify. The piId can be obtained from the EDPPaymentInstructionsDataBean data bean and represents the combination of the payment method, payment amount, and any protocol data. Mandatory. |
URL |
/XML/URL |
The URL to be called when the command completes successfully. Mandatory |
piAmount |
/XML/piAmount |
The new amount in the order currency to be used for this payment
instruction. 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. Optional. If it is not passed in, then it will be retrieved
via current payment instruction. |
policyId |
/XML/policyId |
The payment policy identifier. It is the primary key of the payment
business policy table. (Table POLICY with column policytype_id =
'Payment'). Optional. If it is not passed in, then it will be retrieved via
current payment instruction. |
protocolData |
/XML/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. At calling this command, you just need to pass the changed protocol data. |
forceFlag |
/XML/forceFlag |
The flag to indicate whether the payment method should be edited. Even though the target amount is less than the authorized amount or there is some deposited amount for the payment method. For these scenarios, tickler will be created to make sure the CSR is notified. The default value is "false" |
/XML/cvcResetFlag |
The flag to indicate whether the cvc number of the credit card should be
forced to reset to an empty value. |
|
paymentDataEditable |
/XML/paymentDataEditable |
The flag to indicate whether the payment protocol data should be edited by this request. "true" means the payment protocol data should be edited by this request. The default value is "true" |
amountEditable |
/XML/amountEditable |
The flag to indicate whether the payment method amount should be edited by this request. If piAmount parameter is provided and this flag is true, the amount will be edited by this request. The default value is "true" |
purchaseorder_id |
/XML/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. Optional. |
errorViewName |
/XML/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 |
/XML/billing_address_id |
The billing address identifier in WebSphere Commerce instance. |
paymentTCId |
/XML/paymentTCId |
The payment Term & Condition identifier for this payment instruction. This parameter is used by the business customer. Optional. |
valueFromPaymentTC |
/XML/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". |
orderId
is not passed in, then it is retrieved via
current payment instruction; If piAmount
is not passed in,
then it is retrieved via current payment instruction; If neither
payMethodId
and policyId
is passed in, then
they are retrieved via current payment instruction.EditCmd
task command to edit this payment instruction. If only amount is to be changed, then the change will be
directly based on existing payment instruction. If payment protocol data is to be changed, then the existing payment instruction will
be canceled and a new one is created.EditCmd
,
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 |
---|
PIEditWithMergingProtocolDataCmdImpl()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getForcedPaymentInstructionChangeFlag()
This method gets the forced flag that indicates if this request will be forced or not.
|
java.lang.Long |
getPIID()
This method gets the payment instruction ID.
|
AccessVector |
getResources()
This method returns the vector of resources accessed by this command, which uses the order access bean for resource access control.
|
boolean |
isAmountEditable()
This method returns the amount editable flag indicating if the amount is dirty or not.
|
boolean |
isCvcResetFlag()
This method gets the
cvc reset flag that indicates if cvc number will be reset or not. |
boolean |
isPaymentDataEditable()
This method returns the payment data editable flag indicating if the payment data is dirty or not.
|
void |
performExecute()
This command will delete the old payment instruction and add a new payment instruction with all new protocol data and/or amount/currency
|
void |
reset()
This method resets the command fields.
|
void |
setAmountEditable(boolean amountEditable)
This method sets the amount editable flag indicating if the amount is dirty or not.
|
void |
setCvcResetFlag(boolean cvcResetFlag)
This method sets the flag to indicate if the
cvc number will be reset or not. |
void |
setForcedPaymentInstructionChangeFlag(boolean forcedChange)
This method sets the forced flag indicating if the request will be forced or not.
|
void |
setPaymentDataEditable(boolean paymentDataEditable)
This method sets the payment data editable flag indicating if the payment data is dirty or not.
|
void |
setPIId(java.lang.Long aPIId)
This method sets the payment instruction ID.
|
void |
setRequestProperties(TypedProperty reqProperties)
This method sets the input parameters from the request.
|
void |
validateParameters()
This method verifies that required input parameters are present and correct.
|
getAmount, getPaymentMethodID, getPiIdNull, getPolicyId, getProtocolData, 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
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, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
fulfills, getOwner
public static final java.lang.String COPYRIGHT
public PIEditWithMergingProtocolDataCmdImpl()
public void setForcedPaymentInstructionChangeFlag(boolean forcedChange)
This method sets the forced flag indicating if the request will be forced or not.
It is up to the caller to set the forceFlag
whether they want to do the a
forced request or not.
setForcedPaymentInstructionChangeFlag
in interface PIEditCmd
forcedChange
- indicates if the request is forced or notpublic boolean getForcedPaymentInstructionChangeFlag()
public boolean isCvcResetFlag()
cvc
reset flag that indicates if cvc
number will be reset or not.public void setCvcResetFlag(boolean cvcResetFlag)
cvc
number will be reset or not.cvcResetFlag
- The iCvcResetFlag to set.public java.lang.Long getPIID()
public void setPIId(java.lang.Long aPIId)
public void setRequestProperties(TypedProperty reqProperties) throws ECException
If orderId, piAmount, or payMethodId/policyId is not passed in, then it will be retrieved from database via current payment instruction.
Merge the changed protocol data with existing ones in database.
setRequestProperties
in interface ControllerCommand
setRequestProperties
in class ControllerCommandImpl
reqProperties
- the input parameters from the requestECException
- if something failspublic 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 setAmountEditable(boolean amountEditable)
setAmountEditable
in interface PIEditCmd
amountEditable
- indicates if the amount is dirty or notpublic void setPaymentDataEditable(boolean paymentDataEditable)
setPaymentDataEditable
in interface PIEditCmd
paymentDataEditable
- indicates if the payment data is dirty or notpublic boolean isAmountEditable()
public boolean isPaymentDataEditable()
public 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 something input is invalid or missingpublic AccessVector getResources() throws ECException
This method returns the vector of resources accessed by this command, which uses the order access bean for resource access control.
getResources
in interface ECCommand
getResources
in class AEDPPIEditCtrlCmdImpl
ECException
- in the case of a failure