razorpay / react-native-razorpay

React Native wrapper for Razorpay's mobile SDKs
https://www.npmjs.com/package/react-native-razorpay
MIT License
124 stars 107 forks source link

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

Closed gausu60 closed 9 months ago

gausu60 commented 10 months ago

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: 'gausu@gmail.com', 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 commented 10 months ago

@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 commented 10 months ago

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

vivekshindhe commented 9 months ago

@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 commented 9 months ago

i am using expo but still error

vivekshindhe commented 9 months ago

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

gausu60 commented 9 months ago

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

pranav750 commented 9 months ago

Any update here? Kinda stuck on the same issue.

vivekshindhe commented 9 months ago

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 commented 9 months ago

i have already used on development mode so still error occurred

vivekshindhe commented 9 months ago

@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 commented 9 months ago

not working still same error

vivekshindhe commented 9 months ago

@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 commented 9 months ago

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

vivekshindhe commented 9 months ago

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

gausu60 commented 9 months ago

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

Udai637643 commented 6 months ago

is the issue resolved now or not