简体   繁体   中英

UPI deep link issue with android app integration

I am using native code for upi deep linking. When intent invoke on bhim app payment details page in not showing while other psp app redirecting to payment page When I click a url from mobile browser like this upi://pay?pa=98955012345@upi&pn=abc&am=1 it opens BHIM app with pre-filled page of payee details.

However when I use my merchant app, to link it through intent deep-linking, it opens BHIM but does not redirect to pre-filled page.

It really works for the BHIM application also. Use this Code it works like a charm for every PSP enabled applications.

Note: Instead of using the "%" better to use "+" to replace the white space from the URL. That works better.

private String getUPIString(String payeeAddress, String payeeName, String payeeMCC, String trxnID, String trxnRefId,
                        String trxnNote, String payeeAmount, String currencyCode, String refUrl) {
String UPI = "upi://pay?pa=" + payeeAddress + "&pn=" + payeeName
        + "&mc=" + payeeMCC + "&tid=" + trxnID + "&tr=" + trxnRefId
        + "&tn=" + trxnNote + "&am=" + payeeAmount + "&cu=" + currencyCode
        + "&refUrl=" + refUrl;
return UPI.replace(" ", "+");

}

Then pass the parameters in the method and pass the string to the Intent in this way:

Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.setData(Uri.parse(UPI));
        Intent chooser = Intent.createChooser(intent, "Pay with...");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            startActivityForResult(chooser, 1, null);
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM