Show Payment Page

Overview of payment processing via transaction token

The payment process starts at the click of pay button on merchant order summary page. On this click, you need to:

  1. Create an order in your order system and then generate transaction token by Initiate Transaction API or Initiate Subscription API.

  2. Submit the request as HTML form POST. This will redirect the customer to Paytm's payment page.

  3. Customer fills payment details and completes the payment authentication. Once the payment is complete, response is posted as HTML form POST on your app/website's callback URL.

  4. Verify checksumhash received in response to ensure that it has not been tampered with.

Steps to Show Payment Page via Paytm Payment Gateway

Step 1 :

At the click of Payment button by customer on your website, create an order in your system and generate transaction token by Initiate Transaction API or Initiate Subscription API.


Step 2 :

Create the payload with parameters in key value pairs. Using the payload make an HTML form post and redirect customer to Paytm server.


Request Attributes

orderId This is unique reference ID for a transaction which is generated by merchant and sent in the request. Yes
txnToken Transaction Token received in Initiate Transaction API or Initiate Subscription API response. Yes
mid This is a unique merchant Id provided to merchant by Paytm at the time of merchant creation. Yes

HTML Form Post

      <title>Show Payment Page</title>
         <h1>Please do not refresh this page...</h1>
      <form method="post" action="" name="paytm">
         <table border="1">
               <input type="hidden" name="mid" value="YOUR_MID_HERE">
               <input type="hidden" name="orderId" value="YOUR_ORDERID_HERE">
               <input type="hidden" name="txnToken" value="YOUR_TXNTOKEN_HERE">
         <script type="text/javascript"> document.paytm.submit(); </script>

Step 3 :

Customer fills the payment details and is redirected to bank page for authorization. Once the transaction is authorized, Paytm receives the response from the bank and returns a status to your website via your callback URL. Response attributes description and sample HTML form post is provided below :

Response Attributes    



This is a unique identifier provided to every merchant by Paytm  



This is a unique Paytm transaction ID that is issued by Paytm for each transaction  



Unique reference ID for a transaction which is generated by merchant and sent in the request  



The transaction ID sent by the bank. In case of Paytm proprietary instruments too, there is unique reference number generated by Paytm's system. In case the transaction does not reach the bank, this will be NULL or empty string. Primary reason for this is user dropping out of the payment flow before the transaction reaches to bank to servers  



Amount paid by customer in INR  



Currency in which the transaction has taken place. Currently only "INR" is the supported currency of transaction  



This contains the transaction status and has only three values: TXN_SUCCESS, TXN_FAILURE and PENDING  



Codes refer to a particular reason of payment failure/success. List in this PDF  



Description message is linked with each respcode. List in this PDF  



Date and Time of transaction in the format "yyyy-MM-dd HH:mm:ss.S"Example: "2015-11- 02 11:40:46.0"  



Gateway used by Paytm to process the transactions. By paymodes, the details are provided below
Credit, debit cards UPI - Gateway used to process the transaction. For example, if HDFC gateway has been used to process SBI credit card transactions, the value will be HDFC
Net banking - Netbanking transactions are not routed via gateway. Hence issuing bank name is passed in this field
Paytm Wallet - The value will be 'WALLET'
Paytm Postpaid - The value will be 'PAYTMCC'



Name of issuing bank of the payment instrument used by customer. By paymodes, the details are provided below
Credit, debit cards, net banking - Name of the issuing bank. Example in case customer uses SBI's credit card, the value will be "SBI"
Paytm Wallet - Wallet
Note that in case of UPI - This parameter will be not be present in the response



The payment mode used by customer for transaction
Credit card – CC
Debit card - DC
Net banking - NB
Paytm wallet – PPI
Postpaid - PAYTMCC



Security parameter to avoid tampering. Verified using server side checksum utility provided by Paytm. Utilities to generate checksumhash is available here  
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Paytm Secure Online Payment Gateway</title>
		<table align='center'>
				<td><STRONG>Transaction is being processed,</STRONG></td>
				<td><font color='blue'>Please wait ...</font></td>
				<td>(Please do not press 'Refresh' or 'Back' button</td>
			<input type='hidden' name='CURRENCY' value='PAYMENT_CURRENCY'>
			<input type='hidden' name='GATEWAYNAME' value='GATEWAY_USED_BY_PAYTM'>
			<input type='hidden' name='RESPMSG' value='PAYTM_RESPONSE_MESSAGE_DESCRIPTION'>
			<input type='hidden' name='BANKNAME' value='BANK_NAME_OF_ISSUING_PAYMENT_MODE'>
			<input type='hidden' name='PAYMENTMODE' value='PAYMENT_MODE_USED_BY_CUSTOMER'>
			<input type='hidden' name='MID' value='YOUR_MID_HERE'>
			<input type='hidden' name='RESPCODE' value='PAYTM_RESPONSE_CODE'>
			<input type='hidden' name='TXNID' value='PAYTM_TRANSACTION_ID'>
			<input type='hidden' name='TXNAMOUNT' value='ORDER_TRANSACTION_AMOUNT'>
			<input type='hidden' name='ORDERID' value='YOUR_ORDER_ID'>
			<input type='hidden' name='STATUS' value='PAYTM_TRANSACTION_STATUS'>
			<input type='hidden' name='BANKTXNID' value='BANK_TRANSACTION_ID'>
			<input type='hidden' name='TXNDATE' value='TRANSACTION_DATE_TIME'>
			<input type='hidden' name='CHECKSUMHASH' value='PAYTM_GENERATED_CHECKSUM_VALUE'>
	<script type="text/javascript">  document.forms[0].submit();</script>    

Step 4 :

Checksumhash received in response of transaction needs to be verified on merchant server using Paytm library with all the parameters in key value pairs. Code snippets and Github links for the checksum utility are provided here.