Payment plugin with postponing check for the status

39 views
Skip to first unread message

ell...@gmail.com

unread,
Mar 15, 2019, 2:44:33 AM3/15/19
to Kill Bill developers mailing-list
Hi everyone.
We have a 3d-party payment system that requires some actions from the user.
What we need (step by step):
1 - trigger payment method (killbill does it)
2 - payment method or payment control plugin initiating the payment request. In this time plugin shouldn't return success or failed payment result.
3 - user do their part (make or reject payment in the 3d-party app)
4 - payment control plugin checks payment status from the 3d-party API every 5 minutes. If status updated to canceled or success paid - plugin return success or failure to killbill. After 24 hours, if the status is not updated should return canceled status for the payment in killbill.

Could you please help me figure out if it possible to implement something like this? Are there any plugins I can use as an example? What part should be done in payment plugin and what part should be in payment control plugin?

PS: Is anyone here could do such plugin for us (we will pay of course). If so, please contact me by email.

Pierre-Alexandre Meyer

unread,
Mar 15, 2019, 4:48:23 AM3/15/19
to Elvira Sheina, Kill Bill developers mailing-list
On Fri, Mar 15, 2019 at 6:44 AM <ell...@gmail.com> wrote:
Could you please help me figure out if it possible to implement something like this? Are there any plugins I can use as an example? What part should be done in payment plugin and what part should be in payment control plugin?

Yes, this is actually quite a common scenario for asynchronous payments. Take a look at our payment documentation: http://docs.killbill.io/0.20/userguide_payment.html#components-payment-flows. I also don't think you need a payment control plugin, you should be able to achieve this with a simple payment plugin.

Regarding examples, you could either take a look at our PayPal implementation (https://github.com/killbill/killbill-paypal-demo) or our Adyen one (https://github.com/killbill/killbill-adyen-demo). 

Hope that helps,

--
Pierre

ell...@gmail.com

unread,
Apr 4, 2019, 8:32:46 AM4/4/19
to Kill Bill developers mailing-list
Hi, Pierre. I have more questions and hope you could help me.
As I understand, killbill is calling get_payment_info for all unsuccess payments. I am trying to change transaction status to "success" inside my plugin in "get_payment_info" method.

It seems I can do it with
@kb_apis.admin_payment_api.fix_payment_transaction_state()
The problem is that "admin_payment_api" is not initialized.
https://github.com/killbill/killbill-plugin-framework-ruby/blob/9d05745a171ed8ed298e418178ef4f2dabe35e5a/lib/killbill/gen/api/osgi_killbill.rb#L191

I believe it is because of permissions. I've tried to login with @kb_apis.security_api.login() but doing so in "get_payment_info" is too late and in "initialize" is too early. Where should I login as admin in the plugin to be able to use admin_payment_api? Is it the right decision to login in the plugin or is there any other way to change transaction status to "success"?

Reply all
Reply to author
Forward
0 new messages