com.ibm.commerce.payments.plugincontroller.plugin

Class PluginAdapter

  • java.lang.Object
    • com.ibm.commerce.payments.plugincontroller.plugin.PluginAdapter
  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    PluginAdapter_V1


    public abstract class PluginAdapter
    extends java.lang.Object
    implements java.lang.Cloneable

    The PluginAdapter is used to provide a consistent API for PluginController to call plugin. Different plugin specification version will provide different subclass of PluginAdapter. For plugin specification ver_1, PluginAdapter_V1 is provided. The PluginController calls PluginFactory to find or create the appropriate PluginAdapter. It maybe implements different plugin spec version, sets the required parameters and invokes payment action against the PluginAdapter. The PluginAdapter in turn calls plugin to process the transaction. The process flow is:
    1. PPC client (EDP) invokes appropriate payment action determine by EDP rules and configuration.
    2. PPC ask the Factory to get the Plugin to process this payment action.
    3. PluginFactory finds or create the appropriate PluginAdapter.
    4. PPC invokes payment action against the PluginAdapter.
    5. PluginAdatpter created the appropriate object within the Object Model.
    6. PluginAdatpter builds the appropriate information for the plugin to process the request per the plugin specification.
    7. PluginAdatpter invokes payment action against it associated Plugin.
    8. Plugin send request to back-end system.
    9. Plugin returns and PluginAdapter updates Object Model.
    10. PluginAdatpter returns and PPC retrieves the object from the database.
    11. PPC builds the appropriate value and returns to PPC Client.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PluginAdapter()
      This method is a default constructor for PaymentPlugin.
      PluginAdapter(PluginConfigurationImpl aPluginData, boolean queriesSupportedFlag)
      This method is a constructor with a plugin configuration data.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      abstract void approve() 
      abstract void approveAndDeposit() 
      abstract boolean checkHealth() 
      abstract void checkPaymentInstruction() 
      java.lang.Object clone()
      This method overrides the clone() function of Object.
      abstract void credit() 
      abstract void deposit() 
      java.util.Map getAdditionalInformation()
      This method returns the additional information.
      abstract java.lang.String getAuthenticationURL()
      This method sends the build popup URL of punch-out payment to plugin, then gets the URL.
      abstract java.math.BigDecimal getAvailableBalance() 
      abstract void getBatch()
      This method gets the batch results from the paymentech back end.
      java.util.Map getCallBackRequest()
      This method returns the parameters from callback request.
      abstract void getCredit() 
      com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData getCreditData()
      This method gets the data bean of PPCCredit object , used as the parameter between PPC and PluginAdapter.
      java.lang.Throwable getInitException()
      This method checks if there is some exception during the plugin initialization, use this method to get the exception.
      java.util.HashMap getKeywordConf()
      This method gets the configurations for the keywords: mask, plain, searchable, removeAfterApproval.
      java.util.HashMap getKeywordsMapping()
      This method sets the keywords mapping.
      abstract java.lang.String getMessage(java.lang.String messageKey, java.util.Locale locale) 
      java.lang.String getOrderChannelId()
      This method returns the order channel identifier.
      com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData getPayInstData()
      This method gets the data bean of PPCPayInst object, used as the parameter between PPC and PluginAdapter.
      abstract void getPayment() 
      com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData getPaymentData()
      This method gets the data bean of PPCPayment object , used as the parameter between PPC and PluginAdapter.
      java.lang.String getPaymentGroupId()
      This method gets the payment group id.
      java.util.Map getPaymentSentivieData() 
      com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData getPayTranData()
      This method gets the data bean of PPCPayTran object, used as the parameter between PPC and PluginAdapter.
      java.util.Collection getPiExtendedDataCollect()
      This method gets the collection of PPCExtDataData which are associated to the PPCPayInst, used as the parameter between PPC and PluginAdapter.
      PluginConfigurationImpl getPluginConfigurationData()
      This method gets the PluginConfigurationImpl.
      PluginConfigurationImpl getPluginData()
      This method gets the plugin configuration data.
      PluginException getPluginException()
      This method gets the plugin exception.
      java.util.HashMap getPluginPaymentInstructionProtocolPropertyConfigColl()
      This method gets the list of properties in plugin deployment description, defines how plugin expect PPC handle payment instruction protocol data DB persistence.
      com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData getPPCBatchData()
      This method returns the current batch data access bean.
      java.math.BigDecimal getRequestedAmount()
      This method gets the amount which PPC asks the plugin to process.
      java.util.Locale getTargetLocale()
      This method gets the targetLocale.
      java.util.Collection getTxExtendedDataCollect()
      This method gets the collection of PPCExtDataData which are associated to the PPCPayTran, used as the parameter between PPC and PluginAdapter.
      abstract void initAuthenticationSession()
      This method sends the build popup URL of punch-out payment to plugin, then gets the URL.
      boolean isPaymentRequiresAttention()
      This method checks if the Payment requires attention though it is successful.
      abstract boolean isPluginLoaded()
      This method checks if this plugin is loaded successfully.
      boolean isQueriesSupported()
      This method checks if this plugin support the query api (PaymentQuery).
      boolean isRecoverable()
      This method checks if the PaymentInstruction can be used for further transaction in the future when the transaction fails.
      boolean isRetry()
      This method checks if this payment action is to retry.
      abstract java.lang.String preprocessProviderResponseData()
      This method executes the verification with PSP and gets the result of payment processing.
      abstract java.util.Map processProviderResponse()
      This method executes the verification with PSP and gets the result of payment processing.
      abstract void reverseApproval() 
      abstract void reverseCredit() 
      abstract void reverseDeposit() 
      void setAdditionalInformation(java.util.Map localAdditionalInformation)
      This method sets the additional information.
      void setCallBackRequest(java.util.Map params)
      This method sets the parameters from callback request.
      void setCreditData(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData data)
      This method sets the data bean of PPCCredit object , used as the parameter between PPC and PluginAdapter.
      void setInitException(java.lang.Throwable exception)
      This method checks if there is some exception during the plugin initialization, use this method to set it.
      void setKeywordConf(java.util.HashMap map)
      This method sets the configurations for the keywords: mask, plain, searchable, removeAfterApproval.
      void setKeywordsMapping(java.util.HashMap map)
      This method sets the keywords mapping.
      void setOmf(com.ibm.commerce.payments.plugincontroller.beans.ObjectModuleFacadeBean local)
      This method sets the local interface of ObjectModuleFacade.
      void setOrderChannelId(java.lang.String orderChannelId)
      This method sets the order channel identifier.
      void setPayInstData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData data)
      This method sets the data bean of PPCPayInst object , used as the parameter between PPC and PluginAdapter.
      void setPaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData data)
      This method sets the data bean of PPCPayment object , used as the parameter between PPC and PluginAdapter.
      void setPaymentGroupId(java.lang.String string)
      This method sets the payment group id.
      void setPaymentRequiresAttention(boolean b)
      This method sets the flag if the Payment requires attention though it is successful.
      void setPaymentSentivieData(java.util.Map localPaymentSentivieData) 
      void setPayTranData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData data)
      This method sets the data bean of PPCPayTran object , used as the parameter between PPC and PluginAdapter.
      void setPiExtendedDataCollect(java.util.Collection collection)
      This method sets the collection of PPCExtDataData which are associated to the PPCPayInst, used as the parameter between PPC and PluginAdapter.
      void setPluginConfigurationData(PluginConfigurationImpl pluginConfigurationData)
      This method sets the PluginConfigurationImpl.
      void setPluginData(PluginConfigurationImpl impl)
      This method sets the plugin configuration data.
      void setPluginException(PluginException exception)
      This method sets the plugin exception.
      void setPluginPaymentInstructionProtocolPropertyConfigColl(java.util.HashMap collection)
      This method sets the plugin payment instruction protocol property configuration collection
      void setPPCBatchData(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData localPPCBatchData)
      This method sets the current batch data access bean.
      void setQueriesSupported(boolean b)
      This method marks if the query is supported.
      void setRecoverable(boolean b)
      This method sets the flag to mark if the PaymentInstruction can be used for further transaction in the future.
      void setRequestedAmount(java.math.BigDecimal decimal)
      This method sets the amount which PPC asks the plugin to process.
      void setRetry(boolean b)
      This method marks id retry is enabled.
      void setTargetLocale(java.util.Locale localTargetLocale)
      This method sets the targetLocale.
      abstract void settleBatch(boolean forceClose)
      This method sends the batch request that contains all the credit/deposit transactions need to be batched by calling the batch API of the plugins.
      void setTxExtendedDataCollect(java.util.Collection collection)
      This method sets the collection of PPCExtDataData which are associated to the PPCPayTran, used as the parameter between PPC and PluginAdapter.
      java.lang.String toString()
      This method gets a human-readable representation of this object.
      abstract void validatePaymentInstruction() 
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

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

      • PluginAdapter

        public PluginAdapter(PluginConfigurationImpl aPluginData,
                             boolean queriesSupportedFlag)
        This method is a constructor with a plugin configuration data.
        Parameters:
        aPluginData - The plugin configuration data for this plugin adapter.
        queriesSupportedFlag - The flag indicates if the queries is supported.
      • PluginAdapter

        public PluginAdapter()
        This method is a default constructor for PaymentPlugin.
    • Method Detail

      • preprocessProviderResponseData

        public abstract java.lang.String preprocessProviderResponseData()
                                                                 throws InternalException,
                                                                        CommunicationException
        This method executes the verification with PSP and gets the result of payment processing. The result of payment processing has been put into piExtendedDataCollect.
        Returns:
        payment instruction id key.
        Throws:
        InternalException
        CommunicationException
      • setPayInstData

        public final void setPayInstData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData data)
        This method sets the data bean of PPCPayInst object , used as the parameter between PPC and PluginAdapter.
        Parameters:
        data - The data bean of PPCPayInst object.
      • getPayInstData

        public final com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData getPayInstData()
        This method gets the data bean of PPCPayInst object, used as the parameter between PPC and PluginAdapter.
        Returns:
        The PPC payment instruction data.
      • getPayTranData

        public final com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData getPayTranData()
        This method gets the data bean of PPCPayTran object, used as the parameter between PPC and PluginAdapter.
        Returns:
        PPCPayTranData.
      • setPluginConfigurationData

        public final void setPluginConfigurationData(PluginConfigurationImpl pluginConfigurationData)
        This method sets the PluginConfigurationImpl.
        Parameters:
        pluginConfigurationData - The PluginConfigurationImpl to set.
      • getPluginConfigurationData

        public final PluginConfigurationImpl getPluginConfigurationData()
        This method gets the PluginConfigurationImpl.
        Returns:
        The PluginConfigurationImpl.
      • setRetry

        public final void setRetry(boolean b)
        This method marks id retry is enabled.
        Parameters:
        b - The retry flag.
      • isRetry

        public final boolean isRetry()
        This method checks if this payment action is to retry.
        Returns:
        If this payment action is to retry.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException

        This method overrides the clone() function of Object. The PluginFactory will keep a hashmap of plugin's name and the plugin's plugin adapter. When PPC call the PluginFactory to get the plugin adapter's implementation, a clone of the one in the hashmap will return to PPC.

        Overrides:
        clone in class java.lang.Object
        Returns:
        The clone of this object.
        Throws:
        java.lang.CloneNotSupportedException - Thrown when the clone is not supported.
      • setCreditData

        public final void setCreditData(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData data)
        This method sets the data bean of PPCCredit object , used as the parameter between PPC and PluginAdapter.
        Parameters:
        data - The data bean of PPCCredit object.
      • getCreditData

        public final com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData getCreditData()
        This method gets the data bean of PPCCredit object , used as the parameter between PPC and PluginAdapter.
        Returns:
        The PPCCreditData.
      • setPayTranData

        public final void setPayTranData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData data)
        This method sets the data bean of PPCPayTran object , used as the parameter between PPC and PluginAdapter.
        Parameters:
        data - The data bean of PPCPayTran object.
      • setPaymentData

        public final void setPaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData data)
        This method sets the data bean of PPCPayment object , used as the parameter between PPC and PluginAdapter.
        Parameters:
        data - The data bean of PPCPayment object.
      • getPaymentData

        public final com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData getPaymentData()
        This method gets the data bean of PPCPayment object , used as the parameter between PPC and PluginAdapter.
        Returns:
        The PPCPaymentData.
      • setPaymentRequiresAttention

        public final void setPaymentRequiresAttention(boolean b)
        This method sets the flag if the Payment requires attention though it is successful.
        Parameters:
        b - The flag.
      • isPaymentRequiresAttention

        public final boolean isPaymentRequiresAttention()
        This method checks if the Payment requires attention though it is successful.
        Returns:
        If the Payment requires attention though it is successful.
      • setPiExtendedDataCollect

        public final void setPiExtendedDataCollect(java.util.Collection collection)
        This method sets the collection of PPCExtDataData which are associated to the PPCPayInst, used as the parameter between PPC and PluginAdapter.
        Parameters:
        collection - The collection of PPCExtDataData.
      • getPiExtendedDataCollect

        public final java.util.Collection getPiExtendedDataCollect()
        This method gets the collection of PPCExtDataData which are associated to the PPCPayInst, used as the parameter between PPC and PluginAdapter.
        Returns:
        Collection The collection of PPCExtDataData.
      • isPluginLoaded

        public abstract boolean isPluginLoaded()
        This method checks if this plugin is loaded successfully.
        Returns:
        If this plugin is loaded successfully.
      • setKeywordConf

        public final void setKeywordConf(java.util.HashMap map)
        This method sets the configurations for the keywords: mask, plain, searchable, removeAfterApproval. Please see the PaymentSystemPluginMapping.xml for detail.
        Parameters:
        map - The HashMap of the Keyword configurations. The key is Keyword.getName(), the value is Keyword.
      • getKeywordConf

        public final java.util.HashMap getKeywordConf()
        This method gets the configurations for the keywords: mask, plain, searchable, removeAfterApproval. Please see the PaymentSystemPluginMapping.xml for detail.
        Returns:
        The HashMap of the Keyword configurations. The key is Keyword.getName(), the value is Keyword.
      • setKeywordsMapping

        public final void setKeywordsMapping(java.util.HashMap map)
        This method sets the keywords mapping.
        Parameters:
        map - The keywords mapping.
      • getKeywordsMapping

        public final java.util.HashMap getKeywordsMapping()
        This method sets the keywords mapping.
        Returns:
        The keywords mapping.
      • setOmf

        public final void setOmf(com.ibm.commerce.payments.plugincontroller.beans.ObjectModuleFacadeBean local)
        This method sets the local interface of ObjectModuleFacade.
        Parameters:
        local - The local interface of ObjectModuleFacade.
      • setPaymentGroupId

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

        public final java.lang.String getPaymentGroupId()
        This method gets the payment group id.
        Returns:
        The payment group id.
      • setPluginData

        public final void setPluginData(PluginConfigurationImpl impl)
        This method sets the plugin configuration data.
        Parameters:
        impl - The plugin configuration .
      • getPluginData

        public final PluginConfigurationImpl getPluginData()
        This method gets the plugin configuration data.
        Returns:
        The plugin configuration data.
      • setPluginException

        public final void setPluginException(PluginException exception)
        This method sets the plugin exception.
        Parameters:
        exception - The plugin exception.
      • getPluginException

        public final PluginException getPluginException()
        This method gets the plugin exception.
        Returns:
        The plugin exception.
      • setQueriesSupported

        public final void setQueriesSupported(boolean b)
        This method marks if the query is supported.
        Parameters:
        b - If the query is supported.
      • isQueriesSupported

        public final boolean isQueriesSupported()
        This method checks if this plugin support the query api (PaymentQuery).
        Returns:
        If this plugin supports the query api (PaymentQuery).
      • setRecoverable

        public final void setRecoverable(boolean b)
        This method sets the flag to mark if the PaymentInstruction can be used for further transaction in the future.
        Parameters:
        b - The flag for PaymentInstruction.
      • isRecoverable

        public final boolean isRecoverable()
        This method checks if the PaymentInstruction can be used for further transaction in the future when the transaction fails.
        Returns:
        if the PaymentInstruction can be used for further transaction in the future when the transaction fails.
      • setRequestedAmount

        public final void setRequestedAmount(java.math.BigDecimal decimal)
        This method sets the amount which PPC asks the plugin to process.
        Parameters:
        decimal - The amount which PPC asks the plugin to process.
      • getRequestedAmount

        public final java.math.BigDecimal getRequestedAmount()
        This method gets the amount which PPC asks the plugin to process.
        Returns:
        The amount which PPC asks the plugin to process.
      • setTargetLocale

        public final void setTargetLocale(java.util.Locale localTargetLocale)
        This method sets the targetLocale.
        Parameters:
        localTargetLocale - The targetLocale to set.
      • getTargetLocale

        public final java.util.Locale getTargetLocale()

        This method gets the targetLocale. This is the Locale used by the target Client (store front or CSR applications). The controller will set this value on every request so the plugin can return the appropriate translated message in the Exceptions.

        Returns:
        Locale The targetLocale.
      • setOrderChannelId

        public final void setOrderChannelId(java.lang.String orderChannelId)
        This method sets the order channel identifier.
        Parameters:
        orderChannelId - The order channel identifier to set.
      • getOrderChannelId

        public final java.lang.String getOrderChannelId()
        This method returns the order channel identifier.
        Returns:
        the order channel identifier.
      • setTxExtendedDataCollect

        public final void setTxExtendedDataCollect(java.util.Collection collection)
        This method sets the collection of PPCExtDataData which are associated to the PPCPayTran, used as the parameter between PPC and PluginAdapter.
        Parameters:
        collection - The collection of PPCExtDataData.
      • getTxExtendedDataCollect

        public final java.util.Collection getTxExtendedDataCollect()
        This method gets the collection of PPCExtDataData which are associated to the PPCPayTran, used as the parameter between PPC and PluginAdapter.
        Returns:
        Collection The collection of PPCExtDataData.
      • setInitException

        public final void setInitException(java.lang.Throwable exception)
        This method checks if there is some exception during the plugin initialization, use this method to set it.
        Parameters:
        exception - The exception during the plugin initialization.
      • getInitException

        public final java.lang.Throwable getInitException()
        This method checks if there is some exception during the plugin initialization, use this method to get the exception.
        Returns:
        The exception during the plugin initialization.
      • setPluginPaymentInstructionProtocolPropertyConfigColl

        public final void setPluginPaymentInstructionProtocolPropertyConfigColl(java.util.HashMap collection)
        This method sets the plugin payment instruction protocol property configuration collection
        Parameters:
        collection - The collection to set.
      • getPluginPaymentInstructionProtocolPropertyConfigColl

        public final java.util.HashMap getPluginPaymentInstructionProtocolPropertyConfigColl()
        This method gets the list of properties in plugin deployment description, defines how plugin expect PPC handle payment instruction protocol data DB persistence. It tells PPC if one property should be saved to DB when create PPC payment instruction.
        Returns:
        a Collection of property configurations.
      • getPPCBatchData

        public com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData getPPCBatchData()
        This method returns the current batch data access bean.
        Returns:
        Returns the current batch data access bean.
      • setPPCBatchData

        public void setPPCBatchData(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData localPPCBatchData)
        This method sets the current batch data access bean.
        Parameters:
        localPPCBatchData - the current batch data access bean.
      • toString

        public java.lang.String toString()
        This method gets a human-readable representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A human-readable representation of this object.
      • getPaymentSentivieData

        public java.util.Map getPaymentSentivieData()
        Returns:
        Returns the paymentSentivieData.
      • setPaymentSentivieData

        public void setPaymentSentivieData(java.util.Map localPaymentSentivieData)
        Parameters:
        localPaymentSentivieData - The paymentSentivieData to set.
      • getAdditionalInformation

        public java.util.Map getAdditionalInformation()
        This method returns the additional information.
        Returns:
        Returns the additionalInformation.
      • setAdditionalInformation

        public void setAdditionalInformation(java.util.Map localAdditionalInformation)
        This method sets the additional information.
        Parameters:
        localAdditionalInformation - The additionalInformation to set.
      • setCallBackRequest

        public void setCallBackRequest(java.util.Map params)
        This method sets the parameters from callback request.
        Parameters:
        params -
      • getCallBackRequest

        public java.util.Map getCallBackRequest()
        This method returns the parameters from callback request.
        Returns:
        Map