search

Credit/Debit cards integration

This document explains the integration steps required for payment collection using Credit/Debit cards in the custom checkout solution. You can also fetch the large database of around 200 million cards saved with Paytm users accounts and present them on your payment page. This allows the users to make quick and easy payments using their saved cards without the need of entering the complete card details.

Demo

 

Integration Steps

This section explains the integration steps to process payment through a new Debit/Credit Card or saved cards with the user's paytm account. Make sure you have followed the Pre-requisites and Integration Steps mentioned on the Paytm Custom checkout page.

Steps - Paytm user saved cards

In case you want to show Paytm user’s saved cards on your checkout page, please follow the steps mentioned below.

 

  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. Your backend server calls the Fetch Payment Options API using the transaction token received in the response of Initiate transaction API request.
  4. You receive the Paytm user’s saved credit and debit cards In the response of Fetch Payment Options API. In the response you also receive the card type, issuing bank and current success rate on that card.

    Note:
    a. For maestro cards, CVV and expiry date are not required for any transaction.
    b. You can consume the success rate of the card and intimate a user so they could choose any other payment method.

  5. User selects the saved card of its Paytm account, enters the required details like CVV and clicks on the Pay button, at which point you call the Process Transaction API.

    Note: You can hit the Process transaction API either through Form post or JSON based. Using JSON based integration, you can also collect OTP for 2FA on your page for major banks.

  1. You hit the Process Transaction API as an HTML form post through the client. Paytm processes the transaction and redirects the user to the bank page to complete the payment by entering the OTP. 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="CREDIT_CARD" />
        <input type="text" name="cardInfo" value="1159332987||111|" />
        <input type="text" name="AUTH_MODE" value="otp" />
        <input type="submit" />
    </form>

     

  2. After the user completes the transaction on the bank page, Bank redirects the user back to Paytm which in turn redirects the user back on your payment confirmation page.
  3. You receive the transaction status on the Callback URL. Please refer to the sample response here.
  4. 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.
  5. Validate the transaction response via server-side request using theTransaction 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.
  6. After the transaction status verification, you show final payment status to the user.

Steps - New Credit/Debit card

In case you want to integrate payment with new Credit/Debit cards on your checkout page, please follow the steps mentioned below.
 

  1. User selects the Credit/Debit card option on your checkout page and starts entering the card details. As soon as the first 6 digits are entered, you call the Fetch Bin Detail API to get the BIN details of the card.
  2. Paytm validates the card and returns the BIN details like the card type (VISA, Master, AMEX etc.) and issuing bank, current success rate of bin.

    Note:
    a. For maestro cards, CVV and expiry date are not required for any transaction.
    b. You can consume the success rate of the card and intimate a user so they could choose any other payment method.

  3. User clicks Pay to proceed for checkout and you call the Process Transaction API.

    You can hit the Process transaction API either through Form post or JSON based. Using JSON based integration, you can also collect OTP for 2FA on your page for major banks.

  1. You hit the Process Transaction API as an HTML form post through the client. Paytm processes the transaction and redirects the user to the bank page to complete the payment by entering the OTP. 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="DEBIT_CARD" />
        <input type="text" name="cardInfo" value="|5129670406454327|983|122025" />
        <input type="text" name="AUTH_MODE" value="otp" />
        <input type="submit" />
    </form>

     

  2. After the user completes the transaction on the bank page, Bank redirects the user back to Paytm which in turn redirects the user back on your payment confirmation page.
  3. You receive the transaction status on the Callback URL. Please refer to the sample response here.
  4. 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.
  5. 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.
  6. 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.