Search code examples
paymentgoogle-paypayuupi

How to generate payu UPI intent loader


I am looking for a solution using PayU to collect payments via GPay intent flow on a mobile web page.

One of the solutions is to open a payu page via a form as displayed on their demo page here: https://www.payubiz.in/upi

However, their page after opening the form, automatically redirects to a url of the form: https://api.payu.in/public/#/77748b2d3e286bf7d82862ab0d0aca19/upi .

This redirection is unclear to me. How is this URL generated? Can I make an api call to PayU to simply generate this URL?

Thanks.


Solution

  • Looks like I found one solution.

    We need to invoke payu APIs for UPI payments with following parameters alongwith others:

    {
        bankcode: TEZ,
        pg: UPI,
        txn_s2s_flow: 4
    }
    

    This request returns a response where one of the fields is acsTemplate which is just an html form encoded in base64. We can open that form directly or extract the value of action attribute and open the payu payment page directly that way.