From cf5217385bee36921accec1e1de19b77fce2d900 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 19 十一月 2025 09:46:25 +0800
Subject: [PATCH] 支付
---
UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DouGongPayUtil.java | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DouGongPayUtil.java b/UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DouGongPayUtil.java
index 66b56ed..64fe1bd 100644
--- a/UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DouGongPayUtil.java
+++ b/UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DouGongPayUtil.java
@@ -89,6 +89,9 @@
HttpResponse execute = post.execute();
System.out.println(execute.body());
+ String body = execute.body();
+ JSONObject jsonObject = JSONObject.parseObject(body);
+ System.out.println(jsonObject);
}
@@ -101,7 +104,7 @@
* @param orderId
* @return
*/
- public static String wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) {
+ public static ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) {
HttpRequest post = HttpUtil.createPost("https://api.huifu.com/v4/trade/payment/create");
String req_seq_id = orderId + "_" + type + "_" + System.currentTimeMillis() + ToolUtil.getRandomNumber(10);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
@@ -123,6 +126,14 @@
case 4:
// 感谢费支付回调
notifyUrl = callbackPath + "/base/DGPayThankYouFee";
+ break;
+ case 5:
+ // 取消订单
+ notifyUrl = callbackPath + "/base/DGCancelOrderTaxi";
+ break;
+ case 6:
+ // 充值
+ notifyUrl = callbackPath + "/base/wxCancelUserBalance";
break;
}
String a = "{\n" +
@@ -164,7 +175,8 @@
HttpResponse execute = post.execute();
System.out.println(execute.body());
- return execute.body();
+ JSONObject jsonObject = JSONObject.parseObject(execute.body());
+ return ResultUtil.success(jsonObject);
}
/**
@@ -176,7 +188,7 @@
* @param orderId
* @return
*/
- public static String aliPayOrder(String money, String buyerId, String goodsDesc, int type, String orderId, int callType) {
+ public static ResultUtil aliPayOrder(String money, String buyerId, String goodsDesc, int type, String orderId, int callType) {
HttpRequest post = HttpUtil.createPost("https://api.huifu.com/v4/trade/payment/create");
String req_seq_id = orderId + "_" + type + "_" + System.currentTimeMillis() + ToolUtil.getRandomNumber(10);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
@@ -209,7 +221,6 @@
" \"goods_desc\": \"" + goodsDesc + "\",\n" +
" \"remark\": \"嘉易行\",\n" +
" \"notify_url\": \""+notifyUrl+"\",\n" +
- " \"method_expand\": \"{\\\"buyer_id\\\":\\\"" + buyerId + "\\\"}\"\n" +
" }";
// 去掉换行、空格等格式字符
a = a.replaceAll("\\s", "");
@@ -231,15 +242,14 @@
" \"goods_desc\": \"" + goodsDesc + "\",\n" +
" \"remark\": \"嘉易行\",\n" +
" \"notify_url\": \""+notifyUrl+"\",\n" +
- " \"method_expand\": \"{\\\"buyer_id\\\":\\\"" + buyerId + "\\\"}\"\n" +
" }\n" +
"}\n";
System.out.println(p);
post.body(p);
HttpResponse execute = post.execute();
- System.out.println(execute.body());
- return execute.body();
+ JSONObject jsonObject = JSONObject.parseObject(execute.body());
+ return ResultUtil.success(jsonObject);
}
--
Gitblit v1.7.1