com.ibm.commerce.returns.commands

Class RefundWithDependentSupportPolicyCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, com.ibm.commerce.returns.commands.RefundByMethodPolicyCmd, 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 RefundWithDependentSupportPolicyCmdImpl
    extends com.ibm.commerce.returns.commands.RefundByMethodPolicyCmdImpl
    implements com.ibm.commerce.returns.commands.RefundByMethodPolicyCmd
    This class is an implementation class of the command RefundByMethodPolicyCmd, which corresponds to the scenarios where payment methods used in placing order can be choosed as the refund method. The command supports both dependent credit and independent credit, and it also supports multiple refund methods.

    Behavior

    • Firstly, this command gets all the payment instructions which were used in placing order,and checks each payment instruction whether it is allowed to refund.
    • For each payment instruction which is allowed to refund, the command checks whether it is dependent required, and gets the refundable amount accordingly.
    • At last, this command composes a refund instruction for each payment instruction whose refundable amount is larger than zero.

    This command is called by PrimeRefundCmd to create refund instruction and refund information in Payment Rules.

    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

      • RefundWithDependentSupportPolicyCmdImpl

        public RefundWithDependentSupportPolicyCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        This method executes the main business logic of this command.

        This method firstly gets all payment instructions as an ArrayList from the order this RMA corresponds to. And then traverses the ArrayList to get the payment instructions used against the order. For each payment instruction, this method checks whether it is dependent credit required, and composes a new refund instruction with appropriate amount accordingly. Then the method sets the necessary attributes to the new refund instructions, then sets it to the ArrayList. Later PrimeRefundCmd creates the Refund Instruction and refund information of Payment Rules in database according to the Refund Instruction in this ArrayList.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - In case of any ECException
      • reset

        public void reset()
        This method resets the instance variable of this command.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand