com.ibm.commerce.edp.config

Class TargetStatesService

  • java.lang.Object
    • com.ibm.commerce.edp.config.TargetStatesService


  • public class TargetStatesService
    extends java.lang.Object
    This class represents a service that is provided to the Payment Rules business logic. That means what target state of the payment should be in certain business event phase(that is, PrimePayment,ReservePayment, or FinalizePayment).
    • Constructor Summary

      Constructors 
      Constructor and Description
      TargetStatesService(java.lang.String paymentGroupName, java.lang.String ruleName)
      This method is the constructor for this class.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getFinalizeTargetState()
      This method returns the target payment state after FinalizePayment.
      java.lang.String getPrimeTargetState()
      This method returns the target payment state after PrimePayment.
      java.lang.String getReserveTargetState()
      This method returns the target payment state after ReservePayment.
      static java.lang.String getTargetState(java.lang.String paymentGrpId, java.lang.String paymentRule, int phase)
      This method gets the target payment state in current configuration for specified payment group name, payment rule, and business event phase.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TargetStatesService

        public TargetStatesService(java.lang.String paymentGroupName,
                                   java.lang.String ruleName)
                            throws RuleException
        This method is the constructor for this class.
        Parameters:
        paymentGroupName - The current payment group name
        ruleName - The payment rule name
        Throws:
        InvalidDataException - In case of any invalid data error
        RuleException - In case of any rule related error
    • Method Detail

      • getFinalizeTargetState

        public java.lang.String getFinalizeTargetState()
        This method returns the target payment state after FinalizePayment.
        Returns:
        The target payment state after FinalizePayment
      • getPrimeTargetState

        public java.lang.String getPrimeTargetState()
        This method returns the target payment state after PrimePayment.
        Returns:
        The target payment state after PrimePayment
      • getReserveTargetState

        public java.lang.String getReserveTargetState()
        This method returns the target payment state after ReservePayment.
        Returns:
        The target payment state after ReservePayment
      • getTargetState

        public static java.lang.String getTargetState(java.lang.String paymentGrpId,
                                                      java.lang.String paymentRule,
                                                      int phase)
                                               throws RuleException,
                                                      InternalException
        This method gets the target payment state in current configuration for specified payment group name, payment rule, and business event phase.

        Firstly it gets a PaymentRule object by payment group id and payment rule, then it gets the target payment state by phase.

        If phase=1, which means currently it is in PrimePayment phase, then the target payment state after PrimePayment is returned.

        If phase=2, which means currently it is in ReservePayment phase, then the target payment state after ReservePayment is returned.

        If phase=3, which means currently it is in FinalizePayment phase, then the target payment state after FinalizePayment is returned.

        Parameters:
        paymentGrpId - The current payment group id
        paymentRule - The current payment rule
        phase - The current business event phase
        Returns:
        The target payment state by the specified parameters
        Throws:
        RuleException - In case of any payment rule error
        InternalException - In case of any internal error