Killbill as collection agent

97 views
Skip to first unread message

anug...@gmail.com

unread,
Aug 9, 2016, 8:23:29 PM8/9/16
to Kill Bill developers mailing-list
Hi Pierre,


We would like to check whether we can use killbill for below given use case.

1. Extend tenant table to act as merchant with debiting credit accounts .

2. To use accounts as customer accounts who can pay for invoices created by merchant .

In other words is it possible to customize killbill to work as a collection agent ? For collecting money from customer and pay to merchant ?

Thanks
Anu

Pierre-Alexandre Meyer

unread,
Aug 9, 2016, 9:14:18 PM8/9/16
to anug...@gmail.com, Kill Bill developers mailing-list
Hi Anu,

On Tue, Aug 9, 2016 at 5:23 PM, <anug...@gmail.com> wrote:
1. Extend tenant table to act as merchant with debiting credit accounts .

I'm not quite sure why you would want to extend that table. Can you give me an example of fields you would add?

Typically, payment methods information (credit card details, bank accounts, etc.) are stored in the plugin tables (i.e. in the plugin associated with the gateway/processor/bank). Operations (debiting or crediting money) are then triggered on a given payment method.


2. To use accounts as customer accounts who can pay for invoices created by merchant .

The current model should already let you do this. Unless you have something specific in mind that may not be supported? 

In other words is it possible to customize  killbill to work as a collection agent ? For collecting money from customer and pay to merchant ?

At a high level, yes. The only difficult part is to customize the disbursement model (i.e. paying the merchant). This will depend how you want to pay him, which frequency, how you will take your fees, etc.

For example, it could be done using a control plugin (http://docs.killbill.io/0.16/payment_control_plugin.html) which would collect your fees and count how much money should be disbursed, and trigger the movement of the money (via the CREDIT operation of the payment plugin api).

By the way, this assumes that you will take all the money from the customers into your bank account and then trigger a movement of money from your bank account to the merchants. An alternative model would be to do split payments, if supported by the third-party processor (not all support it).

Does that make sense?

--
Pierre

anug...@gmail.com

unread,
Aug 10, 2016, 2:13:28 AM8/10/16
to Kill Bill developers mailing-list, anug...@gmail.com
Hi Pierre,

Thank you for your reply.
Given below are the details of the requirement.

1. We have an existing list of merchants with bank account numbers , address, contact email/phone etc. Which table we can use to store this.

2. Each merchant should be able to login to a ui (kaui with customization) and upload a collection/Invoice file. This file contains collection reference numbers , amounts , contact email/phone number of customer.

3. Killbill to send notifications(sms/email) to individual customer with collection reference number after/amount .

4. Customer makes payment using a mobile app and inform killbill about payment status using api .

5. Once payment status is changed to successful, killbill trigger events to settlement system to settle amount to merchant(daily).

6. Admin users to login/manage merchant details/payment & collection status.

7. RBAC at merchant login level.

8. Killbill doesn't need to store card details of customer. Based on the payment status received from another application, killbill make decisions to settle with merchant.

9. Api's to enquire payment statuses from merchant portal / mobile app.


Please advise, whether these objectives are possible using killbill.

Thanks
Anu









Pierre-Alexandre Meyer

unread,
Aug 10, 2016, 12:04:21 PM8/10/16
to Anu Pillai, Kill Bill developers mailing-list
Thank you Anu, this helps. Let me describe each step in more details.

On Tue, Aug 9, 2016 at 11:13 PM, <anug...@gmail.com> wrote:
1. We have an existing list of merchants with bank account numbers , address, contact email/phone etc. Which table we can use to store this.

I would suggest the following model:
  • Create a master Kill Bill tenant, where each Kill Bill account represents a merchant. Generic data such as address, contact info, etc. can be stored using the API and would end up in the accounts table
  • Create one Kill Bill tenant for each merchant, where each Kill Bill account represents a customer for that merchant
  • Create a custom payment Kill Bill plugin to manage a new table with the merchant bank account numbers and implement the settlement of funds (this would be similar to the Forte plugin, which takes care of ACH: https://github.com/killbill/killbill-forte-plugin)
2. Each merchant should be able to login to a ui (kaui with customization) and upload a collection/Invoice file. This file contains collection reference numbers , amounts , contact email/phone number of customer.

Kaui already supports RBAC (see http://docs.killbill.io/0.16/user_management.html and http://killbill.io/blog/multi-tenancy-authorization/). As you said, you will need however to customize the UI to present a custom screen for the merchant to upload the collection file. The easiest would be to create a Rails mountable engine, which would add the additional screens (see https://github.com/killbill/killbill-analytics-ui for an example).

Once the file is uploaded, you can use the Ruby client (https://github.com/killbill/killbill-client-ruby) from Kaui to call the Kill Bill API to create/update customers, charges, etc.

3. Killbill to send notifications(sms/email) to individual customer with collection reference number after/amount .

This would be done via a notification plugin. We already have one to send emails (https://github.com/killbill/killbill-email-notifications-plugin), so you could simply extend it to send SMS as well (e.g. via Twilio).

4. Customer makes payment using a mobile app and inform killbill about payment status using api .

The mobile app would call your back-end systems, which in turn would use the Kill Bill API to record the payment (via the InvoicePayment APIs).

5. Once payment status is changed to successful, killbill trigger events to settlement system to settle amount to merchant(daily).

After the payment is recorded, Kill Bill would send a message bus event. A custom notification plugin would listen to this event and record the amount to be settled for the day for that merchant. At the end of the day, you would trigger a CREDIT operation on the payment method associated with that merchant. This would initiate the movement of funds (Kill Bill would call your payment plugin described above).

6. Admin users to login/manage merchant details/payment & collection status.

7. RBAC at merchant login level.

As discussed above, this is already supported by Kaui.

8. Killbill doesn't need to store card details of customer. Based on the payment status received from another application, killbill make decisions to settle with merchant.

This makes sense - as described above, you would use the external charge APIs to create the invoices and the invoice payment APIs to reflect the balance of the invoice. 

9. Api's to enquire payment statuses from merchant portal / mobile app.

This is already available.

Let me know if you have further questions.

--
Pierre

anug...@gmail.com

unread,
Aug 12, 2016, 11:27:47 AM8/12/16
to Kill Bill developers mailing-list, anug...@gmail.com
On Thursday, August 11, 2016 at 12:04:21 AM UTC+8, Pierre-Alexandre Meyer wrote:
> Thank you Anu, this helps. Let me describe each step in more details.
>
>
> On Tue, Aug 9, 2016 at 11:13 PM, <anug...@gmail.com> wrote:
> 1. We have an existing list of merchants with bank account numbers , address, contact email/phone etc. Which table we can use to store this.
>
>
>
> I would suggest the following model:
> Create a master Kill Bill tenant, where each Kill Bill account represents a merchant. Generic data such as address, contact info, etc. can be stored using the API and would end up in the accounts tableCreate one Kill Bill tenant for each merchant, where each Kill Bill account represents a customer for that merchantCreate a custom payment Kill Bill plugin to manage a new table with the merchant bank account numbers and implement the settlement of funds (this would be similar to the Forte plugin, which takes care of ACH: https://github.com/killbill/killbill-forte-plugin)
> 2. Each merchant should be able to login to a ui (kaui with customization) and upload a collection/Invoice file. This file contains collection reference numbers , amounts , contact email/phone number of customer.
>
>
>
> Kaui already supports RBAC (see http://docs.killbill.io/0.16/user_management.html and http://killbill.io/blog/multi-tenancy-authorization/). As you said, you will need however to customize the UI to present a custom screen for the merchant to upload the collection file. The easiest would be to create a Rails mountable engine, which would add the additional screens (see https://github.com/killbill/killbill-analytics-ui for an example).
>
>
> Once the file is uploaded, you can use the Ruby client (https://github.com/killbill/killbill-client-ruby) from Kaui to call the Kill Bill API to create/update customers, charges, etc.
>
>
> 3. Killbill to send notifications(sms/email) to individual customer with collection reference number after/amount .
>
>
>
> This would be done via a notification plugin. We already have one to send emails (https://github.com/killbill/killbill-email-notifications-plugin), so you could simply extend it to send SMS as well (e.g. via Twilio).
>
>
> 4. Customer makes payment using a mobile app and inform killbill about payment status using api .
>
>
>
> The mobile app would call your back-end systems, which in turn would use the Kill Bill API to record the payment (via the InvoicePayment APIs).
>
>
> 5. Once payment status is changed to successful, killbill trigger events to settlement system to settle amount to merchant(daily).
>
>
>
> After the payment is recorded, Kill Bill would send a message bus event. A custom notification plugin would listen to this event and record the amount to be settled for the day for that merchant. At the end of the day, you would trigger a CREDIT operation on the payment method associated with that merchant. This would initiate the movement of funds (Kill Bill would call your payment plugin described above).
>
>
> 6. Admin users to login/manage merchant details/payment & collection status.
>
>
> 7. RBAC at merchant login level.
>
>
>
> As discussed above, this is already supported by Kaui.
>
>
> 8. Killbill doesn't need to store card details of customer. Based on the payment status received from another application, killbill make decisions to settle with merchant.
>
>
>
> This makes sense - as described above, you would use the external charge APIs to create the invoices and the invoice payment APIs to reflect the balance of the invoice. 
>
>
> 9. Api's to enquire payment statuses from merchant portal / mobile app.
>
>
>
> This is already available.
>
>
> Let me know if you have further questions.
>
> --
>
>
> Pierre


Hi Pierre.

Thank you for your reply.

For item 1 in my previous email,

If we create one tenant for each merchant , if there is 50,000 merchant records we need to keep that many tenant name, apikey and apisecret.

There is no requirement to keep customer data.
Merchant will upload invoice/collection records and whenever customer makes payment, kill bill only need to update the payment status via api.



Do we need to use an osgi container (equinox, felix or karaf) to to deploy and test custom plugins ?


Thanks
Anu



Pierre-Alexandre Meyer

unread,
Aug 12, 2016, 2:28:32 PM8/12/16
to Anu Pillai, Kill Bill developers mailing-list
Hi Anu,

On Fri, Aug 12, 2016 at 8:27 AM, <anug...@gmail.com> wrote:
If we create one tenant for each merchant , if there is 50,000 merchant records we need to keep that many tenant name, apikey and apisecret.

There is no requirement to keep customer data.
Merchant will upload invoice/collection records and  whenever customer makes payment, kill bill only need to update the payment status via api.

This scale shouldn't be an issue for Kill Bill (if that's your concern).

The main advantage of using tenants that way (even if customer accounts are mostly empty, with no data), is that you can leverage the RBAC framework, Kaui, etc. without having to worry about merchant A accessing customer records (e.g. payments) from merchant B.
 
Do we need to use an osgi container (equinox, felix or karaf) to to deploy and test custom plugins ?

No, Kill Bill embeds Felix already. More details in http://docs.killbill.io/0.16/plugin_development.html and http://docs.killbill.io/0.16/plugin_management.html.

--
Pierre

anug...@gmail.com

unread,
Aug 13, 2016, 4:30:20 AM8/13/16
to Kill Bill developers mailing-list
Hi Pierre,

Thank you for your reply.

1. Is it possible to implement user/ RBAC administration at UI level ?
For example creating a user assign roles to have access to specific features / modules .


2. When we create new user using kaui , this record goes to users table or shiro.ini file ?

3. What are the steps to crate a new user who with read only access ?

4. Are there api's to get a list of users and their roles ?

Thanks
Anu

Pierre-Alexandre Meyer

unread,
Aug 13, 2016, 12:05:27 PM8/13/16
to Anu Pillai, Kill Bill developers mailing-list
Hi Anu,

These links should answer most of your questions:
Let me know what is still not clear.




Thanks
Anu

--
You received this message because you are subscribed to the Google Groups "Kill Bill developers mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-dev+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-dev/af2f320a-7071-4f61-a315-4aa524411890%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Pierre

anug...@gmail.com

unread,
Aug 15, 2016, 6:31:18 AM8/15/16
to Kill Bill developers mailing-list, anug...@gmail.com
On Sunday, August 14, 2016 at 12:05:27 AM UTC+8, Pierre-Alexandre Meyer wrote:
> Hi Anu,
>
>
> These links should answer most of your questions:
> http://docs.killbill.io/0.16/user_management.html
> http://killbill.io/blog/multi-tenancy-authorization/
>
> Let me know what is still not clear.
>
>
> On Sat, Aug 13, 2016 at 1:30 AM, <anug...@gmail.com> wrote:
> Hi Pierre,
>
>
>
> Thank you for your reply.
>
>
>
> 1. Is it possible to implement user/ RBAC administration at UI level ?
>
>  For example creating a user assign roles to have access to specific features / modules .
>
>
>
>
>
> 2. When we create new user using kaui , this record goes to users table or shiro.ini file ?
>
>
>
> 3. What are the steps to crate a new user who with read only access ?
>
>
>
> 4. Are there api's to get a list of users and their roles ?
>
>
>
>
>
>
>
> Thanks
>
> Anu
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Kill Bill developers mailing-list" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-d...@googlegroups.com.
>
> To post to this group, send email to killbil...@googlegroups.com.
>
> Visit this group at https://groups.google.com/group/killbilling-dev.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-dev/af2f320a-7071-4f61-a315-4aa524411890%40googlegroups.com.
>
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
> --
>
>
> Pierre

Hi Pierre,

Thanks.

I have managed to setup a local killbill deployment with jetty and mysql instance in Redhat 7 OS..
It is working and I can login to kaui and create tenants / accounts etc using admin userid.

I also tried curl commands to create roles, users , etc successfully..

Now I am trying to install a hello-world plugin by downloading the source from github. I did a clean build . copied target/hello-world-plugin-*.jar to /var/tmp/bundles ..

Is there anything I need to do additionally to install and start the plugin.?
How do I verify that plugin is deployed , started and running?

Is killbill providing a url to access Felix web console to monitor osgi bundle status and start/stop osgi bundles?


Thanks
Anu

Pierre-Alexandre Meyer

unread,
Aug 15, 2016, 10:18:11 AM8/15/16
to Anu Pillai, Kill Bill developers mailing-list
On Mon, Aug 15, 2016 at 3:31 AM, <anug...@gmail.com> wrote:
Now I am trying to install a hello-world plugin by downloading the source from github. I did a clean build . copied target/hello-world-plugin-*.jar to /var/tmp/bundles  ..

Is there anything I need to do additionally to install and start the plugin.?
How do I verify that plugin is deployed , started and running?

Kill Bill should have started it automatically upon restart. You can check its status by executing the command listed here: http://docs.killbill.io/0.16/plugin_management.html#_listing_all_the_plugins.
 
Is killbill providing a url to access Felix web console to monitor osgi bundle status and start/stop osgi bundles?

If the webconsole is installed (which it is by default if you are using KPM or if you have installed the default bundles listed here: http://docs.killbill.io/0.16/userguide_platform.html#_lifecycle_and_layout_internals), you can access it via: http://127.0.0.1:8080/plugins/system/console/bundles/

--
Pierre

anug...@gmail.com

unread,
Aug 19, 2016, 4:54:41 AM8/19/16
to Kill Bill developers mailing-list, anug...@gmail.com
Hi Pierre,

Thanks


Following are the items we need your help to customize using killbill.

1. We have a list of 29k merchants. We should be able to create a table in killbill schema to import the data.

2. How many tenants we need to create so that we can achieve the following?

a. Create merchant users to create collection records in killbill.
b. Collection records consists of Reference number , Amount, customer mobile phone, customer email address, due date, settle status, etc. (Single entry & File upload if there are multiple records)
c. Which table do we need to use to store collection records
d. How can we apply a default catalog to all merchants instead of uploading catalogs 29k times ?
e. How can we configure the killbill to send notifications to customer immediately after creating collection record.( We have an external sms gateway url to perform http post)
d. Is there any report framework available in killbill like jasper for developing reports for merchants (Export to pdf/excel)?


Thanks
Anu

Pierre-Alexandre Meyer

unread,
Aug 19, 2016, 12:22:18 PM8/19/16
to Anu Pillai, Kill Bill developers mailing-list
On Fri, Aug 19, 2016 at 1:54 AM, <anug...@gmail.com> wrote:
2. How many tenants we need to create so that we can achieve the following?

        a. Create  merchant users to create collection records in killbill.
        b. Collection records consists of Reference number , Amount, customer mobile phone, customer email         address, due date, settle status, etc. (Single entry & File upload if there are multiple records)
        c. Which table do we need to use to store collection records

These questions are hard to answer as they depend on which approach you decided to take to design your integration.

You will either need to re-use the Kill Bill APIs and break down that record into several entities (i.e. create accounts which will contain the email, address and phone, create external payments with the amount, reference number as the transaction external key, etc.) or keep the collection record as a single entity in your own plugin (in which case, you need to create your own table).

Before looking at the database data model however, I would encourage you to get familiar with Kill Bill and its concepts (try the APIs, follow a few tutorials, etc.) and then come up with a design proposal we can help review.
 
        d. How can we apply a default catalog to all merchants instead of uploading catalogs 29k times ?

You can set the following configuration property: org.killbill.catalog.uri=file:///var/tmp/catalog.xml
 
        e. How can we configure the killbill to send notifications to customer immediately after creating  collection record.( We have an external sms gateway url to perform http post)

It sounds like you are interested in the notifications plugin? https://github.com/killbill/killbill-email-notifications-plugin
 
        d. Is there any report framework available in killbill like jasper for developing reports for merchants (Export to pdf/excel)?

We provide per-tenant reporting and dashboarding capabilities via the Analytics plugin, see http://docs.killbill.io/0.16/userguide_analytics.html. Alternatively, you could simply run the Analytics plugin to create the reporting data and ETL the tables to a datawarehouse for further analysis via tools like Tableau.

--
Pierre
Reply all
Reply to author
Forward
0 new messages