search

UPI Integration

This document explains how you can integrate the UPI payment source in your custom checkout solution to instantly collect the total amount payable from your customer with a single identifier i.e. UPI ID or VPA. Users can conveniently use their VPA to make a secure and immediate payment without entering any bank or card details and with no use of multiple apps (merchant, SMS, UPI app) for payments.

Paytm offers two UPI flow to collect payment on your checkout page:

  • UPI Intent
  • UPI Collect

Note: If a user wants to make a payment using the UPI payment source, it is mandatory to have the UPI apps installed on their mobile device.

UPI Intent

The UPI Intent flow to collect payment works on the mobile browsers/applications with the use of UPI supported apps installed on a user’s mobile device that makes the payment process for them a lot smoother. Its Improved and seamless payment process results in an optimal user experience for your customers by avoiding the switching between multiple apps (merchant, SMS, UPI app) for payments.
 

To see the complete integration flow for UPI Intent, click here.

UPI Collect

The UPI Collect flow is a UPI payment process which allows you to take payments by prompting the user to enter just the Virtual Payment Address (VPA) on the checkout page of your website/app. User is notified through SMS and is prompted to make the payment on the relevant bank App. The detailed integration steps for UPI Collect are explained below.

Demo

Integration Steps

This section explains the integration steps to process payment through UPI Collect flow. Make sure you have followed the Pre-requisites and Integration Steps mentioned on the Paytm Custom checkout page.
 

  1. User selects the BHIM UPI as the payment source on your checkout page and enters the VPA through which it intends to make the payment.
  2. You call the Validate VPA API to validate the VPA.
  3. User clicks on the Pay button and you call the Process Transaction API, where you pass the paymode as UPI in the request to select the UPI Collect flow.

    Note: You can hit the Process transaction API either through Form post or JSON based.

     

  1. You hit Process Transaction API as an HTML form post through the client. Paytm processes the transaction and in response, a polling screen is shown to the user with a session expiry timer and a message that the UPI collect request has been sent to the user on the registered VPA. The user also receives a push notification on the UPI app and/or SMS on their mobile number registered with UPI app, inferring that a UPI Collect request has been sent to them. Please find the sample request/response for Process Transaction API below:
    <form method="post" type="redirect" action="https://securegw-stage.paytm.in/theia/api/v1/processTransaction?mid=INTEGR7769XXXXXX9383&orderId=ORDERID_98765">
        <input type="text" name="mid" /> value="INTEGR7769XXXXXX9383" 
        <input type="text" name="orderId" /> value="ORDERID_98765" 
        <input type="text" name="txnToken" /> value="f0bed899539742309eebd8XXXX7edcf61588842333227"
        <input type="text" name="paymentMode" /> value="UPI" 
        <input type="text" name="payerAccount" /> value="7777777777@paytm"
        <input type="submit">
    </form>

     

  2. User accepts the collect request either through the push notification sent over the UPI app or the SMS and completes the payment on the PSP App.
  3. On successful payment, the user gets the payment confirmation on their UPI app. User goes back to the polling screen and after successful payment, the polling screen is redirected to the callback url.
  4. You receive the transaction status on the Callback URL. Please refer to the sample response here.
  5. Prior to verifying the payment, you must validate the checksumhash received in response to the Process Transaction API. To verify it, use the Paytm library with all the parameters in key-value pairs on the merchant server.
  6. Validate the transaction response via server-side request using the Transaction Status API. You must verify the Order ID and amount with your DB entries and consider the status as the final status of the transaction in all cases.
  7. After the transaction status verification, you show final payment status to the user.

Post integration steps

Post completion of integration in your staging environment, it is mandatory to test the Paytm payment sources integration on your website/app before moving into the live environment with production account details (received from Paytm team)

  1. You can view the staging transaction details in “Test Data” mode on your dashboard.
  2. You must ensure to re-verify the transaction response with Transaction Status API via server to server call for payment flow and not as a one-time activity.

Post successful testing in your staging environment, move your code to the live environment with production account details. These credentials will be available after you activate your business account with Paytm on the Merchant Dashboard.
 

Paytm recommends you to read about Managing Refunds and late payment notifications for a better understanding of the integration.
 

For any issues with the integration, refer to Get in touch.