patilshreyas / easyupipayment-android Goto Github PK
View Code? Open in Web Editor NEW📱Android Library to implement UPI Payment integration easily in Android App 💳💸
Home Page: https://eupipay-docs.netlify.app/
License: Apache License 2.0
📱Android Library to implement UPI Payment integration easily in Android App 💳💸
Home Page: https://eupipay-docs.netlify.app/
License: Apache License 2.0
TransactionDetails
model classimplement with https://github.com/mgks/Android-SmartWebView always given me Failed message
my code
this function call by url
private void pay() {
String transactionId = "T" + System.currentTimeMillis();
EasyUpiPayment mEasyUpiPayment = new EasyUpiPayment.Builder()
.with(this)
.setPayeeVpa("****")
.setPayeeName("dhiraj")
.setTransactionId(transactionId)
.setTransactionRefId(transactionId)
.setDescription("test")
.setAmount("01.00")
.build();
mEasyUpiPayment.setPaymentStatusListener(this);
mEasyUpiPayment.setDefaultPaymentApp(PaymentApp.NONE);
mEasyUpiPayment.startPayment();
}
onTransactionCompleted returns the transaction details which i need . thats why onTransactionCompleted is important for me to get called. but it is not getting called.
please help.
I am trying to make payments via Google Pay, PhonePe & Paytm. The payments via Google Pay & PhonePe are getting failed!.
In Google Pay, although the transaction limit is not reached, it is showing limit reached.
In PhonePe, its showing technical errors.
Now, while I am trying to do the payments via GPay or PhonePe apps, there is no such problem.
PLease guide me!
Write information about Bug/Feature Request here
The payment option for different apps got removed after some error during payments in different apps. Now, they are showing less apps (Apps which have payment failure were not listed in AppBottomSheet) even after I reinstall the app.
How can i confirm transaction is from valid psp (like gpay, phonepe.. etc)
This not returning transaction id generated from upi application
so can you please tell me that how can i get transaction id generated form upi application
Always getting error message "you've exceeded the maximum transaction amount set by your bank", I hope this logic no longer working and UPI might have made some changes for this type of 3rd party payments, any updated working solution @PatilShreyas
Write information about Bug/Feature Request here
I have GooglePay, Phonepe, Amazon Pay installed on my mobile but whenever I select payment app.GOOGLE-PAY, it is showing no UPI app found with package name com.google.android.apps.nbu.paisa.user exists on this device.
`
if (upigpay == "1") {
val dialog = Dialog(this@AddFunds)
val li =
getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val vi: View = li.inflate(R.layout.dailogpaymentbox, null, false)
val window = dialog.window
window!!.setBackgroundDrawableResource(android.R.color.transparent)
vi.background = resources.getDrawable(R.drawable.roundalert)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setContentView(vi)
val rlenglish = dialog.findViewById(R.id.rlenglish)
val rlhindi = dialog.findViewById(R.id.rlhindi)
rlenglish.visibility = View.GONE
rlhindi.setOnClickListener {
val r = Random()
val output =
r.nextInt(2000000 - 200000 + 1).toString() + "20000"
transactionId = "TID" + System.currentTimeMillis() + output
PaymentApp.GOOGLE_PAY
val paymentApp = PaymentApp.GOOGLE_PAY
val builder: EasyUpiPayment.Builder? = upi_payment_id?.let { it1 ->
transactionId?.let { it2 ->
EasyUpiPayment.Builder(this@AddFunds)
.with(paymentApp)
.setPayeeVpa(it1)
.setPayeeName("RR Starline")
.setTransactionId(it2)
.setTransactionRefId(transactionId!!)
.setDescription("RR Straline-$mobile")
.setAmount(edtamount.text.toString() + ".00")
}
}
// END INITIALIZATION
// END INITIALIZATION
try {
// Build instance
if (builder != null) {
easyUpiPayment = builder.build()
}
// Register Listener for Events
easyUpiPayment!!.setPaymentStatusListener(this@AddFunds)
// Start payment / transaction
easyUpiPayment!!.startPayment()
dialog.dismiss()
} catch (exception: java.lang.Exception) {
exception.printStackTrace()
dialog.dismiss()
Toast.makeText(this@AddFunds, "" + exception.message, Toast.LENGTH_SHORT).show()
}
}
dialog.show()
}
else if (upiphonepe == "1") {
val dialog = Dialog(this@AddFunds)
val li =
getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val vi: View = li.inflate(R.layout.dailogpaymentbox, null, false)
val window = dialog.window
window!!.setBackgroundDrawableResource(android.R.color.transparent)
vi.background = resources.getDrawable(R.drawable.roundalert)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setContentView(vi)
val rlenglish = dialog.findViewById<RelativeLayout>(R.id.rlenglish)
val rlhindi = dialog.findViewById<RelativeLayout>(R.id.rlhindi)
rlenglish.visibility = View.GONE
rlhindi.setOnClickListener {
val r = Random()
val output =
r.nextInt(2000000 - 200000 + 1).toString() + "20000"
transactionId = "TID" + System.currentTimeMillis() + output
PaymentApp.PHONE_PE
val paymentApp = PaymentApp.PHONE_PE
val builder: EasyUpiPayment.Builder? = upi_payment_id?.let { it1 ->
transactionId?.let { it2 ->
EasyUpiPayment.Builder(this@AddFunds)
.with(paymentApp)
.setPayeeVpa(it1)
.setPayeeName("RR Starline")
.setTransactionId(it2)
.setTransactionRefId(transactionId!!)
.setDescription("RR Straline-$mobile")
.setAmount(edtamount.text.toString() + ".00")
}
}
// END INITIALIZATION
// END INITIALIZATION
try {
// Build instance
if (builder != null) {
easyUpiPayment = builder.build()
}
// Register Listener for Events
easyUpiPayment!!.setPaymentStatusListener(this@AddFunds)
// Start payment / transaction
easyUpiPayment!!.startPayment()
dialog.dismiss()
} catch (exception: java.lang.Exception) {
exception.printStackTrace()
dialog.dismiss()
Toast.makeText(this@AddFunds, "" + exception.message, Toast.LENGTH_SHORT).show()
}
}
dialog.show()
}
else if (upiothers == "1") {
val dialog = Dialog(this@AddFunds)
val li =
getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val vi: View = li.inflate(R.layout.dailogpaymentbox, null, false)
val window = dialog.window
window!!.setBackgroundDrawableResource(android.R.color.transparent)
vi.background = resources.getDrawable(R.drawable.roundalert)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setContentView(vi)
val rlenglish = dialog.findViewById<RelativeLayout>(R.id.rlenglish)
val rlhindi = dialog.findViewById<RelativeLayout>(R.id.rlhindi)
rlenglish.visibility = View.GONE
rlhindi.setOnClickListener {
val r = Random()
val output =
r.nextInt(2000000 - 200000 + 1).toString() + "20000"
transactionId = "TID" + System.currentTimeMillis() + output
PaymentApp.ALL
val paymentApp = PaymentApp.ALL
val builder: EasyUpiPayment.Builder? = upi_payment_id?.let { it1 ->
transactionId?.let { it2 ->
EasyUpiPayment.Builder(this@AddFunds)
.with(paymentApp)
.setPayeeVpa(it1)
.setPayeeName("RR Starline")
.setTransactionId(it2)
.setTransactionRefId(transactionId!!)
.setDescription("RR Straline-$mobile")
.setAmount(edtamount.text.toString() + ".00")
}
}
// END INITIALIZATION
// END INITIALIZATION
try {
// Build instance
if (builder != null) {
easyUpiPayment = builder.build()
}
// Register Listener for Events
easyUpiPayment!!.setPaymentStatusListener(this@AddFunds)
// Start payment / transaction
easyUpiPayment!!.startPayment()
dialog.dismiss()
} catch (exception: java.lang.Exception) {
exception.printStackTrace()
dialog.dismiss()
Toast.makeText(this@AddFunds, "" + exception.message, Toast.LENGTH_SHORT).show()
}
}
dialog.show()
}`
This is my code where i am selecting a radio button and according to it I am opening the UPI app.
Thing is that the user might change the UPI Amount when the UPI App is opened [In case of Paytm]. Is there any way to get the Actual Amount Send in the onTransactionComplete or onSuccess ???
Write information about Bug/Feature Request here
So with the new update it isn't possible for us to pay to non-merchant accounts. But my doubt is does the user(us) need to have a merchant/business account as well? Or can we the user have a normal account and pay any merchant account?
Hi Shreyas,
Greeting!
It's a kind request that whenever you update the package please let me know what all new features have been done.
Thank you.
Phonepe,google Pay is not working.but other apps like amazon pay are working
The method isDefaultAppExist is not found in the library module code. Found when the code was recompiled for supporting minSdkDependency 14.
In response showing null in approvalRefNo and 00 in response code.
Here is Log Details
TransactionDetails: transactionId:T1579696281289, responseCode:00, transactionRefId:T1579696281289, approvalRefNo:null, status:Success
While Paytym is working.
This libray is very helpful for us to handle UPI payments with simple steps. Great work but i am facing below issue when i used this libray. Please help me to resolve this issue. Once i tap payment from the sample app and if no application available in my device getting crashed.
com.shreyaspatil.easyupipayment.exception.AppNotFoundException: No UPI app exists on this device to perform this transaction.
Custom View support for UPI Apps list
For every UPI transaction , there will be a UTR transaction numbers. It will be useful to verify the transaction from User. I can't see this option anywhere, if its already exists then please let me know how to utilize it.
Any idea of response code U29-RA for a failed transaction.
If there is UPI api guide, please point me towards it.
After startPayment() , It opens a activity/fragment with white background and a progressbar .
I need to change the activity background color .
My app is completely dark .
Is there a way around to change the color?
I have implemented your code, but I am facing issue if both sender and receiver have UPI IDS on the same phone. (Google pay error: error in google pay: oops, something went wrong, if your payment has been debited with this charge and ....)
Hey, thanks for this making this library.
My query is, suppose a payment status is SUBMITTED, so is there any way or an API available where I can check status of the payment after it has been completed
Currently, a demo app of repo included static information hardcoded and directly passed to EasyUpiPayment
. It'll be useful for testing if developers can test the library using demo APK.
Requirement:
Add EditText
fields to take user inputs such as Transaction ID, payee name, payee vpa, etc mandatory details and after clicking on button, these details should passed to EasyUpiPayment
object. That's it.
and one more important thing - Keep It Material
PRs are welcome.
Instead of using the Intent filter to launch apps, use default app launcher and let system show available apps for UPI payment.
Write information about Bug/Feature Request hereRs
Rs. 97,566.00 entry received with success status.
Payment Declined for security reason msg coming till know its working well sudden transection failed , how to solve this problem
let me know
Write information about Bug/Feature Request here
The Problem
No matter what UPI app I trigger, it just says, "Maximum limit exceeded...." and the transaction just got failed.
NO ERROR MESSAGE IS LOGGING
I have install your demo app and try to send amount to user simmiler issue is coming - in gpay , phonepe, paytm
can you check it in you own demo app please sir
i used this library last 5 month but last 2 day not working please solve it
in Advance Thank you
I noticed that only paytm works. Other apps like google pay, amazon pay, bhim, phonePe are not working. Though the app is installed, I keep getting error "NO Upi Apps found, Please Install to Proceed!". Am I missing something here?
Below is my code
In On create:
private fun initPayment() {
upiPayment?.let {
easyUpiPayment = EasyUpiPayment.Builder()
.with(requireActivity())
.setPayeeVpa(it.upiId)
.setPayeeName(it.upiName)
.setTransactionId(it.transactionId)
.setTransactionRefId(it.transactionRefId)
.setDescription(it.description)
.setAmount(it.amount)
.build()
}
easyUpiPayment?.setPaymentStatusListener(this)
}
googlePayContainer.setOnClickListener {
startPaymentApp(PaymentApp.GOOGLE_PAY)
}
paytm.setOnClickListener {
startPaymentApp(PaymentApp.PAYTM)
}
phonePe.setOnClickListener {
startPaymentApp(PaymentApp.PHONE_PE)
}
amazonPay.setOnClickListener {
startPaymentApp(PaymentApp.AMAZON_PAY)
}
bhim.setOnClickListener {
startPaymentApp(PaymentApp.BHIM_UPI)
}
private fun startPaymentApp(paymentApp: PaymentApp) {
appPackageName = paymentApp.packageName
easyUpiPayment?.apply {
setDefaultPaymentApp(paymentApp)
startPayment()
}
}
Sample APK not working on my Redmi note 9 pro max device, tried PhonePay and GPay, please check.
Hey cool library, but looks like payments aren't going through at all, I keep seeing a 'missing m-pin' toast.
Any clue where this is coming from and how to fix it?
Adding callback method for transaction with status SUBMITTED. onTransactionSubmitted()
will have to call when transaction status is Submitted
.
Hi Shreyas,
Thanks for this wonderful library, I am getting Payment failed "You've exceeded the maximum transaction amount set by your bank" after integrating with this, but i am able to make the payments without any issues using google payment app, could you help me to guide here.
Please view the snapshot for reference https://ibb.co/q0DSGtY
Any insight on how can I use it in cordova app?
Hi,
This was working perfectly, but now I am getting "Maximum transaction amount limit exceeded" for any transaction amount (tried from 1-100) and for all apps (tested on PayTm, PhonePe, GooglePe).
Are you aware of any changes done from UPI end which might have caused this?
Write information about Bug/Feature Request here
Write information about Bug/Feature Request here
I am trying to make payments via Google Pay, PhonePe & Paytm. The payments via Google Pay & PhonePe are getting failed!.
In Google Pay, although the transaction limit is not reached, it is showing limit reached.
In PhonePe, its showing technical errors.
Now, while I am trying to do the payments via GPay or PhonePe apps, there is no such problem.
PLease guide me!
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=4400, result=-1, data=Intent { (has extras) }} to activity {com.example.raj.checker/com.shreyaspatil.EasyUpiPayment.ui.PaymentUiActivity}: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at android.app.ActivityThread.deliverResults(ActivityThread.java:4423)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4465)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at com.shreyaspatil.EasyUpiPayment.ui.PaymentUiActivity.getQueryString(PaymentUiActivity.java:143)
at com.shreyaspatil.EasyUpiPayment.ui.PaymentUiActivity.getTransactionDetails(PaymentUiActivity.java:151)
at com.shreyaspatil.EasyUpiPayment.ui.PaymentUiActivity.onActivityResult(PaymentUiActivity.java:111)
at android.app.Activity.dispatchActivityResult(Activity.java:7590)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4416)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4465)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
same thing happened while using BHIM UPI..
Hi,
Thanks for writting this library. It's really very good and useful.
The issue that I'm facing is with the TransactionID.
When the transaction is executed, I'm able to get the TransactionId which I provide, but I need the particular app's Transaction ID.
Example: my transid = ED765T but Phonepe's is = PMR45365467575
So here, I'm getting "ED765T" But I need "PMR45365467575"
Note: getApprovalRefNo() always returns null.
Please help with this
Typo fix on Line 189
Something went wrong . Please try again later message showing
work fine with paytm
/docs
directory.We can achieve it using 2 ways-
startPayment()
which takes package name as parameter.Builder
such that developer can specify to pay with only specific app.If app exists it'll directly pay throught it, otherwise do fail transaction.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.