3

We are forming android hybrid app via Phonegap. Using the PayTm web integration kit.

Checksum is generated properly. But when the form is submitted for the payment **Invalid Checksum ** issue is returned.

Sachin
  • 111
  • 2
  • 14

5 Answers5

1

https://developer.paytm.com/docs/api/initiate-transaction-api/?ref=payments

NOTE: Create the signature using the body parameter of the request in the same sequence as you pass in the request.

example:

body = {"mid":"MID HERE","websiteName":"WEBSTAGING","orderId":"ORDERIDHERE","txnAmount":{"value":"10.00","currency":"INR"},"userInfo":{"custId":"CUSTOMERID_HERE"},"callbackUrl":"https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=ORDERID", "requestType":"Payment"}

Create json

json_body = body.to_json

#RUBY ON RAILS https://github.com/paytm/Paytm_Ruby_Checksum

generated_signature = PaytmChecksum.new.generateSignature(json_body, MERCHANT_KEY_HERE)

curl -X POST 'https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=MID HERE&orderId=ORDERID_HERE' \
--header 'Content-Type: application/json' \
--data '{"body":{"requestType":"Payment","mid":MID_HERE,"websiteName":"WEBSTAGING","orderId":ORDER_ID_HERE,"txnAmount":{"value":"10.00","currency":"INR"},"userInfo":{"custId":CUSTOMER_ID},"callbackUrl":"https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=ORDER_ID_HERE"},"head":{"signature": generated_signature}}'

As you noted that I pass the body parameter in the same sequence that I used while creating signature(checksum) as in the request body parament.

Vijay Chouhan
  • 4,613
  • 5
  • 29
  • 35
0

i have faced the same issue for more than 2 days. i integrated PAYTM on ionic 4. my mistake was, my "TXN_AMOUNT" is in whole amount. "TXN_AMOUNT" should be in decimal number. e.g 199.33, 152.56.

On the other hand "READ THE PAYTM INTEGRATION GUIDE" carefully. it's actually quite good. https://developer.paytm.com/docs

Sushil
  • 2,324
  • 1
  • 27
  • 26
  • Decimal number should be send in decimal format or string format ? I am facing same issue of invalid checksum and unable to find a solution. On the documentation of Paytm they have sent the TXN_AMOUNT in string. – Salil Luley Sep 21 '19 at 18:11
0

First try to run with postman You will get postman collection from paytm just you need to paste key mid there You will get the response

And please check The parameter body should be same while creating check sum Space is not allowed in request body even in json request

0

one of the reason I got this error was the incorrect URL, I was using the right MID and KEY but yet I was getting checksum invalid error.

Later I found my URL was of UAT environment

Abdeali Chandanwala
  • 8,449
  • 6
  • 31
  • 45
-1

Kindly pass the same parameters value in the request which is used while generating the checksum. Also refer the paytm checksum docs available on paytm developer portal.