public class DoPaymentActionsCompatiblePolicyCmdImpl extends BusinessPolicyCommandImpl implements DoPaymentActionsPolicyCmd
DoPaymentActionsPolicyCmd
implementation class for
existing policy commands in classical payments. The existing payment policy
commands are not allowed to use together with payment plug-in controller or
other payment processing system for the same order. The reason is that these
payment policies commands are always designed with the an assumption. The assumption is that only
one payment instruction is allowed for one order and every payment actions
are executed against the order total amount.
This class is used with Classical Payments.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
DoPaymentActionsCompatiblePolicyCmdImpl() |
Modifier and Type | Method and Description |
---|---|
ActionResults |
approve(PaymentActionData actionData)
This method does the approve action.
|
ActionResults |
cancel(PaymentActionData actionData)
This method executes the cancel action.
|
ActionResults |
consumeAmount(PaymentActionData actionData)
This method does consume amount action.
|
ActionResults |
deposit(PaymentActionData actionData)
This method executes the deposit action.
|
EDPResults |
getEDPResults()
This method gets the payment action execution results, which indicates
the payment action execution results is successful, pending or failed.
|
OrderAccessBean |
getOrderAccessBean()
This method gets the order access bean of current order.
|
java.lang.String |
getOrderChannel()
This method gets the current order channel.
|
java.util.List |
getPaymentActionDataList()
This method gets the list of payment action data.
|
java.lang.String |
getPaymentGroupId()
The method gets the current payment group id.
|
java.util.List |
getRefundActionDataList()
This method gets the list of refund action data.
|
RMAAccessBean |
getRMAAccessBean()
This method gets the Return Mechanise Authorization(RMA) access bean of current RMA.
|
java.lang.Integer |
getStoreId()
This method gets the current store id.
|
void |
performExecute()
This method performs classic payment action per action data type.
|
ActionResults |
refund(RefundActionData actionData)
This method executes the refund action.
|
void |
reset()
This method is called after a command has been executed.
|
void |
setLocale(java.util.Locale currentLocale)
This method sets the current locale.
|
void |
setOrderAccessBean(OrderAccessBean localOrderAccessBean)
This method sets the order access bean of current order.
|
void |
setOrderChannel(java.lang.String string)
This method sets the current order channel.
|
void |
setPaymentActionDataList(java.util.List dataList)
This method sets the list of payment action data.
|
void |
setPaymentGroupId(java.lang.String string)
This method sets the current payment group id.
|
void |
setRefundActionDataList(java.util.List dataList)
This method sets the list of refund action data.
|
void |
setRMAAccessBean(RMAAccessBean localRMAAccessBean)
This method sets the RMA access bean of current RMA.
|
void |
setStoreId(java.lang.Integer integer)
This method sets the current store id.
|
void |
updateActionStatusFromOrderStatus(ActionData actionData,
ActionResults actionResults,
OrderAccessBean iabOrder)
This method sets the corresponding status of action data and action
results according to the order status.
|
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
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
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public static final java.lang.String COPYRIGHT
public DoPaymentActionsCompatiblePolicyCmdImpl()
public EDPResults getEDPResults()
getEDPResults
in interface DoPaymentActionsPolicyCmd
public OrderAccessBean getOrderAccessBean()
public void setOrderAccessBean(OrderAccessBean localOrderAccessBean)
localOrderAccessBean
- The order access bean of current order.public RMAAccessBean getRMAAccessBean()
public void setRMAAccessBean(RMAAccessBean localRMAAccessBean)
localRMAAccessBean
- The RMA access bean of current RMA.public void setPaymentActionDataList(java.util.List dataList)
setPaymentActionDataList
in interface DoPaymentActionsPolicyCmd
dataList
- The list of payment action data to be used in the actions.public java.util.List getPaymentActionDataList()
public void setRefundActionDataList(java.util.List dataList)
setRefundActionDataList
in interface DoPaymentActionsPolicyCmd
dataList
- The list of refund action data to be used in the actions.public java.util.List getRefundActionDataList()
public void performExecute() throws ECException
This method will be called by the PaymentEventListenerImpl that listens the payment event and executes the corresponding payment action.
There is the list of payment/refund action data contains the necessary information for payment/refund action that is passed to this command. Then this command executes each payment/refund action in this list, respectively.
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public ActionResults approve(PaymentActionData actionData) throws ECException, EDPException
DoPaymentCmd
is called to do the approve action. If the
corresponding record for this order has existed in the database, which
means the approve action for this order has been executed previously.
Then CheckPaymentAcceptCmd
is called to execute the
correct action.
The payment rules component decides the approve action should be executed
through the payment rules configuration. And currently the payment cation
name in payment action data equals "ApproveAction". Then this method is
called, which calls DoPaymentCmd
or
CheckPaymentAcceptCmd
which further calls the policy
command in classical payments. The policy command in classical payments
communicates with payment manager to actually execute the approve action.
Regardless of the results of the approve action, this execution will be stored in the database to record the history the payment/refund action.
actionData
- The action data which will supply the data to perform approve.ECException
EDPException
public ActionResults deposit(PaymentActionData actionData) throws ECException, EDPException
The deposit action captures a payment for an order. In general, communication with a payment manager occurs at this stage. This action can occur during the following events: primePayment, reservePayment, and finalizePayment.
The payment rules component decides the deposit action should be executed
in the specific business events. And currently the payment action name in
payment action data equals "DepositAction". Then this method is
called, which calls DoDepositCmd
which further calls the
policy command in classical payments.The policy command in classical payments
communicates with payment manager to actually execute the deposit action.
Regardless of the results of the deposit action, this execution will be stored in the database to record the history the payment/refund action.
actionData
- The payment action data which will supply the data to perform
deposit.ECException
EDPException
public ActionResults cancel(PaymentActionData actionData) throws ECException, EDPException
The cancel action voids an approval. Only full cancel is supported; the cancel of partial amounts is not supported. This action can occur during the following business events: reservePayment, finalizePayment, cancelOrder and edit.
The payment rules component decides the cancel action should be executed
in the specific business events. And currently the payment action
name in payment action data equals "ReverseApprovalAction", then this method is
called, which calls DoCancelCmd
which further calls the policy
command in classical payments.The policy command in classical payments communicates
with payment manager to actually execute the cancel action.
Regardless of the results of the cancel action, this execution will be stored in the database to record the history the payment/refund action.
actionData
- the payment action data which supply some data to perform
cancel actionECException
EDPException
public ActionResults refund(RefundActionData actionData) throws ECException, EDPException
The refundDeposit action issues a refund to return money to the customer, usually as a result of returning merchandise that was purchased. This action can occur during the following business events: finalizeRefund.
The payment rules component decides the refund action should be executed
in the specific business events. And currently the payment action
name in payment action data equals "Refund". Then this method is
called, which calls DoRefundCmd
which further calls the policy
command in classical payments.The policy command in classical payments communicates
with payment manager to actually execute the refund action.
Regardless of the results of the refund action, this execution will be stored in the database to record the history the payment/refund action.
actionData
- The refund action data which supply some data information to
perform refundECException
EDPException
public void updateActionStatusFromOrderStatus(ActionData actionData, ActionResults actionResults, OrderAccessBean iabOrder) throws ECException, EDPException
If the result of order.getStatus() is: 1. 'C' or 'D', it will be treated as successful. 2. 'M', it will be treated as pending. 3. 'A', This is more complex because each store has different definition for the acceptable avs code. We will create a tickler for the 'A' status and block orders. 4. Other status: ignore it
actionData
- The action transferred to the command to execute the payment
action.actionResults
- The actionResults returned by the payment action.iabOrder
- The order access bean associated with this payment action.ECException
EDPException
public ActionResults consumeAmount(PaymentActionData actionData) throws ECException, EDPException
CheckPaymentAcceptCmd command to check if
the current order is available, And set the ActioinResult according with
the result of CheckPaymentAcceptCmd. If the amount in the action data
equals to zero, then do nothing.
The payment rules component decides the consume action should be executed
in the specific business events. And currently the payment action
name in payment action data equals "ConsumeAmount". Then this method is
called, which calls CheckPaymentAcceptCmd
which further calls the policy
command in classical payments.The policy command in classical payments communicate
with payment manager to actually execute the consume action.
Regardless of the results of the consume action, this execution will be
stored in the database to record the history the payment/refund action.
actionData
- The action data which will supply the data to perform approve.ECException
EDPException
public java.lang.String getOrderChannel()
public java.lang.String getPaymentGroupId()
public void setLocale(java.util.Locale currentLocale)
setLocale
in interface DoPaymentActionsPolicyCmd
currentLocale
- The current localepublic void setOrderChannel(java.lang.String string)
setOrderChannel
in interface DoPaymentActionsPolicyCmd
string
- The current order channel.public void setPaymentGroupId(java.lang.String string)
setPaymentGroupId
in interface DoPaymentActionsPolicyCmd
string
- The current payment group id.public java.lang.Integer getStoreId()
getStoreId
in interface ECCommand
getStoreId
in class AbstractECTargetableCommand
public void setStoreId(java.lang.Integer integer)
setStoreId
in interface DoPaymentActionsPolicyCmd
integer
- The current store id.public void reset()
AbstractECTargetableCommand
reset
in interface com.ibm.websphere.command.Command
reset
in class AbstractECTargetableCommand
Command.reset()