This document explains how you can integrate EMI payment source in the custom checkout solution to collect the total amount payable from your customer in easy installments. Users can select an EMI option offered by different banks partnered with Paytm as their payment source to complete the payment. This page describes the integration required for Standard EMI offering. In case you plan to offer EMI subvention to your customers, please refer to the Integration document for the same here.
This section explains the integration steps to process payment through EMI using Credit/Debit Card with the user's paytm account. Make sure you have followed the Pre-requisites and Integration Steps mentioned on the Paytm Custom checkout page.
- Your backend server calls the Fetch Payment Options API using the transaction token received in the response of Initiate transaction API request. As part of the API response, you receive banks providing EMIs for your MID.
Note: In case you have already called this API as part of any other payment mode, then refer to the response from the same.
- User selects a bank from the list providing EMI options, say “HDFC Credit card”, You call the Fetch EMI Detail API with the ChannelCode of the bank to get the EMI plans offered by the bank.
- Paytm returns all the EMI plans details such as tenure, interest rates, min and max amount for the requested channel configured for given MID. The response includes the plan Id of each EMI plan offered by the bank. You display the plans received to the user.
- User selects an EMI plan and you call the Process Transaction API after the user clicks on the Pay button.
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.
- 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="EMI" /> <input type="text" name="cardInfo" value="|4375515173401577|942|022022" /> <input type="text" name="AUTH_MODE" value="otp" /> <input type="text" name="planId" value="ICICI|3" /> <input type="submit" /> </form>
- 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.
- 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.
For any issues with the integration, refer to Get in touch.