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:
Download the demo application
Fill the details and select the UPI as Default.
Click on PAY WITH UPI
Application will crash because there is no UPI application found and exception is been throw from onCreate() method.
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().
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:
Logs
Solution Suggestion Do not throw an exception. Add new callback method inside PaymentStatusListener onAppNotFound().