3

I'm creating a food delivery app for restaurants for a university campus. Most of these restaurants accept Paytm as a payment method.

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.

I can't use the payment API because it'll restrict the payment to only one account for which the API key is generated.

If it's not possible via intents, is it possible via deep linking?

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Yashovardhan99
  • 887
  • 11
  • 26
  • https://stackoverflow.com/questions/33384872/integration-paytm-payment-gateway-android – Quick learner Aug 23 '18 at 11:26
  • https://stackoverflow.com/questions/28082577/how-do-i-integrate-paytm-wallet-in-an-android-application – Quick learner Aug 23 '18 at 11:26
  • https://stackoverflow.com/questions/30069644/how-to-integrate-paytm-wallet-in-android-application – Quick learner Aug 23 '18 at 11:26
  • 1
    @quicklearner Hi, none of these solve my issue. I'm not looking to add a payment gateway or use the Paytm API. I'm looking for a way to launch the Paytm app with specific details like restaurant mobile number and order amount as extras so that the user can manually complete the transictions. I don't need my app to receive any message after the transiction. – Yashovardhan99 Aug 23 '18 at 11:31
  • you should look at paytm sdk documentation for that , if thats possible without integration :) – Quick learner Aug 23 '18 at 11:53
  • `m looking for a way to launch the Paytm app with specific details like restaurant mobile number and order amount as extras so that the user can manually complete the transictions` keep in mind that this may simply be not possible. – Marcin Orlowski Aug 23 '18 at 12:00
  • 1
    @quicklearner thanks. Seems like it's not possible to do so – Yashovardhan99 Aug 23 '18 at 12:43
  • @MarcinOrlowski thanks. Is there any alternative way like deep linking to achieve this? Or is this something which is just not possible? – Yashovardhan99 Aug 23 '18 at 12:49
  • The thing is app must allow that. It's not that i.e. framework provides out of the box. If app is not expecting anything in the intent. the whatever you pass will not work as app do not care. Simple as that. Unfortunately. – Marcin Orlowski Aug 23 '18 at 13:51
  • sir @MarcinOrlowski paytm is automatically getting linked with phone contacts and from contacts its possible to open paytm app with particular details filled..... so will i be able to get any info from the contacts content provider? – Jose Kj Nov 25 '18 at 11:04

2 Answers2

3

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);
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
0

you can use package name of PayTm like this,

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();
                    }
divine_rythm
  • 149
  • 3
  • 9