Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayTm : Invalid Checksum RespCode : 330

Tags:

checksum

paytm

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.

like image 520
Sachin Avatar asked May 18 '26 06:05

Sachin


1 Answers

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.

like image 74
Vijay Chouhan Avatar answered May 20 '26 16:05

Vijay Chouhan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!