Need javascript equivalent code for java code


Can some one provide javascript equivalent code of following java code, especially @Override callback

    service.startPaymentTransaction(this, true, true,
            new PaytmPaymentTransactionCallback() {
                public void someUIErrorOccurred(String inErrorMessage) {
                    Log.e("LOG", "Error message: " + inErrorMessage);
                    Toast.makeText(getApplicationContext(), "Error message: " + inErrorMessage, Toast.LENGTH_LONG).show();

                public void onTransactionSuccess(Bundle inResponse) {
                    Log.d("LOG", "Payment Transaction is successful " + inResponse);
                    Toast.makeText(getApplicationContext(), "Payment Transaction is successful ", Toast.LENGTH_LONG).show();


@bradwaynemartin ping ping please?

#3 event listener callbacks here might help with your translation of the code.


Thanks. i set breakpoints on callback functions. but debugger not taking inside apk code.


Can you paste what you have now?


service.startPaymentTransaction(, false, true,
new com.paytm.pgsdk.PaytmPaymentTransactionCallback({
onTransactionSuccess: (paramBundle) => {


            onTransactionFailure: (paramString, paramBundle) =>{


i am trying to debug com.paytm.pgsdk.PaytmPaymentTransactionCallback constructor and also set break points in call back functions. But debugger not taking to new com.paytm.pgsdk.PaytmPaymentTransactionCallback and not hitting breakpoints of call back methods.


Unless you have SOME code in your callback functions you won’t be breaking there. Place some console.logs instead to make sure they are being called, or place debugger; statements to ensure breaking when debugging.