使用Intent的UPI App深层链接-不一致和错误的行为 [英] UPI App Deep linking using Intent - inconsistent and buggy behavior

查看:384
本文介绍了使用Intent的UPI App深层链接-不一致和错误的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用intent从我的Android本机应用程序深化了UPI应用程序.我已经使用各种UPI应用(例如BHIM,PhonePe,AXIS,UnionBank,Pockets等)对此进行了测试.

I have deeplinked UPI apps from my android native app using intent. I have tested this with various UPI apps like BHIM, PhonePe, AXIS, UnionBank, Pockets etc.

我创建了推送付款URI.我能够启动各种UPI应用程序.但是,行为是非常不一致的.

I created push payment URI. I am able to launch various UPI apps. However behaviour is quite inconsistent.

"upi://pay?pa = xxxxx @ upi& pn = payee& am = 5.00& tn = Test_Transaction"

"upi://pay?pa=xxxxx@upi&pn=payee&am=5.00&tn=Test_Transaction"

  1. 调用Intent时,大多数应用程序都在响应.他们被发射了.
  2. 很少有应用程序正确显示带有金额的付款页面.其余应用程序根本不显示该页面. PhonePe,显示轴. BHIM没有显示付款页面
  3. 仅通过PhonePay和Axis成功完成付款
  4. UPI付款成功完成后,UPI应用程序已关闭,控制权返回到我的应用程序.但是,响应数据始终为NULL.付款成功后,应用程序无人提供响应数据
  5. 如果付款失败,或者我在UPI应用程序中取消了付款,或者我没有输入正确的PIN并关闭UPI应用程序,则大多数应用程序都不会返回响应数据.
  6. 仅AXISPay返回了响应数据: 意图{(有其他功能)
  1. Most apps are responding when intent is onvoked. They get launched.
  2. few apps displayed the payment page correctly with amount. Rest apps did not display the page at all. PhonePe, Axis displayed. BHIM did not display payment page
  3. Payment completed successfully b y PhonePay and Axis ONLY
  4. After UPI payment was completed successfully, the UPI app is closed and control comes back to my app. However the response data is always NULL. NONE of the app is providing response data when payment is successful
  5. If payment fails or I cancel the payment in UPI app or I do not enter right PIN and close UPI app, most of the apps do not return response data.
  6. Only AXISPay returned response data : Intent { (has extras) }

任何人-有何评论?为什么会有这种不一致的行为?

Anyone - any comments? Why such inconsistent bahaviour?

令人惊讶的是,深层链接不适用于BHIM应用.

Surprising is deeplinking not working with BHIM app.

如果有人想尝试,我可以共享android代码.

I can share android code if someone want want to try.

推荐答案

它也确实适用于BHIM应用程序.使用此代码,对于每个启用PSP的应用程序,它就像一个魅力.

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

注意:最好使用"+"代替URL中的空格,而不要使用%".效果更好.

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(" ", "+");
}

然后在方法中传递参数,并以这种方式将字符串传递给Intent:

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);
            }

这篇关于使用Intent的UPI App深层链接-不一致和错误的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆