What is a Kill Bill Plugin

Kill Bill Plugins are based on the OSGI Standard. They provide a way to write isolated code on top of the Kill Bill platform and interact with the system through different ways:

  • They can be called from the Kill Bill platform through Plugin APIs. This happens when a plugin that implements one of those APIs (or 'SPI' to be more precise) was correctly registered in the system.

  • They can receive bus events from the Kill Bill platform.

  • They can make API calls to Kill Bill.

Types of Plugins

A Kill Bill plugin can either listen to Kill Bill bus events to be notified of changes and take appropriate actions and/or implement one (or several) plugin API(s). Thus, there are mainly two main types of plugins as follows:

It often makes sense to specialize plugins and have them implement only one of the plugin APIs, but this is a design choice, and there is nothing preventing a plugin from implementing multiple APIs. Although we don’t recommend it, a plugin could implement the PaymentPluginApi and the PaymentControlPluginApi, and that would qualify it as a 'payment and payment control plugin'.

How can Plugins be Used

Kill Bill Plugins can be used in a variety of ways:

  • Extend Kill Bill subsystem: Payment plugins are a good example of such plugins; they extend the core payment functionality by connecting to third party systems.

  • Provide additional business logic: Payment control plugins and invoice plugins allow to intercept the requests so as to modify it, abort it, or change state on the fly.

  • Listen to system events: Notification plugins listen to system events and take appropriate actions. For example, the analytics plugin can be used to build reports while the email notification plugin can be used to send emails.

  • Expose HTTP endpoints: Plugins can also export their own HTTP endpoints under a /plugins/<pluginName> namespace. These can then be invoked via a REST client as required.

Examples of Plugins

The Kill Bill team already provides many open source plugins. Some of these are are follows:

Plugin NameType

Analytics plugin

notification plugin

Email notification plugin

notification plugin

Adyen plugin

payment plugin

Accertify plugin

payment control plugin

Coupon plugin

entitlement plugin

Avalara plugin

invoice plugin

Catalog test plugin

catalog plugin

You can check the Kill Bill Github page for the complete list of plugins maintained by the Kill Bill team.

Some Important Notes

Kill Bill Plugins have full power (and therefore need to be designed and tested carefully):

  • They have access to the database so as to maintain their own state. However they should not interact with the Kill Bill core tables directly but rely on APIs to retrieve and change state.

  • They have access to system properties.

  • They receive all events in the system.

  • They are isolated from the rest of the code and can use their own libraries (versions) without risk of conflict.