简体   繁体   English

如何使用Android从Intent打开Paytm应用?

[英]How do I open Paytm app from Intent using Android?

I'm creating a food delivery app for restaurants for a university campus. 我正在为大学校园的餐馆创建送餐应用程序。 Most of these restaurants accept Paytm as a payment method. 这些餐厅大多数都接受Paytm作为付款方式。

I want to add a button in my app to launch the Paytm app with the mobile number of the vendor and the amount of order filled in. So the user only has to press one button to complete the payment.I don't even need to receive payment confirmation from Paytm. 我想在我的应用程序中添加一个按钮以启动Paytm应用程序,其中包含供应商的手机号码和填写的订单金额。因此,用户只需按一个按钮即可完成付款。我什至不需要收到Paytm的付款确认。

I can't use the payment API because it'll restrict the payment to only one account for which the API key is generated. 我无法使用付款API,因为它将付款限制为仅为其生成API密钥的一个帐户。

If it's not possible via intents, is it possible via deep linking? 如果通过意图无法实现,是否可以通过深度链接实现?

I don't know how to open it directly, but so far I came up with the below code. 我不知道如何直接打开它,但是到目前为止,我想到了下面的代码。 It opens the browser and it will redirect to the app. 它将打开浏览器,并将重定向到该应用程序。

String url = "http://m.p-y.tm";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

you can use package name of PayTm like this, 您可以这样使用PayTm的软件包名称,

String appPackageName = "net.one97.paytm";
                    PackageManager pm = getContext().getPackageManager();
                    Intent appstart = pm.getLaunchIntentForPackage(appPackageName);
                    if(null!=appstart)
                    {
                        getContext().startActivity(appstart);
                    }
                    else {
                        Toast.makeText(getContext(), "Install PayTm on your device", Toast.LENGTH_SHORT).show();
                    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android - 如何通过Intent在另一个应用程序中打开文件? - Android - How do I open a file in another app via Intent? 如何使用自己的Android应用程序中的意图在Facebook应用程序中打开特定相册或照片 - How to open a specific album or photo in facebook app using intent from your own Android App 如何为Chrome编写Android意图以打开GMail应用并搜索? - How do I write an Android intent for Chrome to open the GMail app and search? 当我的应用程序打开并且用户选择“始终”在我的应用程序中打开域时,如何绕过Android意向过滤器? - How do I bypass Android intent filter when my app is open and user has selected to “always” open domain in my app? 使用 Intent-filter 从 URL 打开 Android 应用程序不起作用 - Open Android app from URL using intent-filter not working Android 如何设置 Intent 以打开 adobe connect 应用程序 - Android how can I set an Intent to open adobe connect app android:如何从我的应用程序打开另一个应用程序? - android: how do i open another app from my app? Android Intent-如何从选择列表中打开我自己的应用并获取我输入的消息 - Android intent - how to open my own app from choosing list and get the message I entered 在Android中如何使用intent打开内置画廊应用程序的系统? - In Android how to open system built in gallery app using intent? 如何在您的 Android 应用程序中使用 Intent 打开 WhatsApp - How to open WhatsApp using an Intent in your Android App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM