如何解决Google Pay UPI 集成在 android 中不起作用
GPay 集成在 2 天前运行良好,但现在它在 gpay 应用程序中显示相同的错误。要求 gpay 付款的意图不起作用。 我几天前成功完成了交易。但现在它不工作。任何帮助,将不胜感激!提前致谢。
我的代码
uriapp = new Uri.Builder()
.scheme("upi")
.authority("pay")
.appendQueryParameter("pa",getString(R.string.vpa))
.appendQueryParameter("pn",getString(R.string.payee))
.appendQueryParameter("tr",orderId)
.appendQueryParameter("tn",description)
.appendQueryParameter("am",String.valueOf(amount))
.appendQueryParameter("cu","INR")
.build();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uriapp);
intent.setPackage(model.getPackageName());
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(intent,GOOGLE_REQUEST_CODE);
} else {
Toast.makeText(this,"This payment mode is not available on your device.",Toast.LENGTH_LONG).show();
}
我使用的是正确的 vpa 业务 ID。
GPay 错误:
this transaction may be risky. for your safety it cant be completed at this time
解决方法
目前此代码段在测试应用中有效。如果它不适用于您,请告诉我。
private static final int TEZ_REQUEST_CODE = 123;
private static final String GOOGLE_TEZ_PACKAGE_NAME =
"com.google.android.apps.nbu.paisa.user";
Uri uri =
new Uri.Builder()
.scheme("upi")
.authority("pay")
.appendQueryParameter("pa","test@okbizaxis")
.appendQueryParameter("pn","Test")
.appendQueryParameter("mc","1234")
.appendQueryParameter("tr","1234")
.appendQueryParameter("tn","test")
.appendQueryParameter("am","10")
.appendQueryParameter("cu","INR")
.appendQueryParameter("url","")
.build();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME);
startActivityForResult(intent,TEZ_REQUEST_CODE);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。