Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

453
Views
Getting this error while validating checksum for paytm payment gateway integration. After clicking successful, not getting back to homepage

Imported checksum file from github link provided on their website

ERROR SHOWN

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined at new NodeError (node:internal/errors:372:5) at Decipheriv.update (node:internal/crypto/cipher:176:11) at Function.decrypt (D:\MERN-STACK\server\paytm\PaytmChecksum.js:15:28) at Function.verifySignatureByString (D:\MERN-STACK\server\paytm\PaytmChecksum.js:56:34) at Function.verifySignature (D:\MERN-STACK\server\paytm\PaytmChecksum.js:47:24) at paytmResponse (file:///D:/MERN-STACK/server/controller/payment-controller.js:27:41) at Layer.handle [as handle_request] (D:\MERN-STACK\server\node_modules\express\lib\router\layer.js:95:5) at next (D:\MERN-STACK\server\node_modules\express\lib\router\route.js:144:13) at Route.dispatch (D:\MERN-STACK\server\node_modules\express\lib\router\route.js:114:3) at Layer.handle [as handle_request] (D:\MERN-STACK\server\node_modules\express\lib\router\layer.js:95:5)

/THIS IS THE CODE FOR RESPONSE PART/

export const paytmResponse=(request,response)=>{
    const form=new formidable.IncomingForm();
    let paytmCheckSum=request.body.CHECKSUMHASH;
    delete request.body.CHECKSUMHASH;

    let isVerifySignature=paytmchecksum.verifySignature(request.body,paytmMerchantKey,paytmCheckSum);

    if(isVerifySignature){
        let paytmParams={};
        paytmParams['MID']=request.body.MID;
        paytmParams['ORDERID']=request.body.ORDERID;

        paytmchecksum.generateSignature(paytmParams,paytmMerchantKey).then(function(checksum){
            paytmParams['CHECKSUMHASH']=checksum;

            let post_data=JSON.stringify(paytmParams);

            let options={
                hostname:'securegw-stage.paytm.in',
                port:443,
                path:'/order/status',
                headers:{
                    'Content-Type':'application/json',
                    'Content-Length':post_data.length 
                }
            }

            let res="";
            let post_req=https.request(options,function(post_res){
                post_res.on('data',function(chunk){
                    res +=chunk;
                });

                post_req.on('end',function(){
                    let result=JSON.parse(res)
                    response.redirect('http://localhost:3000/')
                })
            });

            post_req.write(post_data);
            post_req.end();
        })
    }else{
        console.log('Checksum mismatched');
    }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!