Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeError: Cannot read property 'open' of null] while RazorPay Payment Gateway Integration latest version #462

Closed
gausu60 opened this issue Dec 4, 2023 · 16 comments

Comments

@gausu60
Copy link

gausu60 commented Dec 4, 2023

error_rzrpay
can anyone help me ?
[TypeError: Cannot read property 'open' of null] this error occured when i click on pay btn
this is my code below :-
import RazorpayCheckout from "react-native-razorpay";
<TouchableOpacity
style={styles.paybtn}
onPress={() => {
var options = {
description: 'Online Furniture Sales',
image: 'https://i.imgur.com/3g7nmJC.jpg',
currency: 'INR',
key: 'error_rzrpay',
amount: '5000',
name: 'VIVDeal',
order_id: '',//Replace this with an order_id created using Orders API.
prefill: {
email: '[email protected]',
contact: '919165482569',
name: 'Gausuddeen Shaikh'
},
theme: {color: '#53a20e'}
}
RazorpayCheckout.open(options).then((data) => {
// handle success
alert(Success: ${data.razorpay_payment_id});
}).catch((error) => {
// handle failure
console.log('Error: ', error);
alert(Error: ${error.code} | ${error.description});
});
}}
>
Proceed To Pay

@vivekshindhe
Copy link
Contributor

@gausu60 The error means that the react-native-razorpay package is not installed or the code isn't able to find it. The object RazorpayCheckout is null. Can you check in node_modules if the package is installed, and if so, you can check the import statement for the RazorpayCheckout object is present?

@gausu60
Copy link
Author

gausu60 commented Dec 9, 2023

yes Already I have installed "react-native-razorpay": "^2.3.0", but still error occurred.

@vivekshindhe
Copy link
Contributor

@gausu60 Hey, are you using react-native-cli or expo? Unable to reproduce the issue. It would be very helpful if you can create a ticket at the Razorpay dashboard for a quick turnaround.

@gausu60
Copy link
Author

gausu60 commented Dec 11, 2023

i am using expo but still error

@vivekshindhe
Copy link
Contributor

@gausu60 how did you install the react-native-razorpay package? Also, did you prebuild the project after switching to development build?

@gausu60
Copy link
Author

gausu60 commented Dec 11, 2023

i refer official document of razorpay i have try all different version not happening

@pranav750
Copy link

Any update here? Kinda stuck on the same issue.

@vivekshindhe
Copy link
Contributor

Hey @pranav750 , the issue above was because the build wasn't switched to development. Can you please try with switching it to development build and running the app after prebuild?

@gausu60
Copy link
Author

gausu60 commented Dec 19, 2023

i have already used on development mode so still error occurred

@vivekshindhe
Copy link
Contributor

@gausu60 Just tried too. Here are the commands I followed.
npx expo prebuild
npx expo start -> expo go build
a -> running app on android
{you'll see error mentioned above}
s -> switch to development mode
a -> run app on android.

It loaded the checkout page. Could you please try these in order and see if it works?

@gausu60
Copy link
Author

gausu60 commented Dec 19, 2023

not working still same error

@vivekshindhe
Copy link
Contributor

@gausu60 Would request you to create a ticket from the Razorpay Dashboard. That way, our team would be able to get on a call with you to sort out the issue. You can reference this ticket when you create the ticket. Will keep this issue open.

@gausu60
Copy link
Author

gausu60 commented Dec 30, 2023

yes I have been ticket raised but not usefully for me . support team send documentation link only

@vivekshindhe
Copy link
Contributor

@gausu60 can you please share your MID or the ticket number? We'll get in touch with you over a call for resolution.

@gausu60
Copy link
Author

gausu60 commented Jan 2, 2024

{"code":"BAD_REQUEST_ERROR","description":"Invalid request payload","step":"NA","reason":"NA","source":"NA"} this error occurred now
please anyone give me solution

@Udai637643
Copy link

is the issue resolved now or not

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

No branches or pull requests

4 participants