com.ibm.commerce.payments.plugin.loc.beans

Class LOCPluginBean

  • java.lang.Object
    • com.ibm.commerce.payments.plugin.loc.beans.LOCPluginBean
  • All Implemented Interfaces:
    Plugin


    public class LOCPluginBean
    extends java.lang.Object
    implements Plugin
    • Field Detail

    • Constructor Detail

      • LOCPluginBean

        public LOCPluginBean()
    • Method Detail

      • getMessage

        public java.lang.String getMessage(PluginContext pluginContext,
                                           java.lang.String messageKey)
        This method returns the message from the PluginContext according to the key of the message.
        Specified by:
        getMessage in interface Plugin
        Parameters:
        pluginContext - The plug-in context to be used in this request.
        messageKey - The error unique key.
        Returns:
        The translated error message if available; otherwise the messageKey itself.
        See Also:
        Plugin.getMessage(PluginContext,String)
      • approve

        public FinancialTransaction approve(PluginContext pluginContext,
                                            FinancialTransaction paymentTransaction,
                                            boolean retry)
                                     throws CommunicationException,
                                            PluginException
        This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.
        Specified by:
        approve in interface Plugin
        Parameters:
        pluginContext - Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.
        paymentTransaction - Contains the payment instruction and the amount requested to be approved.
        retry - Indicates if this is a retry of the operation or not.
        Returns:
        The financial transaction.
        Throws:
        PluginInvalidParameterException - raised with message PLUGIN_PARAMS_INVALID whenever account number or storeid or buyerorgid the payment transaction associated to is null.
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        CommunicationException
        See Also:
        Plugin.approve(PluginContext,FinancialTransaction,boolean)
      • credit

        public FinancialTransaction credit(PluginContext pluginContext,
                                           FinancialTransaction creditTransaction,
                                           boolean retry)
                                    throws PluginException
        This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.
        Specified by:
        credit in interface Plugin
        Parameters:
        pluginContext - Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.
        creditTransaction - Contains the amount and other data required to process the action.
        retry - Indicates if his is a retry of the operation or not.
        Returns:
        The credit transaction.
        Throws:
        InvalidDataException - raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of PaymentInstruction the transaction associated to is null.
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        See Also:
        Plugin.credit(PluginContext,FinancialTransaction,boolean)
      • deposit

        public FinancialTransaction deposit(PluginContext pluginContext,
                                            FinancialTransaction paymentTransaction,
                                            boolean retry)
                                     throws PluginException
        This method receives the deposit request, checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.
        Specified by:
        deposit in interface Plugin
        Parameters:
        pluginContext - Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.
        paymentTransaction - Contains the amount and other data required to process the action.
        retry - Indicates if his is a retry of the operation or not.
        Returns:
        The financial transaction.
        Throws:
        InvalidDataException - raised with message PLUGIN_PARAMS_INVALID when account number or storeid or buyerorgid the payment transaction associated to is null.
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        See Also:
        Plugin.deposit(PluginContext,FinancialTransaction,boolean)
      • postConstruct

        @PostConstruct
        public void postConstruct()
        This method is the implementation of the ejbCreate() method. It calls the method LOCPluginInitializer.init() to make sure LOCPlugin logger initialization has run.
        Throws:
        javax.ejb.CreateException
      • reverseApproval

        public FinancialTransaction reverseApproval(PluginContext pluginContext,
                                                    FinancialTransaction paymentTransaction,
                                                    boolean retry)
                                             throws CommunicationException,
                                                    PluginException
        This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.
        Specified by:
        reverseApproval in interface Plugin
        Parameters:
        pluginContext - Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.
        paymentTransaction - Contains the amount and other data required to process the action.
        retry - Indicates if his is a retry of the operation or not.
        Returns:
        The financial transaction.
        Throws:
        InvalidDataException - raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of PaymentInstruction the transaction associated to is null.
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        CommunicationException
        See Also:
        Plugin.reverseApproval(PluginContext,FinancialTransaction,boolean)
      • checkHealth

        public boolean checkHealth()

        This method checks whether XML configuration for the Plugin is available. For the SimpleOffline, if the XML file is missing, or renamed, or its content is invalid, then false is returned; otherwise true is returned. And for other Plugin, always true is returned since no corresponding XML configuration file exists.

        This API is used by PluginFactory in accelerator. When false is returned, PluginFacotry will not put this plugin into the available collection. And further it will not be listed in the available payment methods in accelerator.

        Specified by:
        checkHealth in interface Plugin
        Returns:
        A boolean that is true if the XML configuration for the Plugin is available,otherwise false.