googletez / inapp-payment-samples

26 stars 20 forks source link

sample app is crashed when i click a pay button #3

Open alam1612 opened 5 years ago

alam1612 commented 5 years ago

ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=upi://pay?pa=test@axisbank&pn=Test Merchant&mc=1234&tr=123456789&tn=test transaction note&am=10.01&cu=INR&url=https://test.merchant.website pkg=com.google.android.apps.nbu.paisa.user } i am finding this type of exception.

gsanthosh91 commented 5 years ago

This is the right way to do this.

try {
    Uri uri = new Uri.Builder()
        .scheme("upi")
        .authority("pay")
        .appendQueryParameter("pa", "test@axisbank")
        .appendQueryParameter("pn", "Test Merchant")
        .appendQueryParameter("mc", "1234")
        .appendQueryParameter("tr", "123456789")
        .appendQueryParameter("tn", "test transaction note")
        .appendQueryParameter("am", "10.01")
        .appendQueryParameter("cu", "INR")
        .appendQueryParameter("url", "https://test.merchant.website")
        .build();
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(uri);
    intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME);
    startActivityForResult(intent, TEZ_REQUEST_CODE);
} catch (Exception e) {
    Log.e(TAG, e.getMessage());
}
Sai-Sudhakar commented 4 years ago

Try unistalling Gpay and install it again... Your issue is resolved.

mfl345909 commented 4 years ago

I meet same problem, @alam1612 how do you fix finally?

Sai-Sudhakar commented 4 years ago

I meet same problem, @alam1612 how do you fix finally?

I just uninstalled my Google pay and re installed it. This worked for me.

mfl345909 commented 4 years ago

@Sai-Sudhakar thank you,should I use valid UPI data from Google Pay for Business Info?

Sai-Sudhakar commented 4 years ago

@Sai-Sudhakar thank you,should I use valid UPI data from Google Pay for Business Info

It's better to use valid information to check. There are some ways to check it using command line interface But, Realtime experienece will be good always.

viswanathsandu commented 4 years ago

Re-installing google pay is not the right solution for this. We can't ask all the customers to re-install Google Pay to use this. Looking for a better solution.

ashwini-mohapatra commented 3 years ago

Re-installing is not working for me. If anyone knows a better solution kindly reply. It will be of great help

SwatiSoni-snapmint commented 2 years ago

Still facing the same issue. UPI uri is correct at my end and able to open many devices but app getting crash over some device even though UPI app exists on the same device.