react-native-razorpay: React native app is crashing after confirming payment with razorpay test key?
I am trying to implement UPI payment in my react native app but my app is crashing on successful payment even though I am getting a successful payment alert. I am using the customui SDK for implementing Razorpay payments. I am not getting any kind of exception or error, the app is just shutting down. I am using react native version 0.61.5 Any help would be appreciated. Thank you.
Checkout code
var options = {
currency: 'INR',
key_id: 'test_key',
amount: this.props.total,
vpa:this.state.upi,
contact: 'XXXXXXXXXX',
email: 'XXXXXXXXX',
method: 'upi'
}
Razorpay.open(options).then((data) => {
// handle success
alert(`Success: ${data.razorpay_payment_id}`);
console.log(`Success: ${data.razorpay_payment_id}`)
}).catch((error) => {
// handle failure
alert(`Error: ${error.code} | ${error.description}`);
console.log(`Error: ${error.code} | ${error.description}`)
});
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (6 by maintainers)
use this Doc
https://razorpay.com/docs/payment-gateway/react-native-integration/custom/