This page 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 without using 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 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 collect 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.
You hit the Process Transaction API as an HTML form post through the client and then Paytm processes the transaction. 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 refer to the Process Transaction API sample request/response 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 the “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.