Git Product home page Git Product logo

easyupipayment-android's Introduction

Easy UPI Payment - Android Library 📱💳

Maven Central API


Demo application

See these code examples in /app module of this repository. Example implementations are available in both Java and Kotlin programming languages.

You can download demo version of Android app from here

EasyUpiPayment Demo App

Contribute

We can collaboratively make it happen. So if you have any issues, new ideas about implementations then just raise issue and we are open for Pull Requests. Improve and make it happen. See Contributing Guidelines.

License

   Copyright 2019 Shreyas Patil

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

easyupipayment-android's People

Contributors

abg4real avatar dependabot[bot] avatar imgbotapp avatar lakhanmeghani avatar patilshreyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easyupipayment-android's Issues

[BUG] Payment App not visible after error

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.

Only Paytm Works other upi apps doesnt work

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

No UPI app exists on this device to perform this transaction.

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.

TransactionID mismatch

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

Payment Status

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

[Request on documentation]

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.

Hello sir

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

[BUG/FEATURE REQUEST] GET AMOUNT SEND

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 ???

[BUG] All UPI payments are failing

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

Interactive demo app for Payment

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.

[BUG/FEATURE REQUEST] implement with https://github.com/mgks/Android-SmartWebView always given me Failed message

implement 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();

	}

Enable app specific payment

We can achieve it using 2 ways-

  1. Create parameterized method startPayment() which takes package name as parameter.
  2. Create a method in 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.

PhonePay and GooglePay not working

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.

TRANSACTION via Google Pay & PhonePe not working

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!

upi apps not opened

Phonepe,google Pay is not working.but other apps like amazon pay are working

[Issue] Query about the new release

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?

Issue, App is installed in the phone but it is shwoing no such app is installed

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.

Payment desclined

Payment Declined for security reason msg coming till know its working well sudden transection failed , how to solve this problem
let me know

[BUG?] Missing Mpin field

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?

Error has still not resolved in the new version related to issue #21

image

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..

Payments failing

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

Getting Payment failed message

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

[BUG/FEATURE REQUEST] TITLE 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!

Fix/Improvements Library code

Proposed change

  • Fix or improve the code of the library module.
  • This change is encouraged during "Hacktoberfest" for the participants of this event.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.