com.ibm.commerce.payment.actions.commands

Class QueryPaymentsInfoPolicyCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, QueryPaymentsInfoPolicyCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class QueryPaymentsInfoPolicyCmdImpl
    extends BusinessPolicyCommandImpl
    implements QueryPaymentsInfoPolicyCmd
    The QueryPaymentsInfoPolicyCmd implementation class when new payment processing component 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 calling the query API of payment processing component. It further calls the corresponding API of Plugin to get the up to date payment information from financial transaction.

    This class is used with new payment processing component.

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • QueryPaymentsInfoPolicyCmdImpl

        public QueryPaymentsInfoPolicyCmdImpl()
    • Method Detail

      • getLocale

        public final java.util.Locale getLocale()
        This method sets the current locale, which will be put into payment context where there is a corresponding attribute. You must set the current locale to put it into the payment context before processing the payment
        Returns:
        locale The current locale.
      • setPaymentActionData

        public void setPaymentActionData(PaymentActionData ac)
        This method sets the payment action data that contains the necessary information for the payment query action. The payment action data is determined by payment rules component.
        Specified by:
        setPaymentActionData in interface QueryPaymentsInfoPolicyCmd
        Parameters:
        ac - The payment action data to be used in the query payment action.
      • getPaymentActionData

        public PaymentActionData getPaymentActionData()
        This method gets the payment action data that contains the necessary information for the payment query action. The payment action data is determined by payment rules component.
        Returns:
        payActionData The payment action data to be used in the query payment action.
      • isOrderEditable

        public boolean isOrderEditable()
        This method gets the OrderEditable flag.
        Specified by:
        isOrderEditable in interface QueryPaymentsInfoPolicyCmd
        Returns:
        orderEditable If order is editable
      • performExecute

        public void performExecute()
                            throws ECException
        This method executes the query action. When payment rules component wants to get the payment information, it calls the command QueryHandler that further calls this command. And by the action name in the action data, the corresponding API of payment processing component is called to get the up to date payment information. It does this through calling the API of Plugin from financial transaction.

        Note that if you just check if the order is editable. Then in this command true is always returned since here order is always editable even there are non-zero deposited amount.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • validate

        public void validate()
                      throws EDPException
        This method validates if the query action is valid. Here it judges if the atomic payment is null in the payment action data. And if it is, then an EDPException is thrown.
        Throws:
        EDPException - Thrown if payment id is null
      • getPaymentInstructionWithBackend

        public PaymentInstruction getPaymentInstructionWithBackend()
                                                            throws ECException
        This method gets the backend payment instruction. When the action name in the payment action data is "QueryPaymentInstructionAction", then this method is called. It calls the API getPaymentInstruction of payment processing component to get the payment instruction information.
        Returns:
        PaymentInstruction The backend payment instruction information
        Throws:
        ECException
      • getPaymentWithBackend

        public PaymentDataAnalyzer getPaymentWithBackend()
                                                  throws ECException
        This method gets the backend payment information. When the action name in the payment action data is "QueryPaymentAction". Then this method is called,which calls the API getPayment of payment processing component to get the payment information.
        Returns:
        PaymentDataAnalyzer The container of payment information
        Throws:
        ECException
      • getCreditWithBackend

        public PaymentDataAnalyzer getCreditWithBackend()
                                                 throws ECException
        This method gets the backend credit information. When the action name in the refund action data is "RefundQueryAction". Then this method is called,which calls the API getCredit of payment processing component to get the credit information.
        Returns:
        PaymentDataAnalyzer The container of credit information
        Throws:
        ECException
      • getActionResults

        public ActionResults getActionResults()
        This method gets the action results after the corresponding query action is executed.
        Specified by:
        getActionResults in interface QueryPaymentsInfoPolicyCmd
        Returns:
        policyActionResults The action results after the query action is executed.
      • checkIfOrderEditable

        public boolean checkIfOrderEditable()
        This method checks if the order is editable. When the action name in the refund action data is "QueryOrderEditable", then this method is called. It always returns true since when new payment processing component is used, the order is editable even there exists non-zero deposited amount.
        Returns:
        true always
      • getRefundActionData

        public RefundActionData getRefundActionData()
        This method gets the refund action data that contains the necessary information for the credit query action. The refund action data is determined by payment rules component.
        Specified by:
        getRefundActionData in interface QueryPaymentsInfoPolicyCmd
        Returns:
        refundActionData The refund action data to be used in the query credit action.
      • setRefundActionData

        public void setRefundActionData(RefundActionData data)
        This method sets the refund action data that contains the necessary information for the credit query action. The refund action data is determined by payment rules component.
        Specified by:
        setRefundActionData in interface QueryPaymentsInfoPolicyCmd
        Parameters:
        data - The refund action data to be used in the query payment action.
      • getErrorDetail

        public java.lang.String getErrorDetail()
        This method gets the detailed error information that returned by the method getErrorDetialWithBackEnd().
        Specified by:
        getErrorDetail in interface QueryPaymentsInfoPolicyCmd
        Returns:
        errorDetail The detailed error information
      • getOrderChannel

        public java.lang.String getOrderChannel()
        This method gets the current order channel, which will be put into payment context where there is a corresponding attribute.
        Returns:
        orderChannel The current order channel.
      • getPaymentGroupId

        public java.lang.String getPaymentGroupId()
        This method gets the current payment group id, which will be put into payment context where there is a corresponding attribute.
        Returns:
        paymentGroupId The current payment group id.
      • setLocale

        public void setLocale(java.util.Locale localLocal)
        This method sets the current locale, which will be put into payment context where there is a corresponding attribute. You must set the current locale to put it into the payment context before processing the payment
        Specified by:
        setLocale in interface QueryPaymentsInfoPolicyCmd
        Parameters:
        localLocal - The current locale.
      • setOrderChannel

        public void setOrderChannel(java.lang.String string)
        This method sets the current order channel, which will be put into payment context where there is a corresponding attribute. You must set the current order channel to put it into the payment context before processing the payment.
        Specified by:
        setOrderChannel in interface QueryPaymentsInfoPolicyCmd
        Parameters:
        string - The current order channel.
      • setPaymentGroupId

        public void setPaymentGroupId(java.lang.String string)
        This method sets the payment group id, which will be put into payment context where there is a corresponding attribute. You must set the current payment group id to put it into the payment context before processing the payment.
        Specified by:
        setPaymentGroupId in interface QueryPaymentsInfoPolicyCmd
        Parameters:
        string - The current payment group id.
      • getStoreId

        public java.lang.Integer getStoreId()
        This method gets the store id, which will be put into payment context where there is a corresponding attribute.
        Specified by:
        getStoreId in interface ECCommand
        Overrides:
        getStoreId in class AbstractECTargetableCommand
        Returns:
        storeId The current payment store id.
      • setStoreId

        public void setStoreId(java.lang.Integer integer)
        This method gets the store id, which will be put into payment context where there is a corresponding attribute.
        Specified by:
        setStoreId in interface QueryPaymentsInfoPolicyCmd
        Parameters:
        integer - The current payment store id.
      • reset

        public void reset()
        Description copied from class: AbstractECTargetableCommand
        This method is called after a command has been executed. It is used to reset its states variables. After the call to reset, the command should be able to be executed again.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
        See Also:
        Command.reset()