android - UPI 深层链接请求失败
问题描述
我编写了这段代码,用于通过安装在用户手机上的 UPI 应用程序接受付款。一切似乎都很好,直到用户尝试以奇怪的方式付款失败。
Google Pay -> “您已超过银行设置的最大交易金额”。
还有 Google Pay ->“糟糕,出了点问题”。
Phonepe ->“无法启动交易。请重试..”
我确实尝试在互联网上搜索,但找不到任何东西。
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。
解决方案
推荐阅读
- c++ - 后跟 '::' 的名称必须是类或命名空间错误,即使 '::' 跟在类名之后
- firebase - firebase ui 手机身份验证活动泄漏
- javascript - 是否可以在 axios 拦截器中访问 vue 实例?
- c# - Azure 函数应该记录错误还是抛出异常?
- apache-spark - 在 Spark 中获取树模型的叶子概率
- javascript - 如何将数据从 Puppeteer 发布到 node.js 中的 Google Apps Script Web 应用 API 端点?
- xquery - Marklogic XQuery 根据条件删除元素块
- react-native - Location.startGeofencingAsync 在开始时发送一堆更新
- python - 通过多个下拉列表从表中迭代和提取值
- python - 在 python 和 dbus 中使用蓝牙