Integration with JS Checkout: Android

Webview for Android Platform

To support UPI intent PSP apps, merchants need to make the following changes mentioned below.

Note: This solution is for the merchants who have integrated JS Checkout. To know more about JS Checkout integration, please refer to the JS Checkout document.

Steps to follow:-

  1. Merchants integrate the Webview in their Android application to open the Paytm gateway and show payable instruments to the user.
  2. Integrate WeClient in Webview to listen to events related to Webview.
  3. Add the below-mentioned method in Webclient to support UPI PSP apps from the Webview.


Mandatory code: 


To update Paytm UI about enabling the UPI intent. One needs to follow the below steps: 


1. Create a Javascript Interface and attach it with the Webview created for handling the transaction.

public  class PaytmJavaScriptInterface {
    public synchronized boolean openUpiApp(String url) {
        try {
                Intent intent = new Intent(Intent.ACTION_VIEW);
        }catch (ActivityNotFoundException e){
            return false;
        return true;


2. Add the JS interface created to the Webview so that UI is notified about enabling the UPI intent. Now, Add the below piece of code where you are initializing the Webview.

webView.addJavascriptInterface(new PaytmJavaScriptInterface(),"checkoutUpiIntent");


 Note: Java version is independent of the above piece of code.