API ReferenceIntegrationsKnowledge Base

Custom Web Integration - Validate VPA

If the selected payment method is upi, the user has to enter the vpa in the Checkout form. You can check if the entered vpa is valid or not as follows:

Copyvar razorpay = new Razorpay({ key: 'rzp_test_lWHwMnGuDgD13V', }); razorpay.verifyVpa(vpa) .then(() => { // VPA is valid, ask the user to click Pay }) .catch(() => { // VPA is invalid, show an error to the user });
×