Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoke PSP app with UPI url

I am trying to create a merchant app which will generate a url based on NPCI's guidelines. This url will be shared as intent and the PSP app (Any registered bank app) should be able to listen to that url and get invoked.

I have formed a url like this:-

upi://pay?pa=icici/name&pn=USER_NAME&tid=422d97c1-f0fc-4bea-b24a-511ffa85e86f&am=442.87&tn=Test%transaction

Now I am sending the intent like this :-

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, UPI);
sendIntent.setType("text/plain");
startActivity(sendIntent);

Icici bank app is not being shown in the receiver apps. Am I creating the url correctly?

UPI being released quite recently, I am unable to get good resource over the internet.

Note - In the url, the tid(transaction id) is a random uuid being generated in my app.

like image 291
deep Avatar asked Sep 08 '16 07:09

deep


People also ask

Where is UPI PSP in Google pay?

Open Google Pay . In the top right, tap your photo. Tap Bank account. Tap the bank account whose UPI ID you want to view.

Can I integrate UPI with my app?

Integrate through your Android device Have your Merchant Virtual Payment Address (UPI ID) ready from your bank or payment service provider. Find the Android developer documentation. Complete the Prerequisites. Register with Google Pay & Wallet Console.

What is UPI PSP app?

PSP is banking company that is a member of UPI and connects to the UPI platform for providing UPI payment facility to the PSP and TPAP which in turn enables the Users and merchants to complete payment transactions over UPI.


1 Answers

Found the correct way to do that. You need to frame the URL in the proper way as mentioned in the question. After that, this URL has to be converted to URI and sent as data to the intent.

Intent intent = new Intent();
intent.setData(Uri.parse(UPI));
Intent chooser = Intent.createChooser(intent, "Pay with...");
startActivityForResult(chooser, 1, null);

After that, in your onActivityResult, check for the requestCode and id received intend data is null. If not, then the data will contain a stringExtra as response. This response will contain the status, transaction reference, transactionId and the response code.

Also, spaces in the url should be replaced with a '+' and not with '%'.

like image 55
deep Avatar answered Oct 15 '22 10:10

deep