问题描述
我编写了此代码,用于通过用户手机上安装的 UPI 应用接受付款。一切似乎都很好,直到用户尝试以奇怪的方式付款失败。
Google Pay ->“您已超出由
你的银行”。
还有 Google Pay ->“糟糕,出了点问题”。
电话号码 ->
" 无法发起交易。请重试.."
我确实尝试在互联网上搜索但找不到任何东西。
private fun payWithUPI() {
val uri: Uri = Uri.Builder()
.scheme("upi")
.authority("pay")
.appendQueryParameter("pa","my_vpa")
.appendQueryParameter("pn","name")
.appendQueryParameter("mc","merchant_id")
.appendQueryParameter("tr","123456789")
.appendQueryParameter("am","5.00")
.appendQueryParameter("cu","INR")
.build()
val upiPayIntent = Intent(Intent.ACTION_VIEW)
upiPayIntent.data = uri
val chooser = Intent.createChooser(upiPayIntent,"Pay with")
if(null != chooser.resolveActivity(getPackageManager())) {
startActivityForResult(chooser,UPI_PAYMENT);
} else {
Toast.makeText(
this,"No UPI app found,please install one to continue",Toast.LENGTH_SHORT
).show()
}
}
PS:我已在 bhim sbi 注册为商家并使用该 vpa。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)