Payment through Google Pay sometimes succeeds sometimes fails using UPI Intent in Android Studio [business UPI ID]
Asked Answered
L

0

7

I am using this library (Library link) to create a UPI intent. This library supports both payment intent and QR code generation. Now, payment through PhonePe succeeds but payment through GooglePay sometimes succeeds and sometimes fails (when done through intent). Payment through PhonePe always succeeds (both using Intent and QR).

This is what I am trying to do.

MainActivity.java

    btn1.setOnClickListener(view -> {
        try {
            UPI upi = UPI.getInstance();
            Intent payIntent = upi.getPaymentIntent(UPI_ID, NAME, "1", "INR", "Test", "", MERCHANT_CODE, UPI.ALL_APPS);
            launcher.launch(payIntent);
        }
        catch (Exception e) {
            Toast.makeText(MainActivity.this, e.toString(), Toast.LENGTH_LONG).show();
        }
    });
    btn2.setOnClickListener(view -> {
        getSupportFragmentManager().beginTransaction().add(new QRFragment(), "QR").commit();
    });

QRFragment.java

    UPI upi = UPI.getInstance();
    try {
        Bitmap bitmap = upi.getQR(UPI_ID, NAME, "1", "INR", "Test", "", MERCHANT_CODE, 512);
        img = view.findViewById(R.id.img);
        img.setImageBitmap(bitmap);
    }
    catch (Exception e) {
        e.printStackTrace();
    }

Note: The recipient UPI ID is a business UPI ID.

Edited: The merchant has only PhonePe and PayTM merchant ID (no Google Pay). Can it be a problem?

Lombardi answered 27/8, 2023 at 17:41 Comment(1)
You can Contact to Customer Support As they can help you with this case. As far AS MY experience Your code seems correct. So The Last Option is left to contact customer support here you can get info how to get customer support. You can refer this stack overflow question and [this stackoverflow](#61417963Athlete

© 2022 - 2024 — McMap. All rights reserved.