I've tried multiple ways and also referred their docs to fix this signature mismatch error. I've attached below the JAVA code that generated the checksum. I copied this logic from their 'seamless pro' integration docs.
Map<String, String> postData = new HashMap<String, String>();
postData.put("appId", cashfreeAppId);
postData.put("orderId", orderId);
postData.put("orderAmount", orderAmount.toString());
postData.put("orderCurrency", orderCurrency);
postData.put("orderNote", orderNote);
postData.put("customerName", customerName);
postData.put("customerEmail", customerEmail);
postData.put("customerPhone", customerPhone);
postData.put("returnUrl", returnUrl);
postData.put("notifyUrl", notifyUrl);
String data = "";
SortedSet<String> keys = new TreeSet<String>(postData.keySet());
for (String key : keys) {
data = data + key + postData.get(key);
}
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key_spec = new SecretKeySpec(cashfreeSecretkey.getBytes(), "HmacSHA256");
sha256_HMAC.init(secret_key_spec);
return Base64.getEncoder().encodeToString(sha256_HMAC.doFinal(data.getBytes()));
if anyone has a working sample of this checksum generation please provide the code snippet.
If you are using seamless pro integration make sure you are using the complete request parameters while generating the signature i.e payment mode and other details as well.