Error Handling in WebUPI
Handling Errors with webUPI.enable()
webUPI.enable()
try {
await webUPI.enable();
} catch (error) {
// User denied permission or cancelled
console.log(error);
}Handling Errors with webUPI.sendPayment()
webUPI.sendPayment()
try {
const upiURI = "upi://pay?pa=example@upi&pn=Example&mc=0000&tid=000000000000&tr=TestTransaction&tn=TestTransaction&am=10.01&cu=INR&url=http://example.com";
await webUPI.sendPayment(upiURI);
} catch (error) {
// Payment failed
console.log(error);
}
Error Messages
Last updated