Search code examples
androidupi

UPI payment intent is showing, maximum limit exceeded


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);

Solution

  • 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.