Closed pratikbutani closed 3 years ago
@pratikbutani We are looking into this issue. Will release a new version with a fix soon.
Okay, Thank you @sumedht Until any trick to prevent this error?
@pratikbutani No not have any trick
Is there any solution? I am facing the same issue.
Any update on this team?
@the-kool-sk I got this similar error in Android (JAVA). The actual problem was, I was using Razorpay Checkout in a fragment which is not allowed. The Checkout & PaymentListener should be implemented in an Activity and not in a Fragment, this solved my problem. I guess when you further pass the data from the Activity to Fragment, this error is generated.
EDIT: I don't know if this helps/works for you or not, but just thought to let you know (if it helps). GoodLuck!
@adityaasthana1 Actually I am staring the checkout process in flutter view. So I am not sure whether sdk uses activity or fragment internally for checkout. I cannot specify to start the process in activity... thanks for support though.
I'm getting the same error
I/zygote64(12716): Do partial code cache collection, code=243KB, data=160KB
I/zygote64(12716): After code cache collection, code=243KB, data=160KB
I/zygote64(12716): Increasing code cache capacity to 1024KB
I/zygote64(12716): Compiler allocated 8MB to compile void android.view.ViewRootImpl.performTraversals()
W/System.err(12716): org.json.JSONException: No value for order_id
W/System.err(12716): at org.json.JSONObject.get(JSONObject.java:392)
W/System.err(12716): at com.razorpay.Lumberjack.getValueFromJsonObject(Lumberjack.java:418)
W/System.err(12716): at com.razorpay.Lumberjack.addPropertyFromJSONObject(Lumberjack.java:402)
W/System.err(12716): at com.razorpay.Lumberjack.addFilteredPropertiesFromPayload(Lumberjack.java:458)
W/System.err(12716): at com.razorpay.AnalyticsUtil.addFilteredPropertiesFromPayload(AnalyticsUtil.java:107)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl.addAnalyticsData(CheckoutPresenterImpl.java:887)
W/System.err(12716): at com.razorpay.OtpElfCheckoutPresenterImpl.addAnalyticsData(OtpElfCheckoutPresenterImpl.java:171)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl.onSubmit(CheckoutPresenterImpl.java:910)
W/System.err(12716): at com.razorpay.CheckoutBridge$10.secure(CheckoutBridge.java:157)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl.executeWebViewCallback(CheckoutPresenterImpl.java:1221)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl.access$700(CheckoutPresenterImpl.java:49)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl$17.run(CheckoutPresenterImpl.java:1207)
W/System.err(12716): at android.os.Handler.handleCallback(Handler.java:790)
W/System.err(12716): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(12716): at android.os.Looper.loop(Looper.java:192)
W/System.err(12716): at android.app.ActivityThread.main(ActivityThread.java:6754)
W/System.err(12716): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(12716): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
W/System.err(12716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
D/com.razorpay.checkout(12716): {"key":"NTZmNWIwNGZhODc1MmUyY2YxOTM5NmM0","events":[{"event":"ch:and_checkout:activity:init_start","timestamp":"1620707167","properties":{"local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1}},{"event":"assist:and_error_log","timestamp":"1620707167","properties":{"error_message":"No value for send_sms_hash","error_level":"error:exception","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1}},{"event":"assist:and_error_log","timestamp":"1620707168","properties":{"error_message":"Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference","error_level":"critical","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N"}},{"event":"assist:and_error_log","timestamp":"1620707168","properties":{"error_message":"No dash options defined","error_level":"error","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"framework":"flutter","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true}}},{"event":"assist:and_error_log","timestamp":"1620707168","properties":{"error_message":"No value for theme","error_level":"error","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"framework":"flutter","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true}}},{"event":"assist:and_perm:sms_already:not:granted","timestamp":"1620707168","properties":{"local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"framework":"flutter","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true}}},{"event":"assist:and_perm:sms_already:not:granted","timestamp":"1620707168","properties":{"local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"framework":"flutter","OTPElf Version":"","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true}}},{"event":"ch:and_cardsaving_start","timestamp":"1620707168","properties":{"local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"payment_attempt":1,"framework":"flutter","OTPElf Version":"","contact":"7829717247","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"
D/com.razorpay.checkout(12716): Sending data to lumberjack
D/com.razorpay.checkout(12716): Response from lumberjack:
D/PhoneWindow(12716): DEBUG_ALIENSCREEN:getRotation mRotation=0
I/DecorView(12716): setWindowBackground mBackgroundPadding = Rect(0, 0 - 0, 0), mFramePadding = Rect(0, 0 - 0, 0), pkg = com.moden.moden
D/com.razorpay.checkout(12716): RzpAssist onPageStarted: https://api.razorpay.com/v1/payments/create/checkout
D/com.razorpay.checkout(12716): setPaymentID called: pay_H9LxXZKsXjdZeJ
I/TouchMotionHandler(12716): handler onAttached
I/TouchMotionHandler(12716): handler onDetached
D/com.razorpay.checkout(12716): not magic
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught SyntaxError: Invalid or unexpected token
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Invalid or unexpected token", source: https://api.razorpay.com/v1/payments/create/checkout (1)
I/zygote64(12716): Compiler allocated 8MB to compile void android.view.ViewRootImpl.performTraversals()
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught TypeError: window.getDeviceDetails is not a function
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught TypeError: window.getDeviceDetails is not a function", source: https://api.razorpay.com/v1/payments/create/checkout (1)
D/PhoneWindow(12716): DEBUG_ALIENSCREEN:getRotation mRotation=0
I/DecorView(12716): setWindowBackground mBackgroundPadding = Rect(0, 0 - 0, 0), mFramePadding = Rect(0, 0 - 0, 0), pkg = com.moden.moden
D/com.razorpay.checkout(12716): RzpAssist onPageStarted: https://api.razorpay.com/v1/gateway/mocksharp/payment?key_id=rzp_test_eG4FSYzkpjfD5N
I/TouchMotionHandler(12716): handler onAttached
I/TouchMotionHandler(12716): handler onDetached
D/com.razorpay.checkout(12716): not magic
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught SyntaxError: Invalid or unexpected token
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Invalid or unexpected token", source: https://api.razorpay.com/v1/gateway/mocksharp/payment?key_id=rzp_test_eG4FSYzkpjfD5N (1)
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught TypeError: window.getDeviceDetails is not a function
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught TypeError: window.getDeviceDetails is not a function", source: https://api.razorpay.com/v1/gateway/mocksharp/payment?key_id=rzp_test_eG4FSYzkpjfD5N (1)
D/PhoneWindow(12716): DEBUG_ALIENSCREEN:getRotation mRotation=0
I/DecorView(12716): setWindowBackground mBackgroundPadding = Rect(0, 0 - 0, 0), mFramePadding = Rect(0, 0 - 0, 0), pkg = com.moden.moden
D/com.razorpay.checkout(12716): RzpAssist onPageStarted: https://api.razorpay.com/v1/payments/pay_H9LxXZKsXjdZeJ/callback/8bd8be14f8e587c56f87852704eb97451bc0968c/rzp_test_eG4FSYzkpjfD5N?status=authorized&token_recurring_status=rejected&language_code=en
I/TouchMotionHandler(12716): handler onAttached
D/com.razorpay.checkout(12716): oncomplete JavascriptInterface
I/TouchMotionHandler(12716): handler onDetached
D/com.razorpay.checkout(12716): not magic
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught SyntaxError: Invalid or unexpected token
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Invalid or unexpected token", source: https://api.razorpay.com/v1/payments/pay_H9LxXZKsXjdZeJ/callback/8bd8be14f8e587c56f87852704eb97451bc0968c/rzp_test_eG4FSYzkpjfD5N?status=authorized&token_recurring_status=rejected&language_code=en (1)
D/com.razorpay.checkout(12716): {"key":"NTZmNWIwNGZhODc1MmUyY2YxOTM5NmM0","events":[{"event":"assist:and_rzpassist_page:start","timestamp":"1620707265","properties":{"url":"https:\/\/api.razorpay.com\/v1\/payments\/create\/checkout","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"method":"card","card_number":"458546","payment_attempt":1,"amount":606600,"framework":"flutter","OTPElf Version":"","contact":"+917829717247","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true},"email":"gaurav.kumar@example.com"}},{"event":"ch:and_payment:id_attached","timestamp":"1620707265","properties":{"local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"method":"card","card_number":"458546","payment_id":"pay_H9LxXZKsXjdZeJ","payment_attempt":1,"amount":606600,"framework":"flutter","OTPElf Version":"","contact":"+917829717247","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true},"email":"gaurav.kumar@example.com"}},{"event":"assist:and_rzpassist_page:finish","timestamp":"1620707265","properties":{"page_load_time":0.234330573,"url":"https:\/\/api.razorpay.com\/v1\/payments\/create\/checkout","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"method":"card","card_number":"458546","payment_id":"pay_H9LxXZKsXjdZeJ","payment_attempt":1,"amount":606600,"framework":"flutter","OTPElf Version":"","contact":"+917829717247","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true},"email":"gaurav.kumar@example.com"}},{"event":"ch:and_js:console_error","timestamp":"1620707265","properties":{"line_number":"1","source_id":"https:\/\/api.razorpay.com\/v1\/payments\/create\/checkout","message":"Uncaught SyntaxError: Invalid or unexpected token","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"method":"card","card_number":"458546","payment_id":"pay_H9LxXZKsXjdZeJ","payment_attempt":1,"amount":606600,"framework":"flutter","OTPElf Version":"","contact":"+917829717247","merchant_package":"com.moden.moden","merchant_key":"rzp_test_eG4FSYzkpjfD5N","merchant options":{"amount":606600,"external":{"wallets":["paytm","phonepe","gpay"]},"prefill":{"contact":"7829717247","email":"gaurav.kumar@example.com"},"name":"","description":"Fine T-Shirt","currency":"INR","key":"rzp_test_eG4FSYzkpjfD5N","redirect":true},"email":"gaurav.kumar@example.com"}},{"event":"ch:and_js:console_error","timestamp":"1620707265","properties":{"line_number":"1","source_id":"https:\/\/api.razorpay.com\/v1\/payments\/create\/checkout","message":"Uncaught TypeError: window.getDeviceDetails is not a function","local_order_id":"G8KulB94c9wy2k","local_payment_id":"G8KulBPrCHQvbJ","merchant_app_name":"moden","merchant_app_version":"1.0.0","merchant_app_build":1,"method":"card","card_number":"458546","payment_id":"pay_H9LxXZKsXjdZeJ","payment_attempt":1,"amount":606600,"framework":"flutter","OTPElf Version":"","contact":"+917829717247","merch
D/com.razorpay.checkout(12716): Sending data to lumberjack
I/flutter (12716): success Instance of 'PaymentSuccessResponse'
I/SurfaceView(12716): updateSystemUiVisibility, blackBackground = false, viewVisibility = 0, appBounds = Rect(0, 0 - 720, 1520), mScreenRect = Rect(0, 0 - 720, 1436), surface = io.flutter.embedding.android.FlutterSurfaceView{fe28ac0 V.E...... ........ 0,0-720,1436}
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught TypeError: window.getDeviceDetails is not a function
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught TypeError: window.getDeviceDetails is not a function", source: https://api.razorpay.com/v1/payments/pay_H9LxXZKsXjdZeJ/callback/8bd8be14f8e587c56f87852704eb97451bc0968c/rzp_test_eG4FSYzkpjfD5N?status=authorized&token_recurring_status=rejected&language_code=en (1)
E/libEGL (12716): call to OpenGL ES API with no current context (logged once per thread)
D/com.razorpay.checkout(12716): Response from lumberjack:
D/com.razorpay.checkout(12716): CheckoutActivity onDestroy called
W/System.err(12716): java.util.ConcurrentModificationException
W/System.err(12716): at java.util.ArrayList$Itr.next(ArrayList.java:860)
W/System.err(12716): at com.razorpay.SmsAgent.sendSmsPermissionCallBack(SmsAgent.java:110)
W/System.err(12716): at com.razorpay.SmsAgent.removeSMSBroadcastReceiver(SmsAgent.java:76)
W/System.err(12716): at com.razorpay.RzpAssist.paymentFlowEnd(RzpAssist.java:202)
W/System.err(12716): at com.razorpay.OtpElfCheckoutPresenterImpl.addOnFlowEnd(OtpElfCheckoutPresenterImpl.java:130)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl.cleanUpOnDestroy(CheckoutPresenterImpl.java:664)
W/System.err(12716): at com.razorpay.BaseCheckoutActivity.onDestroy(BaseCheckoutActivity.java:175)
W/System.err(12716): at android.app.Activity.performDestroy(Activity.java:7375)
W/System.err(12716): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1255)
W/System.err(12716): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4520)
W/System.err(12716): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4551)
W/System.err(12716): at android.app.ActivityThread.-wrap5(Unknown Source:0)
W/System.err(12716): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1743)
W/System.err(12716): at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err(12716): at android.os.Looper.loop(Looper.java:192)
W/System.err(12716): at android.app.ActivityThread.main(ActivityThread.java:6754)
W/System.err(12716): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(12716): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
W/System.err(12716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
W/System.err(12716): java.util.ConcurrentModificationException
W/System.err(12716): at java.util.ArrayList$Itr.next(ArrayList.java:860)
W/System.err(12716): at com.razorpay.SmsAgent.sendSmsPermissionCallBack(SmsAgent.java:110)
W/System.err(12716): at com.razorpay.SmsAgent.removeSMSBroadcastReceiver(SmsAgent.java:76)
W/System.err(12716): at com.razorpay.RzpAssist.paymentFlowEnd(RzpAssist.java:202)
W/System.err(12716): at com.razorpay.OtpElfCheckoutPresenterImpl.addOnFlowEnd(OtpElfCheckoutPresenterImpl.java:130)
W/System.err(12716): at com.razorpay.CheckoutPresenterImpl.cleanUpOnDestroy(CheckoutPresenterImpl.java:664)
W/System.err(12716): at com.razorpay.BaseCheckoutActivity.onDestroy(BaseCheckoutActivity.java:175)
W/System.err(12716): at android.app.Activity.performDestroy(Activity.java:7375)
W/System.err(12716): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1255)
W/System.err(12716): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4520)
W/System.err(12716): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4551)
W/System.err(12716): at android.app.ActivityThread.-wrap5(Unknown Source:0)
W/System.err(12716): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1743)
W/System.err(12716): at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err(12716): at android.os.Looper.loop(Looper.java:192)
W/System.err(12716): at android.app.ActivityThread.main(ActivityThread.java:6754)
W/System.err(12716): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(12716): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
W/System.err(12716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
I/TouchMotionHandler(12716): handler onDetached
E/com.razorpay.checkout(12716): Webview JS Error: Uncaught ReferenceError: otpPermissionCallback is not defined
I/chromium(12716): [INFO:CONSOLE(1)] "Uncaught ReferenceError: otpPermissionCallback is not defined", source: https://api.razorpay.com/v1/payments/pay_H9LxXZKsXjdZeJ/callback/8bd8be14f8e587c56f87852704eb97451bc0968c/rzp_test_eG4FSYzkpjfD5N?status=authorized&token_recurring_status=rejected&language_code=en (1)
E/ActivityThread(12716): Activity com.razorpay.CheckoutActivity has leaked IntentReceiver com.razorpay.CheckoutPresenterImpl$1@285ddc6 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread(12716): android.app.IntentReceiverLeaked: Activity com.razorpay.CheckoutActivity has leaked IntentReceiver com.razorpay.CheckoutPresenterImpl$1@285ddc6 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread(12716): at android.app.LoadedApk$ReceiverDispatcher.
@the-kool-sk I got this similar error in Android (JAVA). The actual problem was, I was using Razorpay Checkout in a fragment which is not allowed. The Checkout & PaymentListener should be implemented in an Activity and not in a Fragment, this solved my problem. I guess when you further pass the data from the Activity to Fragment, this error is generated.
EDIT: I don't know if this helps/works for you or not, but just thought to let you know (if it helps). GoodLuck!
Hi, I am coding in Java and facing the same issue. Could you share your modified code? Like how should I pass the data in the activity? I have implemented PaymentResultListener in Activity already.
@disha-ramchandani Were you able to solve the error?
Please update to v1.2.6, we have fixed error in this release
@disha-ramchandani Sorry for the delayed reply. But as I said, you need to create separate Activity for using the Checkout API. You can implement the PaymentListener on the Activity and have a callback from the Checkout. Then you can pass the data to other Activities or Fragments through SharedPreference or maybe use Parcelable if you don't want your data to persist.
You can check the following code for reference: https://github.com/adityaasthana1/Food_Owl/blob/master/app/src/main/java/com/macht/foodowl/PaymentActivity.java
@disha-ramchandani Sorry for the delayed reply. But as I said, you need to create separate Activity for using the Checkout API. You can implement the PaymentListener on the Activity and have a callback from the Checkout. Then you can pass the data to other Activities or Fragments through SharedPreference or maybe use Parcelable if you don't want your data to persist.
You can check the following code for reference: https://github.com/adityaasthana1/Food_Owl/blob/master/app/src/main/java/com/macht/foodowl/PaymentActivity.java
Thank you so much for helping me out. I will check it out.
Please update to v1.2.6, we have fixed error in this release
Thank you!
E/ActivityThread: Activity com.razorpay.CheckoutActivity has leaked IntentReceiver com.razorpay.CheckoutPresenterImpl$1@f918007 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.razorpay.CheckoutActivity has leaked IntentReceiver com.razorpay.CheckoutPresenterImpl$1@f918007 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.
dependancy implementation 'com.razorpay:checkout:1.6.6'
I am getting this issue in payment activity. also using PaymentResultWithDataListener for getting response on success and failure.
Is there any solution?
@adityaasthana1 Actually I am staring the checkout process in flutter view. So I am not sure whether sdk uses activity or fragment internally for checkout. I cannot specify to start the process in activity... thanks for support though.
you just have to pass PaymentSuccessResponse response as an argument to event listners and it will work fine
It is good to check
@Override
public void onPaymentError(int i, String s) {
Log.e(TAG,"onPaymentError:"+s);
}
Because I got the same error posted here after this method gets called, and addressing that issue in onPaymentError can solve the issue, in my case the api key set with:
checkout.setKeyID("");
was wrong and it gave off the error :
{"code":"BAD_REQUEST_ERROR","description":"The api key provided is invalid","source":"NA","step":"NA","reason":"NA","metadata":{}}
After I gave the correct api key, i was able to see razorpay page.
Dont miss seeing onPaymentError before checking this error, because the long error can easily hide the small error message.
Description
I am implementing Razorpay in Flutter. I have done everything perfectly by following code:
But I am getting the following error when I open the Razorpay dialog for the first time. And it's not open the dialog a second time When I tap the button again.
Flutter Version :
AndroidStudio: 4.1.2