Help me figured out what's the best way to implement this 3rd party billing SDK

Hi,

So the SDK that I try to implement handles all the billing process in a class where I can just override some of the methods to handle the events.

So far this is what I need to do and have done according to the SDK requirement (warning pseudo-code) :

public class BillingHandler implements BillingInterface{ @override onSuccess(){ // I'm suppose to call my callback function in LUA } } PlayphoneSDK.setBilling(new BillingHandler())  

I’ve done my part in making a LUA function that calls the SDK billing method (purchase) and now I’m confuse on what is the best way for me so I can call my callback function within the BillingHandler.

In my Lua code I’ll call the function purchase like this : 

Playphone.purchase(ITEM\_ID, onPurchaseResult)  

It works but I just can’t call onPurchaseResult from the sdk callback. I tried to use async function call like the sample but it needs CoronaRuntimeTaskDispatcher object that needs the current luaState/corona runtime.

I’m sorry if my Java skills isn’t that good but I’m really confused as to what to do now