ANDROID:- Google pay ACTION CHOOSER not working

无人久伴 提交于 2021-02-07 04:30:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!