Skip to content

A default currency plugin based on a set of static currency conversion tables

License

Notifications You must be signed in to change notification settings

killbill/killbill-currency-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

killbill-currency-plugin

A default currency plugin based on a set of static currency conversion tables.

Kill Bill compatibility

Plugin version Kill Bill version
0.0.y 0.22.z
1.0.y 0.24.z

Requirements

The plugin needs a database. The latest version of the schema can be found here.

Development

To install the plugin from sources:

kpm install_java_plugin currency --from-source-file target/currency-*-SNAPSHOT.jar --destination /var/tmp/bundles

REST API

To add currency conversion rates for a given base currency and date:

curl -v \
     -X POST \
     -u admin:password \
     -H 'X-Killbill-ApiKey: bob' \
     -H 'X-Killbill-ApiSecret: lazar' \
     -H 'X-Killbill-CreatedBy: admin' \
     -H 'Content-Type: application/json' \
     -d '{"baseCurrency":"USD","conversionDate":"2013-10-10T20:41:09Z","rates":{"BRL":"0.45721","EUR":"1.38045","GBP":"1.61650"}}' \
     http://127.0.0.1:8080/plugins/killbill-currency/rates

To get all current rates for a given base currency:

curl -v \
     -u admin:password \
     -H 'X-Killbill-ApiKey: bob' \
     -H 'X-Killbill-ApiSecret: lazar' \
     'http://127.0.0.1:8080/plugins/killbill-currency/rates?baseCurrency=USD'

Usage in a custom plugin

Create a ServiceTracker to track the CurrencyPluginApi:

ServiceTracker<CurrencyPluginApi, CurrencyPluginApi> currencyPluginApiServiceTracker = new ServiceTracker<>(context, CurrencyPluginApi.class, null);
currencyPluginApiServiceTracker.open();

The API can then be used in your plugin, e.g.:

currencyPluginApiServiceTracker.getService().getBaseCurrencies()

About

Kill Bill is the leading Open-Source Subscription Billing & Payments Platform. For more information about the project, go to https://killbill.io/.

About

A default currency plugin based on a set of static currency conversion tables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages