|
@@ -100,8 +100,9 @@ public class TWeixinController extends BaseController<TWeixin,TWeixinExample,TWe
|
|
* You can get Checksum JAR from https://developer.paytm.com/docs/v1/payment-gateway/#code
|
|
* You can get Checksum JAR from https://developer.paytm.com/docs/v1/payment-gateway/#code
|
|
* Find your Merchant Key in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys
|
|
* Find your Merchant Key in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys
|
|
*/
|
|
*/
|
|
|
|
+ String checksum2="";
|
|
try { String checksum = CheckSumServiceHelper.getCheckSumServiceHelper().genrateCheckSum("kbzk1DSbJiV_O3p5", body.toString());
|
|
try { String checksum = CheckSumServiceHelper.getCheckSumServiceHelper().genrateCheckSum("kbzk1DSbJiV_O3p5", body.toString());
|
|
-
|
|
|
|
|
|
+ checksum2 = checksum;
|
|
/* head parameters */
|
|
/* head parameters */
|
|
JSONObject head = new JSONObject();
|
|
JSONObject head = new JSONObject();
|
|
Long startTs = System.currentTimeMillis(); // 当前时间戳
|
|
Long startTs = System.currentTimeMillis(); // 当前时间戳
|
|
@@ -126,7 +127,13 @@ public class TWeixinController extends BaseController<TWeixin,TWeixinExample,TWe
|
|
|
|
|
|
/* for Production */
|
|
/* for Production */
|
|
// URL url = new URL("https://securegw.paytm.in/link/create);
|
|
// URL url = new URL("https://securegw.paytm.in/link/create);
|
|
-
|
|
|
|
|
|
+// TWeixin weixin = new TWeixin();
|
|
|
|
+// weixin.setAdminId("1");
|
|
|
|
+// weixin.setAvatarUrl(paytmParams.toString().substring(0,200));
|
|
|
|
+// weixin.setCreateDate(new Date());
|
|
|
|
+// weixin.setModifyDate(new Date());
|
|
|
|
+// weixin.setNickName(checksum);
|
|
|
|
+// tWeixinService.insert(weixin);
|
|
|
|
|
|
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
connection.setRequestMethod("POST");
|
|
connection.setRequestMethod("POST");
|
|
@@ -149,7 +156,7 @@ public class TWeixinController extends BaseController<TWeixin,TWeixinExample,TWe
|
|
exception.printStackTrace();
|
|
exception.printStackTrace();
|
|
}
|
|
}
|
|
return ResponseEntity.status(HttpStatus.OK)
|
|
return ResponseEntity.status(HttpStatus.OK)
|
|
- .body(new ResultMessage().setCode(true).setData(result).setMessage("success"));
|
|
|
|
|
|
+ .body(new ResultMessage().setCode(true).setData(result).setMessage(checksum2));
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 支付成功回调
|
|
* 支付成功回调
|
|
@@ -173,12 +180,18 @@ public class TWeixinController extends BaseController<TWeixin,TWeixinExample,TWe
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ TWeixin weixin = new TWeixin();
|
|
|
|
+ weixin.setAdminId("1");
|
|
|
|
+ weixin.setAvatarUrl(paytmParams.toString().substring(0,240));
|
|
|
|
+ weixin.setCreateDate(new Date());
|
|
|
|
+ weixin.setModifyDate(new Date());
|
|
|
|
+ weixin.setNickName(paytmChecksum);
|
|
|
|
+ tWeixinService.insert(weixin);
|
|
/**
|
|
/**
|
|
* Verify checksum
|
|
* Verify checksum
|
|
* Find your Merchant Key in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys
|
|
* Find your Merchant Key in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys
|
|
*/
|
|
*/
|
|
- boolean isValidChecksum = CheckSumServiceHelper.getCheckSumServiceHelper().verifycheckSum("YOUR_KEY_HERE", paytmParams, paytmChecksum);
|
|
|
|
|
|
+ boolean isValidChecksum = CheckSumServiceHelper.getCheckSumServiceHelper().verifycheckSum("kbzk1DSbJiV_O3p5", paytmParams, paytmChecksum);
|
|
if (isValidChecksum) {
|
|
if (isValidChecksum) {
|
|
System.out.append("Checksum Matched");
|
|
System.out.append("Checksum Matched");
|
|
} else {
|
|
} else {
|