paytm checksum locally works fine, but on server(Heroku) it gives invalid checksum error

Viewed 164

My Paytm Checksum Generation code:

    @PostMapping(value = "/pgredirect", produces = MediaType.TEXT_HTML_VALUE)
        public String getRedirect(@RequestBody Paytm paytm) throws Exception {
    //paytm include( MID,WEBSITE,INDUSTRY_TYPE_ID,CHANNEL_ID,ORDER_ID, CUST_ID,MOBILE_NO,EMAIL,TXN_AMOUNT,CALLBACK_URL) fields

        TreeMap<String, String> paytmParams = new TreeMap<String, String>();
        paytmDetails.getDetails().forEach((k, v) -> paytmParams.put(k, v));


        paytmParams.put("MOBILE_NO", paytm.getMOBILE_NO());
        paytmParams.put("EMAIL", paytm.getEMAIL());
        paytmParams.put("ORDER_ID", paytm.getORDER_ID());
        paytmParams.put("TXN_AMOUNT", paytm.getTXN_AMOUNT());
        paytmParams.put("CUST_ID", paytm.getCUST_ID());


        String checksum = CheckSumServiceHelper.getCheckSumServiceHelper().genrateCheckSum(env.getProperty("merchantKey"),
                paytmParams);
        paytmParams.put("CHECKSUMHASH", checksum);

        //return checksum;
        return checksum;

    }

When I run the code on localhost:4200(Angular) and localhost:8080 (spring boot) it works fine, but when I deploy the same code on Heroku cloud, it gives me an invalid checksum error. Is there any problem with checksum creation?

1 Answers
Related