修改h5相关支付流程
This commit is contained in:
@@ -83,7 +83,7 @@ public class WuyouController {
|
||||
@Debounce(interval = 1000, value = "#orderId")
|
||||
@ApiOperation("支付订单")
|
||||
@GetMapping("/payOrder/{orderId}")
|
||||
public Result payOrder(HttpServletRequest request, @PathVariable("orderId") Long orderId) {
|
||||
public Result payOrder(HttpServletRequest request, @PathVariable("orderId") Long orderId, @RequestParam("payType") String payType) {
|
||||
Orders order = ordersService.getById(orderId);
|
||||
if (order == null) {
|
||||
return Result.error("订单不存在");
|
||||
@@ -119,7 +119,8 @@ public class WuyouController {
|
||||
}
|
||||
|
||||
BaseResp baseResp = WuyouPay.payOrder(payDetails.getTradeNo(), order.getPayMoney().toString(),
|
||||
request.getHeader("User-Agent"), String.format("%d-%d", order.getCourseId(), order.getCourseDetailsId()));
|
||||
request.getHeader("User-Agent"), String.format("%d-%d", order.getCourseId(), order.getCourseDetailsId()),
|
||||
payType);
|
||||
if (baseResp.getCode() == null) {
|
||||
return Result.error(baseResp.getErrorMsg());
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class WuyouPay {
|
||||
H5_BASE_URL = h5BaseUrl;
|
||||
}
|
||||
|
||||
public static BaseResp payOrder(String orderNo, String amount, String userAgent, String allId) {
|
||||
public static BaseResp payOrder(String orderNo, String amount, String userAgent, String allId, String payType) {
|
||||
Map<String, Object> params = getBaseParams();
|
||||
params.put("type", "6001");
|
||||
params.put("is_code", "1");
|
||||
@@ -42,7 +42,9 @@ public class WuyouPay {
|
||||
|
||||
String sign = Encrypt.getParamsSign(params);
|
||||
params.put("sign", sign);
|
||||
params.put("return_url", H5_BASE_URL + allId);
|
||||
if ("h5".equals(payType)) {
|
||||
params.put("return_url", H5_BASE_URL + allId);
|
||||
}
|
||||
|
||||
// https://dj-h5.hnsiyao.cn/me/detail/detail?allId=1230-98688
|
||||
|
||||
@@ -126,7 +128,7 @@ public class WuyouPay {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
payOrder("20221118123456794", "0.1", "Mozilla/5.0", "1230-98688");
|
||||
payOrder("20221118123456794", "0.1", "Mozilla/5.0", "1230-98688", "h5");
|
||||
// queryOrder("20221118123456791", "0.1", "Mozilla/5.0");
|
||||
|
||||
extractOrder("20221118123456793", "1", "1157756119@qq.com", "巩奕杰");
|
||||
|
||||
Reference in New Issue
Block a user