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.
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.
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"}
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.
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
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
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
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.