Skip to main content
1.1 Add WebView to Android App 1.2 Setup WebViewClient 1.3 Handle Deep Links in shouldOverrideUrlLoading() 1.4 Enable UPI Intent Support

1.1 Add WebView to Android App

Add a WebView to the layout of your Android app. You can add the code given below to the layout XML file of your app:

1.2 Setup WebViewClient

To setup a WebViewClient that handles URL requests, create a new class using the code given below extending the MyWebViewClient and overriding the shouldOverrideUrlLoading() method.
Java
To handle deep links in the shouldOverrideUrlLoading() method, check if the URL is a deep link and then launch the corresponding activity using the intent class. In this example, we are checking if the URL starts with http:// or https://. If not, then we create a new intent with ACTION_VIEW and URL as the data and start the activity with this intent.
Java

1.4 Enable UPI Intent Support

To enable and test UPI intent in WebView-based Checkout:
1

Open your website integrated with custom checkout.

Open your website integrated with custom checkout.
2

Pass `webview_intent: true` parameter in the [payload](/payments/pa...

Pass webview_intent: true parameter in the payload sent to checkout to enable UPI intent support.
3

Ensure that UPI intent is triggered when the payment request is made.

Ensure that UPI intent is triggered when the payment request is made.
Watch Out!By default, the top PSP apps appear on the customer’s mobile irrespective of the installation status of the UPI apps.

List of Supported UPI Intent Apps

Given below is the list of supported UPI apps for Mobile Web.
  • gpay
  • phonepe
  • paytm
  • any
The any option triggers the other UPI payment apps installed on your customer’s mobile.