-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMisc.java
20 lines (17 loc) · 841 Bytes
/
Misc.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Misc{
private void upiPayment(String amount, String note, String name, String upiId) {
Uri uri = Uri.parse("upi://pay").buildUpon()
.appendQueryParameter("pa", upiId)
.appendQueryParameter("pn", name)
.appendQueryParameter("tn", note)
.appendQueryParameter("am", amount)
.appendQueryParameter("cu", "INR")
.build();
Intent upiPayIntent = new Intent(Intent.ACTION_VIEW);
upiPayIntent.setData(uri);
Intent intent = Intent.createChooser(upiPayIntent,"Pay Using");
if(intent.resolveActivity(getPackageManager())!=null)
startActivityForResult(intent, 101);
else Toast.makeText(this, "No UPI app found, please install one to continue", Toast.LENGTH_SHORT).show();
}
}