Class DoRefundCLCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand,, ECCommand, ECTargetableCommand, TaskCommand, DoRefundPolicyCmd,,,,,,


    public class DoRefundCLCmdImpl
    extends BusinessPolicyCommandImpl
    implements DoRefundPolicyCmd
    This DoRefundPolicy business policy command implementation class is the default implementation class for refunding payment for CreditLine.
    (The original payment method of the Order may be different)


    Parameter Name Type Descriptions
    abRMA RMAAccessBean The RMAAccessBean for the Return Merchandise Authorization (RMA) record
    abOrder OrderAccessBean The OrderAccessBean of the order associated with the RMA
    bdRefundAmount BigDecimal The amount of the refund in the currency of the Order.
    errorViewName String Optional error view name passed in by the Caller.


    • Make sure the Credit Line of the Account is still active.
    • If the CreditLine of the Account is still active, creates a record in the ORDPAYMTHD Table to represent this refund using the RMA_ID as the REFUNDNUMBER and "LOC" and "0" as the PAYMETHOD and PAYDEVICE respectively. The RMA_ID is also stored in the ORDPAYMTHD.RMA_ID column as a foreign key to the RMA Table. Note that the ORDPAYMTHD.ActualAmount (in the currency of the Order) and the ORDPAYMTHD.CHARGEAMOUNT (in the default currency of the Store) for a Refund entry are negative decimal amounts. (If the Currency of the Order is the same as the default currency of the Store, then ActualAmount and ChargeAmount are the same. Otherwise, a conversion from the currency of the order to the default currency of the Store is required.)
    • Stores the creditLineId, policyId, TradingId and AccountId in the new record and sets the CHARGETIME column to the current time..

    Default Error View Name:

    • DoRefundErrorView


    This command uses the following AccessBeans:

    This command does not call other TaskCommand.

    See Also:
    Serialized Form
    • Constructor Detail

      • DoRefundCLCmdImpl

        public DoRefundCLCmdImpl()
    • Method Detail

      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command. This is done before the Framework calls the performExecute method of the command.
        Specified by:
        isReadyToCallExecute in interface
        isReadyToCallExecute in class AbstractECTargetableCommand
        true if we can execute the command; false otherwise.
      • reset

        public void reset()
        Resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters, then make sure those values are no longer needed before calling this method to reset the instance variables of the command.

        This is useful if the command instance is to be called multiple times with different command parameters.

        Specified by:
        reset in interface
        reset in class AbstractECTargetableCommand
      • setErrorViewName

        public void setErrorViewName(java.lang.String sEVN)
        Sets the error view to be used to report error. This overrides the default error view of the command.
        Specified by:
        setErrorViewName in interface DoRefundPolicyCmd
        sEVN - the Error View name
        See Also:
      • setOrder

        public void setOrder(OrderAccessBean ab)
        Sets the order property of the command.
        Specified by:
        setOrder in interface DoRefundPolicyCmd
        ab - the OrderAccessBean representing the Order associated with the Return Merchandise Authorization.
      • setRefundAmount

        public void setRefundAmount(java.math.BigDecimal refundAmount)
        Sets the refundAmount property of the command.
        Specified by:
        setRefundAmount in interface DoRefundPolicyCmd
        refundAmount - the amount to be refunded.
      • setRMA

        public void setRMA(RMAAccessBean ab)
        Sets the RMA AccessBean representing the Return Merchandise Authorization record that authorizes the return of the merchandise..
        Specified by:
        setRMA in interface DoRefundPolicyCmd
        ab - the RMAAccessBean