com.ibm.commerce.payments.plugin

Interface QueryablePlugin

  • All Superinterfaces:
    Plugin


    public interface QueryablePlugin
    extends Plugin

    This interface is implemented by payment plug-ins that support financial queries.

    In general, the Payment Plug-in Controller manages the state of financial objects for plug-ins. However, if the payment back-end system supports real time queries, the plug-in writer might want to leverage this capability by implementing this interface.

    This approach has the advantage to provide real-time and up-to-date status of financial objects (payments and credits). However, it causes more network connectivity than it may otherwise be required.

    If the payment back-end system does not support real-time queries then this interface should not be implemented.

    When a plug-in implements this interface but some of the query methods are not supported by the back-end system, the plug-in should throw FunctionNotSupportedException in these methods.

    When the Payment Plug-in Controller invokes a plug-in query method and receives a FunctionNotSupportedException, it uses its own persisted information to process the query request. For example, if getCredit(PluginContext, Credit) is invoked, and FunctionNotSupportedException is thrown, the Payment Plug-in Controller will use its own information regarding the target Credit container.

    • Field Detail

      • COPYRIGHT

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

      • getAvailableBalance

        java.math.BigDecimal getAvailableBalance(PluginContext pluginContext,
                                                 PaymentInstruction paymentInstruction)
                                          throws FunctionNotSupportedException

        This method gets the available balance for the specified PaymentInstruction account.

        This methods is typically used for stored-value cards, gift cards, gift certificates or credit line (or line of credit) implementations.

        Parameters:
        pluginContext - The plug-in context to be used in this request.
        paymentInstruction - The PaymentInstruction container for which the balance needs to be obtained.
        Returns:
        The available amount that can be consumed in the payment instruction; null if the value cannot be retrieved.
        Throws:
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        RemoteException - Thrown by the EJB container as part of the EJB specification.
        FunctionNotSupportedException
      • getCredit

        Credit getCredit(PluginContext pluginContext,
                         Credit credit)
                  throws FunctionNotSupportedException

        This method refreshes the current attributes of the Credit container.

        The Payment Plug-in controller provides a fully pre-populated Credit container as input. The plug-in determines which attributes have changed and updates those attributes on the returned object.

        Note that the Credit parameter can be used as the object to be returned. However, only the changes made on the actual returned Credit container object will be processed. Changes in the container parameter passed in will be ignored.

        Parameters:
        pluginContext - The plug-in context to be used in this request.
        credit - The pre-populated Credit container.
        Returns:
        The updated Credit container object.
        Throws:
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        RemoteException - Thrown by the EJB container as part of the EJB specification.
        FunctionNotSupportedException
      • getPayment

        Payment getPayment(PluginContext pluginContext,
                           Payment payment)
                    throws FunctionNotSupportedException

        This method refreshes the current attributes of the Payment container.

        The Payment Plug-in Controller provides a fully pre-populated Payment container as input. The plug-in determines which attributes have changed and updates those attributes on the returned object.

        Note that the Payment parameter can be used as the object to be returned. However, only the changes made on the actual returned Payment container object will be processed. Changes in the container parameter passed in will be ignored.

        Parameters:
        pluginContext - The plug-in context to be used in this request.
        payment - The pre-populated Payment container.
        Returns:
        The updated Payment container object.
        Throws:
        PluginException - Thrown when any exception conditions specified by the PluginException hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.
        RemoteException - Thrown by the EJB container as part of the EJB specification.
        FunctionNotSupportedException