Creating a new Moneris Payment Plugin

162 views
Skip to first unread message

Macdonald Robinson

unread,
Jul 13, 2023, 6:29:40 PM7/13/23
to Kill Bill users mailing-list
Hi There,

I have a requirement to use moneris with killbill, so I wanted to create a new payment plugin.

I have downloaded both the KillBill source as well as the Killbill-Stripe Source to use as a reference. 

I was thinking that for now I just want to put a breakpoint in the KillBill stripe plugin and see it hit once a payment method is created or a invoice is committed / paid

I was wondering if you could please let me know what the best process is to test and debug the plugin? I was trying to see if there was a way to connect to the stripe plugin directly from KillBill, but i couldn't find a way to have them communicate.

P.S: I am not that familiar with Java right now or the IntelliJ IDE, so any help to point e in the right direction would be appreciated

Thanks!

karan bansal

unread,
Jul 14, 2023, 1:07:34 PM7/14/23
to Kill Bill users mailing-list
Hi Macdonald,

Here are the step by step instructions to set up remote debugging. 

Regards
Karan

Macdonald Robinson

unread,
Jul 17, 2023, 11:46:27 AM7/17/23
to Kill Bill users mailing-list
Hi There,

I don't think the link you provided is what I am looking for.

I am trying to create a new payment plugin for killbill, and I want to know what the best steps are to: 

- Setup killbill to call my payment plugin without having to install the payment plugin but point it to the source code and have it run

- Be able to hit a breakpoint inside my payment plugin every time I perform an action in killbill which would interact with the payment plugin, like for example: commit an invoice or create a payment method

There must be a way to do this or it would make developing a payment plugin really hard, if you cannot debug the payment plugin while working on it.

Thanks!

karan bansal

unread,
Jul 18, 2023, 1:38:50 PM7/18/23
to Kill Bill users mailing-list
Hi Macdonald,

Here are the plugin specific debug instructions https://docs.killbill.io/latest/plugin_development.html#_setting_up_a_breakpoint_and_debugging. However, you will need to have the plugin jar file compiled and installed. You could also look into setting up the plugin as module in IntelliJ IDEA. 

Regards
Karan

Macdonald Robinson

unread,
Jul 27, 2023, 12:33:55 PM7/27/23
to Kill Bill users mailing-list
Hi!,

Thanks for this, I am now successfully able to debug the plugin code.

I have another question if you don't mind, I want to create a custom table to store my plugin info and other plugin specific config.

I was looking at the doc and i could see for the GoCardless you were just storing it in a killbill custom field for the account, but i wanted to store it for a specific payment method.

Can you please point me in the right direction to create my own tables for the plugin and how to store info.

I was seeing a bunch of things related to JQQQ as well, but am not sure where to start on this to implement that for the custom plugin.

PS: Please note I am pretty new to the Java World 

Thanks for your help

Thanks!

karan bansal

unread,
Jul 28, 2023, 9:04:46 AM7/28/23
to Kill Bill users mailing-list
Hi MacDonald,

Few plugins like Stripe, Adyen and our Payment test plugin store info in the tables. Could you please refer to these if it helps you. 

Regards
Karan

Macdonald Robinson

unread,
Aug 14, 2023, 3:47:59 PM8/14/23
to Kill Bill users mailing-list
Hi There,

I have added a custom JAR file for moneris under src/libs/moneris-plugin/moneris-api.x.x.x.jar

Everything works fine locally because I installed it locally, however when i am running it in the pipeline using the ci.yml included in hello world it fails, because it cannot find the moneris.x.x.x.jar file

I can replace the ci.yml file and use our own custom build which would move the jar file to the maven local repo, however then we loose the shared github workflow: 
uses: killbill/gh-actions-shared/.github/workflows/ci.yml@main

so a few questions:
- Is the gh-actions-shared workflow ci.yml something that should be left in place or removed and replaced by our own custom one?
- If it should be left in pace then how can i add the custom moneris api jar file to the shared workflow?

Thanks!

karan bansal

unread,
Aug 16, 2023, 8:09:58 AM8/16/23
to Kill Bill users mailing-list
Hi MacDonald,

The GH shared workflow is only for our internal purpose to kick off the automated test suite. You do not need it. Feel free to remove it. 

Regards
Karan

Macdonald Robinson

unread,
Aug 17, 2023, 1:30:09 PM8/17/23
to Kill Bill users mailing-list
Thanks for your help @karan bansal

I have a question about passing properties along to the plugin methods, for example the authorizePayment method in the PaymentPluginApi, for some reason the json properties are not being passed into the final Iterable<PluginProperty> properties the list is empty


POST URL: {{KillBillApiUrl}}/accounts/[accountId]/payments?paymentMethodId=[PaymentMethodId]
POST Body JSON: 
{
    "transactionType":"AUTHORIZE",
    "amount":"10",
    "currency":"CAD",
    "transactionExternalKey":"INV2-33119-AUTH-123",
    "properties": [
        {
            "key""key1",
            "value""val1"
        },
        {
            "key""key2",
            "value""val2"
        }
    ]
}

It seems to work when i add it to the QueryString: &pluginProperty=key1=val1&&pluginProperty=key2=val2

What am I doing wrong here?

Thanks! 

karan bansal

unread,
Aug 18, 2023, 6:02:51 AM8/18/23
to Kill Bill users mailing-list
Hi MacDonald,

The API that you have highlighted indeed has the plugin properties passed as query parameters https://killbill.github.io/slate/#account-trigger-a-payment-authorization-purchase-or-credit

Regards
Karan

Macdonald Robinson

unread,
Sep 11, 2023, 3:18:31 PM9/11/23
to Kill Bill users mailing-list
Hi There,

 I am following the Void an existing payment [using paymentId] section in the docs here: https://killbill.github.io/slate/payment.html#void-an-existing-payment-using-paymentid, but for some reason I am hitting the capturePayment PaymentPlugin method instead of the voidPayment do you know why this is?

POST to URL: {{KillBillApiUrl}}/payments/{payentid}

Body:

{
    "paymentId""{PaymentId}",
    "amount"10
}

karan bansal

unread,
Sep 12, 2023, 9:17:22 AM9/12/23
to Kill Bill users mailing-list
Hi Macdonald,

You need to use the Delete operation instead of Post operation. 

Regards
Karan

Message has been deleted

Macdonald Robinson

unread,
Oct 5, 2023, 5:28:24 PM10/5/23
to Kill Bill users mailing-list
Hi There,

I am creating a new PaymentTransactionInfoPlugin during purchasePayment and setting its status to pending, and then later I am updating this in the getPaymentInfo method.

The additionalData section is being updated correctly with new info, however the getErrorCode and the getErrorMessage are not being updated

When I debug and inspect the newly created PaymentTransactionInfoPlugin I can see the properties for getErrorCode and getErrorMessage being updated correctly in the debugger, but it doesn't reflect in the UI or in the API, it still has the old values, but the properties section and the status do get updated.

Can you please let me know why the status and the additionalData get updated correctly but the ErrorCode and the ErrorMessage do not.

Thanks!

Reshma Bidikar

unread,
Oct 6, 2023, 4:20:02 AM10/6/23
to Kill Bill users mailing-list
Hello,

Are you also updating the PaymentPluginStatus (PaymentTransactionInfoPlugin.getStatus) in your getPaymentInfo method? The gateway error code and gateway error are updated only when there is a change in the status.

Hope this helps!

Regards,
Reshma
Reply all
Reply to author
Forward
0 new messages