PatilShreyas / EasyUpiPayment-Android

📱Android Library to implement UPI Payment integration easily in Android App 💳💸
https://eupipay-docs.netlify.app/
Apache License 2.0
356 stars 120 forks source link

[BUG] AppNotFoundException throw from onCreate() of PaymentUiActivity, So can't catch it. #140

Open hardikp888 opened 2 years ago

hardikp888 commented 2 years ago

Library is throwing the exception from onCreate() of PaymentUiActivity. So as a consumer, we can to catch it.

Prerequisite Device is not having any UPI application.

How to Reproduce:

image

Logs

Caused by: dev.shreyaspatil.easyupipayment.exception.AppNotFoundException: No UPI app exists on this device to perform this transaction.
        at dev.shreyaspatil.easyupipayment.ui.PaymentUiActivity.throwOnAppNotFound$EasyUpiPayment_release(PaymentUiActivity.kt:128)
        at dev.shreyaspatil.easyupipayment.ui.PaymentUiActivity.onCreate(PaymentUiActivity.kt:62)
        at android.app.Activity.performCreate(Activity.java:6674)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2690)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2806) 
        at android.app.ActivityThread.-wrap12(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1540) 
        at android.os.Handler.dispatchMessage(Handler.java:110) 
        at android.os.Looper.loop(Looper.java:203) 
        at android.app.ActivityThread.main(ActivityThread.java:6293) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1065) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926) 

Solution Suggestion Do not throw an exception. Add new callback method inside PaymentStatusListener onAppNotFound().

sharmaAshish-dev commented 2 years ago

for solution please refer to https://github.com/PatilShreyas/EasyUpiPayment-Android/issues/149#issuecomment-1046600257