com.ibm.commerce.payment.actions.commands

Class PaymentEventListenerImpl

  • java.lang.Object
    • com.ibm.commerce.event.EventComponentConfiguration
      • com.ibm.commerce.event.impl.AbstractECEventListener
        • com.ibm.commerce.payment.actions.commands.PaymentEventListenerImpl
  • All Implemented Interfaces:
    com.ibm.commerce.event.WCSEventListener, ComponentConfiguration, java.util.EventListener


    public class PaymentEventListenerImpl
    extends com.ibm.commerce.event.impl.AbstractECEventListener
    This class is used to process corresponding payment rules event. When it listens a payment rules event in the event bus to be processed, the method processEvent(CommonBaseEvent cbe) is called, which processes the event in the CommonBaseEvent. Firstly this method decomposes the event data from the ExtendedDataElement and gets the original payment actions related data, then executes the corresponding payment actions.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright field.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Class getECEventContainer()
      This method gets the eventContainer class, which acts as the event container of payment rules.
      java.util.Set getEvents()
      This method gets the events, which contains all kinds of events could be processed by this listener class.
      java.util.Locale getLocale()
      This method gets the current locale.
      java.lang.String getOrderCannel()
      This method gets the current order channel.
      java.lang.String getPaymentGroupId()
      This method gets the current payment group id.
      java.lang.Integer getStoreId()
      This method gets the current store id.
      void processEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
      This method processes the payment rules event in CommonBaseEvent, when the payment rules event is listened from event bus, this method is called.
      void setCommandContext(CommandContext context)
      This method sets the command context.
      void setLocale(java.util.Locale localLocale)
      This method sets the current locale.
      void setOrderChannel(java.lang.String string)
      This method sets the current order channel.
      void setPaymentGroupId(java.lang.String string)
      This method sets the current payment group id.
      void setStoreId(java.lang.Integer integer)
      This method sets the current store id.
      • Methods inherited from class com.ibm.commerce.event.impl.AbstractECEventListener

        destroy, enable, getEventContainers, isTransactionRequired, processActivityEvent, registerEventContainer
      • Methods inherited from class com.ibm.commerce.event.EventComponentConfiguration

        init
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

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

      • PaymentEventListenerImpl

        public PaymentEventListenerImpl()
    • Method Detail

      • processEvent

        public void processEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
                          throws ECException
        This method processes the payment rules event in CommonBaseEvent, when the payment rules event is listened from event bus, this method is called.

        1. If the event name equals "PaymentRule", which means this event is a payment rule event and will be processed by this method. 2. It calls corresponding method according to the name of the event data. For example, if the name of event data equals to 'PrimePaymentEventData',then the payment actions in the event data for prime payment will be executed. Here it first decomposes the event to parse the ExtendedDataElement and get the original attributes needed by corresponding payment business event. 3. According to payment actions in the event data, it executes corresponding payment actions.

        Specified by:
        processEvent in class com.ibm.commerce.event.impl.AbstractECEventListener
        Parameters:
        cbe - The event which will be processed and listened from event bus
        Throws:
        ECException
      • getECEventContainer

        public java.lang.Class getECEventContainer()
        This method gets the eventContainer class, which acts as the event container of payment rules.
        Specified by:
        getECEventContainer in class com.ibm.commerce.event.impl.AbstractECEventListener
        Returns:
        The eventContainer class.
      • getEvents

        public java.util.Set getEvents()
        This method gets the events, which contains all kinds of events could be processed by this listener class.
        Specified by:
        getEvents in class com.ibm.commerce.event.impl.AbstractECEventListener
        Returns:
        The events
      • setCommandContext

        public void setCommandContext(CommandContext context)
        This method sets the command context.
        Parameters:
        context - The CommandContext
      • getPaymentGroupId

        public java.lang.String getPaymentGroupId()
        This method gets the current payment group id.
        Returns:
        paymentGroupId The current payment group id
      • getLocale

        public java.util.Locale getLocale()
        This method gets the current locale.
        Returns:
        locale The current locale
      • setLocale

        public void setLocale(java.util.Locale localLocale)
        This method sets the current locale.
        Parameters:
        localLocale - The current locale
      • setOrderChannel

        public void setOrderChannel(java.lang.String string)
        This method sets the current order channel.
        Parameters:
        string - The current order channel
      • getOrderCannel

        public java.lang.String getOrderCannel()
        This method gets the current order channel.
        Returns:
        orderChannel The current order channel
      • setPaymentGroupId

        public void setPaymentGroupId(java.lang.String string)
        This method sets the current payment group id.
        Parameters:
        string - The current payment group id.
      • getStoreId

        public java.lang.Integer getStoreId()
        This method gets the current store id.
        Returns:
        storeId The current store id.
      • setStoreId

        public void setStoreId(java.lang.Integer integer)
        This method sets the current store id.
        Parameters:
        integer - The current store id.