question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native App crashing on RazorpayCheckout.open

See original GitHub issue

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest React Native Razorpay plugin release to make sure your issue has not already been fixed.

Razorpay Package Version :

Open Package.json. > ^2.1.35.

Xcode Version (iOS) :

Open Xcode > Go to About Xcode > We are testing only for Android now.

Java and Gradle Version (android) :

Java(1.8.0_171) and Gradle(3.6.1).

What you did:

I am passing the following data to the Razorpay checkout option:- const options = { currency: ‘INR’, key: ‘rzp_test_5OHWyAujiA2dMr’, amount: ‘5000’, name: ‘Test’, order_id: ‘order_F7Fsx1D3swiUbR’, }; RazorpayCheckout.open(options) .then(() => { // success case; }) .catch(() => { // failure case; });

What happened:

.952 14387 14387 E com.razorpay.checkout: Error reading options! 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: org.json.JSONException: No value for send_sms_hash 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at org.json.JSONObject.get(JSONObject.java:392) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at org.json.JSONObject.getBoolean(JSONObject.java:413) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.c__C_.G__G_(:36) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_.getOptionsForHandleMessage(:771) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_.G__G_(:61798) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_$11.run(:727) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at android.app.Activity.runOnUiThread(Activity.java:6282) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_.onLoad(:720) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.E$j$.a$P$(:65028) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_.a_$P$(:1199) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_.Q_$2$(:49) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.razorpay.O_$B_$10.run(:1185) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at android.os.Handler.handleCallback(Handler.java:873) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at android.os.Handler.dispatchMessage(Handler.java:99) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at android.os.Looper.loop(Looper.java:193) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at android.app.ActivityThread.main(ActivityThread.java:6669) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at java.lang.reflect.Method.invoke(Native Method) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 07-14 19:22:07.952 14387 14387 E com.razorpay.checkout: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 07-14 19:22:07.953 14387 14387 W System.err: org.json.JSONException: No value for send_sms_hash 07-14 19:22:07.953 14387 14387 W System.err: at org.json.JSONObject.get(JSONObject.java:392) 07-14 19:22:07.953 14387 14387 W System.err: at org.json.JSONObject.getBoolean(JSONObject.java:413) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.c__C_.G__G_(:36) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_.getOptionsForHandleMessage(:771) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_.G__G_(:61798) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_$11.run(:727) 07-14 19:22:07.953 14387 14387 W System.err: at android.app.Activity.runOnUiThread(Activity.java:6282) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_.onLoad(:720) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.E$j$.a$P$(:65028) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_.a_$P$(:1199) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_.Q_$2$(:49) 07-14 19:22:07.953 14387 14387 W System.err: at com.razorpay.O_$B_$10.run(:1185) 07-14 19:22:07.953 14387 14387 W System.err: at android.os.Handler.handleCallback(Handler.java:873) 07-14 19:22:07.953 14387 14387 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99) 07-14 19:22:07.953 14387 14387 W System.err: at android.os.Looper.loop(Looper.java:193) 07-14 19:22:07.953 14387 14387 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6669) 07-14 19:22:07.953 14387 14387 W System.err: at java.lang.reflect.Method.invoke(Native Method) 07-14 19:22:07.953 14387 14387 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 07-14 19:22:07.953 14387 14387 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 07-14 19:22:07

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

1.I pass the payment object to Razorpay Checkout, which leads to crashing of my app.

Suggested solution:

Code example, screenshot, or link to a repository:

Please provide a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

const options = { currency: ‘INR’, key: ‘rzp_test_5OHWyAujiA2dMr’, amount: ‘5000’, name: ‘Test’, order_id: ‘order_F7Fsx1D3swiUbR’, }; RazorpayCheckout.open(options) .then(() => { // success case; }) .catch(() => { // failure case; });

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:44 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
HrushikeshAgrawalcommented, Jul 19, 2020

A downgrade to react-native-razorpay@2.1.33 helped me solve the issue. Can confirm that the problem exists in com.razorpay:checkout:1.5.18 updated from 1.5.12 about 10 days ago. Would suggest everyone to uninstall latest version (npm uninstall react-native-razorpay) and install 2.1.33 (npm i react-native-razorpay@2.1.33) until the fix is offical.

4reactions
gauthampaitcommented, Jan 8, 2021

Fixed it.

Buggy Payload : theme: { color: 'rgb(97,178,68)' }

Proper Payload : theme: { color: '#61b244' }

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native release apk crashes on RazorpayCheckout.open ...
My conclusion : when apk goes to the RazorpayCheckout.open function call app crashes. I dont know how to debug that and hit a...
Read more >
App Center Crashes for React Native - Microsoft Learn
Open the project's ios/YourAppName/AppDelegate.m file and verify that you have [AppCenterReactNativeCrashes register]; instead of [ ...
Read more >
[Solved]-Apk crashes after adding realm to react native-React ...
Coding example for the question Apk crashes after adding realm to react native-React Native.
Read more >
ReactNative App Crashes when Deployed to TestFlight
When I download the app from TestFlight on the same device, the app crashes immediately upon opening the app. The app is built...
Read more >
react-native-razorpay/CHANGELOG.md - UNPKG
13, - React native app is crashing after confirming payment with razorpay test key? ... 162, - Unable to open RazorpayCheckout when called...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found