Search code examples
node.jspayment-gatewaypaytm

Paytm verify checksum issue


Paytm Verify checksum keeps failing in node.js. we used this library from paytm


Solution

  • Verify checksum was failing because of the date format issue.

    Paytm uses the date format as “YYYY-MM-DD hh:mm:ss.S” whereas we were getting TXNDATE as

    Mon Mar 27 2017 17:00:37 GMT+0000 (UTC)
    

    or

      TXNDATE: 2017-03-27T17:00:37.000Z,
    

    So we need to convert TXNDATE into the above mentioned format using moment.js

    params.TXNDATE = moment(new Date(params.TXNDATE)).utc().format("YYYY-MM-DD HH:mm:ss.S")