search

Paytm wallet and postpaid integration

This document explains how you can integrate the paytm wallet and paytm postpaid in the custom checkout solution to collect payment from your customer. Users can select these sources for payment subject to their balance availability.

Demo

Integration Steps

 

The Paytm user has the flexibility of making payments via different sources like wallet and postpaid. This section explains the integration steps to process payment through these payment sources. Make sure you have followed the Pre-requisites and Integration Steps mentioned on the Paytm Custom checkout page.
 



 

  1. User selects the Paytm option for payment on your checkout page and enters its registered mobile number, then you call the Send OTP API to verify their account. Paytm triggers the OTP to the mobile number passed in the request.
  2. To validate the OTP entered by a user, you call the Validate OTP API.
  3. You may hit the Fetch balance Info API in order to fetch the balance of Wallet, postpaid.
  4. After the user selects a payment source, say Paytm wallet and clicks Pay to proceed for checkout, you call the Process Transaction API to process the transaction.

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

  1. You hit the Process Transaction API as an HTML form post through the client. The sample request/response for the different paytm payment sources are explained below:
    1. Wallet - User selects the wallet and in case of sufficient balance, payment is completed immediately. Please refer to the sample request/response 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="BALANCE" />
          <input type="text" name="AUTH_MODE" value="otp" />
          <input type="submit" />
      </form>

       
    2. Postpaid- User selects the postpaid and in case of sufficient limit, payment is completed immediately. Please refer to the sample request/response 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="PAYTM_DIGITAL_CREDIT" />
         <input type="text" name="AUTH_MODE" value="3D" />
          <input type="submit" />
      </form>

       

  2. You receive the transaction status on the Callback URL. Please refer to the sample response here.
  3. 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.
  4. 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.
  5. 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.