6

I was trying to implement UPI intent, but whenever i am paying it's saying maximum limit exceeded in google pay, in phone pe, It's showing due to security issue, you cannot pay with this bank account. Please help me out. here is my code.

                    Uri UPI = Uri.parse("upi://pay").buildUpon()
                            .appendQueryParameter("pa", "") //rList.get(i).upi_id
                            .appendQueryParameter("pn", "") //rList.get(i).username
                            .appendQueryParameter("tn", "TEST") //rList.get(i).paylist_name
                            .appendQueryParameter("tr", ""+StaticValues.transactionId)
                            .appendQueryParameter("tid", ""+StaticValues.transactionId)
                            .appendQueryParameter("am", ""+rList.get(i).payble_amount)
                            .appendQueryParameter("cu", "INR")
                            //.appendQueryParameter("orgid", "000000")
                            //.appendQueryParameter("mode", "04")
                            .build();
                    Intent intent = new Intent();
                    intent.setAction(Intent.ACTION_VIEW);
                    intent.setData(UPI);
                    Intent chooser = Intent.createChooser(intent, "Pay with...");
                    startActivityForResult(chooser, 1);

1 Answers1

3

Similar issue here and the solution seems to be to create a merchant account (business account) and pass the parameters from that account (including merchant id "mc") for payment processing. See UPI specifications by Google here. That being said, I tested it with only four parameters, pa, pn, tn and am but I generated a QR code and scanned from GPay app and it worked without an issue.

My conclusion is that the security measure applies to in-app generated upi payment URI only and if we are scanning from an UPI payment app, these additional parameters are not considered.

If we could generate the QR code and make a payment through scanning from the UPI app it would work. But I don't think we can make another app scan our generated QR code.

Edit 27-08-2021

I was able to successfully make an UPI payment to a non merchant account but I cannot do an automatic payment verification. If you would like to resort to this method then read on.

Limitations:

  1. The payment needs to be verified manually by transaction ID, in my case I generate a bill number for reference.
  2. User has to take a screenshot of the QR code (or you can write a screencap snippet) and manually pay via QR code scan -> scan from gallery or image source.
  3. Totally not suitable for applications that require automatic payment verification.

How to do:

  1. Create a QR code with the following parameters:
  • pa - payee address (UPI ID)
  • pn - payee name
  • am - amount to be paid
  • tn - transaction note (I set my bill number here)
  1. Request user to scan via gallery after taking screenshot or write code to save screenshot of the QR in device.
  2. Manually confirm after payment in made with reference to the transaction note.

I know this is not even close to an ideal solution but I have tried with the registered merchant account and simple user account and it works on both cases. I tried to pass the merchant account parameters I found in addition to the above mentioned parameters but it didn't work for some reason. I will update if I found the cause of it in future.

Abishek Stephen
  • 386
  • 1
  • 3
  • 15
  • so...I'm at the same crossroads - @abhishek did you ever find a solution to this? Cheers! – user2515011 Jun 16 '22 at 16:12
  • @user2515011 I found my makeshift solution to be working fine as my clients don't rely on UPI that much. I found payment gateway service providers online who handle multiple methods of digital payments, the only drawback is the commission. RBI seem to be increasing the security every quarter and I think even if you are a merchant, unless your UPI or any payment method is authorized by a third party or you act as a proxy to receive payments on behalf of others, you won't be able to code it like simple copy paste from StackOverflow. – Abishek Stephen Jun 20 '22 at 16:43
  • @AbishekStephen In case of my gpay business merchant account not being registered, I try to integrate payment gateway and when I try to do gpay payment via these pg than too gpay upi wont work right? coz the merchant is not a verified one or will it work? – Prajwal Waingankar Mar 18 '23 at 19:38
  • https://stackoverflow.com/q/76988284 Can you help me to solve this? – George Aug 28 '23 at 08:23