Class PIEditCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, AEDPCtrlCmd, PIEditCmd, Protectable,,,,,,

    public class PIEditCmdImpl
    extends AEDPPIEditCtrlCmdImpl
    implements PIEditCmd

    This is the default implementation of the PICopyCmdcontroller command.

    Input parameters:

    Name XPath Description
    orderId /XML/orderId The identifier of the order for which the payment method is to be changed. Mandatory.
    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.
    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.
    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').
    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. If an existing keyword is passed in, the value for the keyword will be overwritten in the payment instruction.
    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"
    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.
    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.
    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".

    Output parameters:



    • Validates that the required parameters are passed: orderId, piId, policy_id or payMethodId, and URL.
    • Check if the order is locked by other CSR, throw exception if it is locked. If the order is not locked and this requestion is called by CSR, lock the order object.
    • Changes the EDPPaymentInstruction specified with the data passed in. Checks the paymentDataEditable and amountEditable flag. Updates the payment method ID, the amount, and payment protocol data (protocol data specified as name-value pairs).
    • Adds the EDPPaymentInstruction in an empty list.
    • Calls the EditCmdtask command with the payment method, the total order amount, the ordered and the force change flag. The total order amount is calculated from total product price, total tax, total shipping, total shipping tax, total adjustment.
    • Examines the results of the task command for an error and redirects to an error page. Otherwise, it redirects to the URL that was passed as a parameter.

    Task commands called:

    See Also:
    EditCmd, Serialized Form
    • Field Detail


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

      • PIEditCmdImpl

        public PIEditCmdImpl()
        The default constructor.
    • Method Detail

      • setForcedPaymentInstructionChangeFlag

        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.

        Specified by:
        setForcedPaymentInstructionChangeFlag in interface PIEditCmd
        forcedChange - indicates if the request is forced or not
      • getForcedPaymentInstructionChangeFlag

        public boolean getForcedPaymentInstructionChangeFlag()
        This method gets the forced flag that indicates if this request will be forced or not.
        the forced flag
      • getPIID

        public java.lang.Long getPIID()
        This method gets the payment instruction ID.
        iPIID the payment instruction ID
      • setPIId

        public void setPIId(java.lang.Long aPIId)
        This method sets the payment instruction ID.
        Specified by:
        setPIId in interface PIEditCmd
        aPIId - the payment instruction ID
      • performExecute

        public void performExecute()
                            throws ECException
        This command will delete the old payment instruction and add a new payment instruction with all new protocol data and/or amount/currency
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface
        performExecute in class AbstractECTargetableCommand
        ECException - if something fails
      • reset

        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.

        Specified by:
        reset in interface
        reset in class AEDPPIEditCtrlCmdImpl
      • isAmountEditable

        public boolean isAmountEditable()
        This method returns the amount editable flag indicating if the amount is dirty or not.
        true if the amount is editable, false otherwise
      • isPaymentDataEditable

        public boolean isPaymentDataEditable()
        This method returns the payment data editable flag indicating if the payment data is dirty or not.
        the payment data editable flag
      • setAmountEditable

        public void setAmountEditable(boolean amountEditable)
        This method sets the amount editable flag indicating if the amount is dirty or not. True by default.
        Specified by:
        setAmountEditable in interface PIEditCmd
        amountEditable - indicates if the amount is dirty or not
      • setPaymentDataEditable

        public void setPaymentDataEditable(boolean paymentDataEditable)
        This method sets the payment data editable flag indicating if the payment data is dirty or not. True by default.
        Specified by:
        setPaymentDataEditable in interface PIEditCmd
        paymentDataEditable - indicates if the payment data is dirty or not