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?

10

3 Answers 3

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);
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();
                    }
0

Use the below URL in Android. I've not tested this on iOS.

"paytmmp://pay?pa=UPIID@oksbi&pn=FNAME SNAME K&cu=INR"

Not the answer you're looking for? Browse other questions tagged or ask your own question.