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:
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.
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.
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.
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.
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:
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.
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.
You receive the transaction status on the Callback URL. Please refer to the sample response here.
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.
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.
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)
You can view the staging transaction details in “Test Data” mode on your dashboard.
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.