public class QueryPaymentsInfoCompatiblePolicyCmdImpl extends BusinessPolicyCommandImpl implements QueryPaymentsInfoPolicyCmd
QueryPaymentsInfoPolicyCmd
implementation class when
classical payment is used. When the payment rules component wants to get the
up to date backend payment information, it calls this command by
QueryHandler
. And this command gets the payment information through analyzing
current status of the order and max amount and actual amount in the table ORDPAYMTHD.
This class is used with classical payment.
defaultCommandClassName, NAME
Constructor and Description |
---|
QueryPaymentsInfoCompatiblePolicyCmdImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkIfOrderEditable()
This method checks if Order is editable.
|
ActionResults |
getActionResults()
This method gets the action results after the corresponding query action
is executed.
|
PaymentInstruction |
getBackendPaymentInstruction()
This method gets the backend payment instruction.
|
PaymentDataAnalyzer |
getCreditWithBackend()
This method gets the backend credit information.
|
java.lang.String |
getErrorDetail()
This method gets the detailed error information.
|
java.util.Locale |
getLocale()
The method gets the current locale .
|
java.lang.String |
getOrderChannel()
This method gets the current order channel.
|
PaymentActionData |
getPaymentActionData()
This method gets the payment action data that contains the necessary
information for the payment query action.
|
PaymentDataAnalyzer |
getPaymentDataAnalyzer()
This method gets the object of
PaymentDataAnalyzer as the container of payment/credit information. |
java.lang.String |
getPaymentGroupId()
This method gets the current payment group id.
|
PaymentInstruction |
getPaymentInstruction(java.lang.Long orderId)
This method gets payment instruction by order Id.
|
PaymentInstruction |
getPaymentInstructionWithBackend()
This method gets the backend payment instruction.
|
PaymentDataAnalyzer |
getPaymentWithBackend()
This method gets the backend payment information.
|
RefundActionData |
getRefundActionData()
This method gets the refund action data that contains the necessary
information for the credit query action.
|
java.lang.Integer |
getStoreId()
This method gets the current store id.
|
boolean |
isOrderEditable()
This method gets the OrderEditable flag.
|
void |
performExecute()
This method executes the query action.
|
void |
reset()
This method is called after a command has been executed.
|
void |
setLocale(java.util.Locale thisLocale)
This method sets the current locale.
|
void |
setOrderChannel(java.lang.String string)
This method sets the current order channel.
|
void |
setPaymentActionData(PaymentActionData ac)
This method sets the payment action data that contains the necessary
information for the payment query action.
|
void |
setPaymentGroupId(java.lang.String string)
This method sets the current payment group id.
|
void |
setRefundActionData(RefundActionData ac)
This method sets the refund action data that contains the necessary
information for the credit query action.
|
void |
setStoreId(java.lang.Integer integer)
This method sets the current store id.
|
void |
validate()
This method validates if the query action is valid.
|
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 QueryPaymentsInfoCompatiblePolicyCmdImpl()
public final java.util.Locale getLocale()
public void setPaymentActionData(PaymentActionData ac)
setPaymentActionData
in interface QueryPaymentsInfoPolicyCmd
ac
- The payment action data to be used in
the query payment action.public PaymentActionData getPaymentActionData()
public void setRefundActionData(RefundActionData ac)
setRefundActionData
in interface QueryPaymentsInfoPolicyCmd
ac
- The refund action data to be used in
the query payment action.public RefundActionData getRefundActionData()
getRefundActionData
in interface QueryPaymentsInfoPolicyCmd
public boolean isOrderEditable()
isOrderEditable
in interface QueryPaymentsInfoPolicyCmd
public void performExecute() throws ECException
QueryHandler
that further calls this command, and by the
action name in the action data, the corresponding method is called.
Because here classical payment is used. We get the payment information
through analyzing the status of current order and the max amount and
actual amount in ORDPAYMTHD. This represents the approving/approved
amount and depositing/deposited amount, respectively.
Note that if you need check if order is editable, the result is decided by the deposited amount of current order. This means if the order has not been deposited yet, then the order is editable; otherwise it is not.
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public void validate() throws EDPException
EDPException
is thrown.EDPException
- Thrown if payment id is nullpublic PaymentInstruction getPaymentInstructionWithBackend() throws ECException
getPaymentInstruction(Long orderId)
to get the backend payment instruction.
ECException
public PaymentDataAnalyzer getPaymentWithBackend() throws ObjectCannotBeFoundException, ECException
getPaymentInstruction(Long orderId)
to get the backend payment instruction. And then get the payment information for this payment
instruction.
ObjectCannotBeFoundException
- Thrown if there is no payments for the current payment instructionECException
public PaymentDataAnalyzer getCreditWithBackend() throws ObjectCannotBeFoundException, ECException
getPaymentInstruction(Long orderId)
to get the backend payment instruction. And then get the credit information for this payment
instruction.
ObjectCannotBeFoundException
- Thrown if there is no credits for the current payment instructionECException
public PaymentInstruction getBackendPaymentInstruction()
getBackendPaymentInstruction
in interface QueryPaymentsInfoPolicyCmd
public ActionResults getActionResults()
getActionResults
in interface QueryPaymentsInfoPolicyCmd
public PaymentDataAnalyzer getPaymentDataAnalyzer()
PaymentDataAnalyzer
as the container of payment/credit information.getPaymentDataAnalyzer
in interface QueryPaymentsInfoPolicyCmd
public boolean checkIfOrderEditable() throws ECException
ECException
public PaymentInstruction getPaymentInstruction(java.lang.Long orderId) throws ECException
Firstly this method constructs a backend payment instruction through retrieving the properties stored in the table ORDPAYINFO. Then this method analyzes the payment state for this payment instruction, and the criteria are as follows: 1. If actual amount in ORDPAYMTHD is null, and the order status is "M" or "I", it means the payment state is approving. 2. If actual amount in ORDPAYMTHD is null ,and the order status is not "M"/"I"/"D", it means the payment state is approved. 3. If actual amount in ORDPAYMTHD is not null, and the order status is "D", it means the payment state is deposited. 4. If actual amount in ORDPAYMTHD is not null, and the order status is not "D", it means the payment state is depositing.
orderId
- PaymentInstruction
A PaymentInstruction object
that are constructed through accessing the information in
ORDPAYINFO and ORDPAYMTHD table.ECException
public java.lang.String getErrorDetail()
getErrorDetail
in interface QueryPaymentsInfoPolicyCmd
public java.lang.String getOrderChannel()
public java.lang.String getPaymentGroupId()
public void setLocale(java.util.Locale thisLocale)
setLocale
in interface QueryPaymentsInfoPolicyCmd
thisLocale
- The current localepublic void setOrderChannel(java.lang.String string)
setOrderChannel
in interface QueryPaymentsInfoPolicyCmd
string
- The current order channelpublic void setPaymentGroupId(java.lang.String string)
setPaymentGroupId
in interface QueryPaymentsInfoPolicyCmd
string
- The current payment group idpublic java.lang.Integer getStoreId()
getStoreId
in interface ECCommand
getStoreId
in class AbstractECTargetableCommand
public void setStoreId(java.lang.Integer integer)
setStoreId
in interface QueryPaymentsInfoPolicyCmd
integer
- The current store id.public void reset()
AbstractECTargetableCommand
reset
in interface com.ibm.websphere.command.Command
reset
in class AbstractECTargetableCommand
Command.reset()