Paytm

Paytm (India) payment gateway, cards, UPI, net banking and the Paytm wallet on Paytm's hosted page; INR only.

What you need

Paytm Dashboard → API Keys page (dashboard.paytmpayments.com/next/apikeys):

  • merchant_id: Merchant ID (MID)
  • merchant_key: Merchant Key (16 characters; every checksum is made with it)

In your panel choose Settings → Payments → Add method → Paytm and enter both.

Test (staging): the staging MID and key are on that API Keys page as soon as the account exists; the production MID arrives once the account is activated. Enter the staging pair and tick sandbox (test) mode; the panel then talks to securestage.paytmpayments.com and sends websiteName = WEBSTAGING. Going live, enter the production pair and untick the box; the panel talks to secure.paytmpayments.com and sends websiteName = DEFAULT.

The callback URL is attached to every payment as callbackUrl; nothing has to be configured in the Paytm dashboard. Its shape:

https://<your-panel-domain>/payments/paytm/callback

Optionally put the same URL into the Payment Status webhook setting in the Paytm dashboard. Paytm then also reports the result server-to-server, independently of the customer's browser (the balance is credited even if they close the tab). Both notifications have the same format and go through the same verification; the balance is never credited twice. Paytm accepts only port 443 for webhooks.

Flow

  1. The customer enters an amount and picks Paytm. No phone number is asked for.
  2. The panel sends Paytm a signed Initiate Transaction request (orderId = our payment reference, amount in INR) and receives a txnToken.
  3. The customer's browser form-POSTs mid, orderId and txnToken to Paytm's Show Payment Page; card, UPI, net banking and wallet are chosen there, card data never touches your server.
  4. When the payment finishes, Paytm sends the customer's browser back to your callback URL with the result fields (ORDERID, TXNID, STATUS, TXNAMOUNT, …) and a CHECKSUMHASH made with the merchant key.
  5. The panel verifies the checksum first, then asks Paytm's Transaction Status API about the order with its own signature. If Paytm says TXN_SUCCESS and the orderId is our payment, the balance is credited and the customer lands on "Add funds" with a success banner.
  6. On TXN_FAILURE the payment is recorded as failed with Paytm's message in its memo. On PENDING the payment stays pending (the bank has not confirmed yet); Paytm reports the outcome later by webhook, or you complete it from Admin → Payments.

A return whose checksum does not verify, or that belongs to another MID, is ignored. A second success notification for the same payment (browser + webhook) never credits twice.

Statuses

Paytm Panel
TXN_SUCCESS completed, balance credited
TXN_FAILURE failed (Paytm's message in the memo)
PENDING pending
NO_RECORD_FOUND the return is ignored

If the Transaction Status call does not answer, a TXN_SUCCESS claim is downgraded to pending; balance is credited only on Paytm's signed answer.

Currencies

Paytm processes INR only. The method's currency must be INR; a payment cannot be started in any other currency.

Common problems

  • "Checksum provided is invalid" (2005): the merchant key is wrong, or staging and production credentials are mixed. Pair the staging MID with the staging key and the production MID with the production key.
  • "Mid in the query param doesn't match" (2013): the MID was pasted with a space or a missing character.
  • Payment succeeded but no balance: look at the payment's memo under Admin → Payments. If the status call failed (wrong key, sandbox/live mixed up) the payment is pending and the reason is there.
  • Real cards do not work on staging: use Paytm's test instruments, any Visa/Mastercard number, any future expiry, CVV 123, OTP 489871; for the wallet 7777777777 / Paytm12345.
  • Callback unreachable: Paytm accepts only HTTPS on port 443; while your domain is not yet pointed at us, a payment cannot complete. Finish the DNS change first.