Every payment has a checkout page. On a computer the customer scans the QR code with any UPI app; on a phone they tap a UPI app button. The page checks the status by itself and moves on as soon as the payment succeeds, fails or expires. The customer is then sent to your return URL.