The paytm android sdk is returning Invalid checksum.
I'm generating checksum using the following code in nodejs
var paytmParams = {};
paytmParams["MID"] = "<TEST MERCHANT ID>";
paytmParams["ORDERID"] = `${newTransaction.id}`;
const checksum = await PaytmCS.generateSignature(
paytmParams,
"<TEST MERCHANT KEY>"
);
Then I'm passing this to the frontend i.e android where I start the paytm sdk with the following configuration. Please note that this is staging environment. Yes the bug is is in staging for now!
val hashMap = HashMap<String, String>()
datamodel.data.paymentGatewayConfig.apply {
hashMap["MID"] = "<TEST MERCHANT ID>"
hashMap["ORDER_ID"] = this.ORDER_ID!! //unique order id generated everytime on backend
hashMap["CUST_ID"] = this.CUST_ID!! //unique customer id from backend
hashMap["MOBILE_NO"] = this.MOBILE_NO!!
hashMap["EMAIL"] = this.EMAIL!!
hashMap["CHANNEL_ID"] = "WAP"
hashMap["TXN_AMOUNT"] = "500.00"
hashMap["WEBSITE"] = "WEBSTAGING"
hashMap["INDUSTRY_TYPE_ID"] = "Retail"
hashMap["CALLBACK_URL"] = "https://securegw-stage.paytm.in/theia/paytmCallback"
hashMap["CHECKSUMHASH"] = this.CHECKSUMHASH!! //checksum generated on backend see above code snippet
}
I've already seen other stackoverflow answers to this. Also the github issue on paytm sdk repo about this. But nothing has worked for me yet.
Please if someone has faced this issue before or even luckily got away with it hen share your code or tell me what am I doing wrong??? I've been banging my head on this for past 2 days.
which android sdk are using for the integration? Request you to please use the latest All-in-one android sdk available on the developer documentation of paytm.
implementation 'com.paytm.appinvokesdk:appinvokesdk:1.5.3'
For checksum generation logic, please go through the documentation given on developer and use the same utility provided there. Refer to the "Checksum logic" link on home page of paytm developer docs.