Handling back button press

One of the most common ways for the users to abandon transactions is by clicking the back button. Instead of showing a generic dialog to confirm the cancellation, Godel SDK will assess the current state of the transaction, and wherever possible, will provide help screen for the users to try and complete the transaction. If you do not want JusPay to help the customer when back button is clicked, you can pass false as the argument in juspayBackPressedHandler, else pass true.

When you pass true, we merely track the fact that the user has pressed back button and later use this fact to derive insights for drop out reasons.

@Override
public void onBackPressed() {
    /**
     * shouldShowJuspayCloseDialog:
     *  - true: If true, then JusPay will show confirmation dialog for the user
     *  - false: If false, then your app should take care of confirmation from the user for 
     *       cancelling the transaction.
     */ 
    browserFragment.juspayBackPressedHandler(shouldShowJuspayCloseDialog);
    // Your code to show a dialog box if you are passing false.
}

If JusPay is unable to provide help and the user closes the transaction session using the "Cancel Transaction" dialog box, we provide a callback to the activity via JuspayBackButtonCallback.transactionCancelled. Please note, this callback is not called if the user clicks any Abort/Cancel button in the webpage because in such a case the action is handled by the webpage itself.

JuspayBackButtonCallback backButtonCallback = new JuspayBackButtonCallback() {

        @Override
        public void transactionCancelled() {
            finish();
        }
    };

browserFragment.setupJuspayBackButtonCallbackInterface(backButtonCallback);

results matching ""

    No results matching ""