com.ibm.commerce.payments.plugin.samples

Class PluginAdapterBean

  • java.lang.Object
    • com.ibm.commerce.payments.plugin.samples.PluginAdapterBean
  • All Implemented Interfaces:
    java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean
    Direct Known Subclasses:
    QueryablePluginAdapterBean


    public abstract class PluginAdapterBean
    extends java.lang.Object
    implements javax.ejb.SessionBean
    The abstract base class for plug-in adapter bean implementations.
    See Also:
    Serialized Form
    • Constructor Detail

      • PluginAdapterBean

        public PluginAdapterBean()
    • Method Detail

      • getSessionContext

        public javax.ejb.SessionContext getSessionContext()
        getSessionContext
        Returns:
        SessionContext
      • setSessionContext

        public void setSessionContext(javax.ejb.SessionContext ctx)
        This method returns the SessionContext.
        Specified by:
        setSessionContext in interface javax.ejb.SessionBean
        Parameters:
        ctx - SessionContext
      • ejbCreate

        public void ejbCreate()
                       throws javax.ejb.CreateException
        This is the implementation method of ejbCreate(It does nothing here).
        Throws:
        javax.ejb.CreateException
      • ejbActivate

        public void ejbActivate()
        This is the implementation method of ejbActivate(It does nothing here).
        Specified by:
        ejbActivate in interface javax.ejb.SessionBean
      • ejbPassivate

        public void ejbPassivate()
        This is the implementation method of ejbPassivate(It does nothing here).
        Specified by:
        ejbPassivate in interface javax.ejb.SessionBean
      • ejbRemove

        public void ejbRemove()
        This is the implementation method of ejbRemove(It does nothing here).
        Specified by:
        ejbRemove in interface javax.ejb.SessionBean
      • approve

        public FinancialTransaction approve(PluginContext pluginContext,
                                            FinancialTransaction paymentTransaction,
                                            boolean retry)
                                     throws PluginException
        This method executes the approve transaction.
        Parameters:
        pluginContext - The plugin context.
        paymentTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • approveAndDeposit

        public FinancialTransaction approveAndDeposit(PluginContext pluginContext,
                                                      FinancialTransaction depositTransaction,
                                                      boolean retry)
                                               throws PluginException
        This method executes the approve and deposit payment transaction.
        Parameters:
        pluginContext - The plugin context.
        depositTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • checkPaymentInstruction

        public void checkPaymentInstruction(PluginContext pluginContext,
                                            PaymentInstruction paymentInstruction)
                                     throws PluginException
        This method checks the payment instruction.
        Parameters:
        pluginContext - The plugin context.
        paymentInstruction - The payment transaction that need to be executed.
        Throws:
        PluginException
      • credit

        public FinancialTransaction credit(PluginContext pluginContext,
                                           FinancialTransaction creditTransaction,
                                           boolean retry)
                                    throws PluginException
        This method executes the credit payment transaction.
        Parameters:
        pluginContext - The plugin context.
        creditTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • deposit

        public FinancialTransaction deposit(PluginContext pluginContext,
                                            FinancialTransaction paymentTransaction,
                                            boolean retry)
                                     throws PluginException
        This method executes the deposit payment transaction.
        Parameters:
        pluginContext - The plugin context.
        paymentTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • getMessage

        public java.lang.String getMessage(PluginContext pluginContext,
                                           java.lang.String messageKey)
                                    throws PluginException
        This method returns the message from the pluginContext according to the message key.
        Parameters:
        pluginContext - The plugin context.
        messageKey - A String indicating the message key.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • reverseApproval

        public FinancialTransaction reverseApproval(PluginContext pluginContext,
                                                    FinancialTransaction paymentTransaction,
                                                    boolean retry)
                                             throws PluginException
        This method executes the reverse approval payment transaction.
        Parameters:
        pluginContext - The plugin context.
        paymentTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • reverseCredit

        public FinancialTransaction reverseCredit(PluginContext pluginContext,
                                                  FinancialTransaction creditTransaction,
                                                  boolean retry)
                                           throws PluginException
        This method executes the reverse credit payment transaction.
        Parameters:
        pluginContext - The plugin context.
        creditTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • reverseDeposit

        public FinancialTransaction reverseDeposit(PluginContext pluginContext,
                                                   FinancialTransaction paymentTransaction,
                                                   boolean retry)
                                            throws PluginException
        This method executes the reverse deposit transaction.
        Parameters:
        pluginContext - The plugin context.
        paymentTransaction - The payment transaction that need to be executed.
        retry - A boolean indicating if this action should retry in case of failure.
        Returns:
        FinancialTransaction
        Throws:
        PluginException
      • validatePaymentInstruction

        public void validatePaymentInstruction(PluginContext pluginContext,
                                               PaymentInstruction paymentInstruction)
                                        throws PluginException
        This method validates the payment instruction.
        Parameters:
        pluginContext - The plugin context.
        paymentInstruction - The payment transaction that need to be executed.
        Throws:
        PluginException