问题
Im trying to do a payment through the action chooser. In my i have given the URI and when i am clicking on paynow button it asking select payment applicatin like GPAY or PAYTM or WHATAPP when ever i clicks on GPAY it is not working. But when i tried with whatsapp it is working. please see my code do i miss anything ?i am attaching some images for the reference
whenever i clicks on "PAYNOW" button im calling below function:-
private void payUsingUpi(String name, String strupi, String strnote, String stramount) {
Log.e("main ", "email "+name +"--upi--"+strupi+"--"+ strnote+"--"+stramount);
Uri uri = Uri.parse("upi://pay").buildUpon()
.appendQueryParameter("pa", strupi)
.appendQueryParameter("pn", name)
//.appendQueryParameter("mc", "")
//.appendQueryParameter("tid", "02125412")
//.appendQueryParameter("tr", "25584584")
.appendQueryParameter("tn", strnote)
.appendQueryParameter("am", stramount)
.appendQueryParameter("cu", "INR")
//.appendQueryParameter("refUrl", "blueapp")
.build();
Intent upiPayIntent = new Intent(Intent.ACTION_VIEW);
upiPayIntent.setData(uri);
// will always show a dialog to user to choose an app
Intent chooser = Intent.createChooser(upiPayIntent, "Pay with");
chooser.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
// check if intent resolves
if(null != chooser.resolveActivity(getPackageManager())) {
//startActivity(chooser);
startActivityForResult(chooser, UPI_PAYMENT);
} else {
Toast.makeText(PaymentActivity.this,"No UPI app found, please install one to continue",Toast.LENGTH_SHORT).show();
}
}
it will opens the GPAY. but im trying to proceed the payment , after entering the UPI pin everything it showing the error message as
Payment failed
You have exceeded the maximum transaction amount set by your bank. im not able to take the screenshot.
Pay now button in APP
Action chooser
it would be greatefull if anyone have any suggestions
来源:https://stackoverflow.com/questions/64639572/android-google-pay-action-chooser-not-working