Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

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

Open
hardikp888 opened this issue Oct 12, 2021 · 1 comment
Assignees

Comments

@hardikp888
Copy link

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

image

  • 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().

@sharmaAshish-dev
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants