// amount of points to give
int payPoint = Integer.parseInt(request.getParameter("pay_pnt"));
// unique transaction id generated in Tnk server to distinguish this postback.
String seqId = request.getParameter("seq_id");
// check code to verify parameters
String checkCode = request.getParameter("md_chk");
// user identifcation string that you have set in your app using TnkSession's setUserName: method
String mdUserName = request.getParameter("md_user_nm");
// Your app key from Tnk site
String appKey = "d2bbd...........19c86c8b021";
// Make verfication Code using the parameters in this post back.
// DigestUtils comes from Apache's commons-codec.jar. Other md5 libraries are Ok.
String verifyCode = DigestUtils.md5Hex(appKey + mdUserName + seqId);
// Compare verification code you generated with the value from md_chk parameter. These two values must be identical.
if (checkCode == null || !checkCode.equals(verifyCode)) {
// invalid request
log.error("tnkad() check error : " + verifyCode + " != " + checkCode);
} else {
log.debug("tnkad() : " + mdUserName + ", " + seqId);
// do your point management logic here. Don't forget to check if seqId is processed before.
purchaseManager.getPointByAd(mdUserName, payPoint, seqId);
}