react-native-razorpay: [TypeError: Cannot read property 'open' of null] while RazorPay Payment Gateway Integration latest version

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}); }); }} > <Text style={styles.payBtnText} >Proceed To Pay</Text> </TouchableOpacity>

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

@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?