well I tried paytm but it was not working properly so I implemented UPI.
I think UPI works on all Indian micro payment systems (e.g. Gpay, phonePe, Paytm etc)
code for onActivity is in 1st comment
original source code
which I used https://github.com/Pro-Grammerr/Android-payment-using-UPI/blob/master/app/src/main/java/com/example/chirag/upi_payments/MainActivity.java
well in paytm also there is a similar method which I found later on after publishing the video
https://developer.paytm.com/docs/all-in-one-sdk/non-sdk-based-integration/
contents
00:00 Introduction & Back story
02:25 Implementation