đ¨âđģGetting Started with WebUPI
WebUPI is a proposed browser API that allows web applications to request payment via UPI (Unified Payments Interface). It provides a standardized way for web applications to interact with a user's UPI app on their device.
Using WebUPI
To start using WebUPI, you first need to make sure that the user's browser supports it. Here's how you can check:
Once you've confirmed that the user's browser supports WebUPI, you can start using its APIs.
Enabling WebUPI
Before you can use WebUPI, you need to enable it by calling the webUPI.enable()
function:
This will prompt the user to give permission for the web application to use the UPI capabilities of their device. If the user denies permission or cancels, an error will be thrown.
Making a Payment
To make a payment, you need to call the webUPI.sendPayment()
function with a UPI URI:
This will prompt the user's UPI app to make a payment. If the payment fails, an error will be thrown.
Making a Payment Request
To make a payment request, you need to call the webUPI.requestPayment()
function with a UPI URI:
This will prompt the user's UPI app to accept a payment request. If the payment request fails, an error will be thrown.
Remember to handle errors gracefully to provide a good user experience. For more information on error handling, see the Error Handling section.
Last updated