diff --git a/hai-order/src/main/java/com/web/controller/OrderPayNotifyController.java b/hai-order/src/main/java/com/web/controller/OrderPayNotifyController.java index 02bbd42e..38978b4c 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayNotifyController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayNotifyController.java @@ -28,6 +28,8 @@ import javax.servlet.http.HttpServletResponse; import java.io.BufferedOutputStream; import java.math.BigDecimal; import java.net.URLDecoder; +import java.util.HashMap; +import java.util.Map; import java.util.SortedMap; /** @@ -138,7 +140,7 @@ public class OrderPayNotifyController { if (StringUtils.isNotBlank(params)) { // 参数解码 String paramsStr = URLDecoder.decode(params,"utf-8"); - JSONObject body = JSONObject.parseObject(paramsStr.substring(0, paramsStr.length() - 1)); + JSONObject body = JSONObject.parseObject(paramsStr); log.info("开始处理订单: " + body.getString("outTradeNo")); // 查询订单信息 @@ -146,11 +148,13 @@ public class OrderPayNotifyController { if (order != null && order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { log.info("开始处理业务"); // 处理订单业务 + Map other = new HashMap<>(); + other.put("payChannelOrderNo", order.getPayChannelOrderNo()); paySuccessService.orderPaySuccessHandle(order.getOrderNo(), OrderPayType.PAY_TYPE10, - body.getString("orderNo"), + body.getString("bankTraceNo"), order.getPayPrice(), - null,null); + null,other); } log.info("处理业务完成"); } diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index 7a722577..4214653d 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -89,6 +89,11 @@ public class CommonSysConfig { private String unionStagingPayOrgTermNo; private String unionStagingPayNotifyUrl; + // 贵行V家园小程序支付 + private String huiftReqUrl; + private String huiftShopCode; + private String huiftSignSecret; + private String wx_cert; private String telApiKey; diff --git a/hai-service/src/main/java/com/hai/pay/channel/huift/TradeService.java b/hai-service/src/main/java/com/hai/pay/channel/huift/TradeService.java index 89e23a3d..90eaeeaf 100644 --- a/hai-service/src/main/java/com/hai/pay/channel/huift/TradeService.java +++ b/hai-service/src/main/java/com/hai/pay/channel/huift/TradeService.java @@ -10,6 +10,7 @@ import com.hai.entity.HighOrder; import com.hai.entity.HighOrderRefund; import com.hai.enum_type.OrderStatusEnum; import com.hai.order.type.OrderPayType; +import com.hai.order.type.OrderProductType; import com.hai.pay.channel.huift.config.HuiftConfig; import com.hai.service.HighOrderService; import org.springframework.stereotype.Component; @@ -45,7 +46,22 @@ public class TradeService { param.put("callbackUrl", CommonSysConst.getSysConfig().getHsgDomainName() + "/order/payNotify/huiftPay"); // param.put("remark", ""); // 备注 // param.put("outAppId", ""); - // param.put("outRedirectPath", ""); + + if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE12.getNumber())) { + + param.put("outRedirectPath", CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=0000016&key=&code=/physical-merchants/classify/order/orderDetail?id=" + order.getOrderNo()); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE5.getNumber())) { + + param.put("outRedirectPath", CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=0000016&key=&code=/pages/pay/success/success?id=" + order.getOrderNo()); + + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE1.getNumber()) || order.getProductType().equals(OrderProductType.PRODUCT_TYPE2.getNumber())) { + + param.put("outRedirectPath", CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=0000016&key=&code=/gianzhu-KFC/order-details/order-details?id=" + order.getOrderNo()); + + } else { + param.put("outRedirectPath", CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=0000016&key=&code=/pages/user/order_details/order_details?id=" + order.getOrderNo()); + } param.put("sign", HuiftConfig.md5Encode(HuiftConfig.paramSort(param, HuiftConfig.signSecret).getBytes()).toLowerCase()); JSONObject response = HttpsUtils.doPost(HuiftConfig.reqUrl + "/hfq/v1/thirdPay/thirdPreOrder", JSONObject.toJSONString(param)); if (response.getString("status").equals("ok")) { diff --git a/hai-service/src/main/java/com/hai/pay/channel/huift/config/HuiftConfig.java b/hai-service/src/main/java/com/hai/pay/channel/huift/config/HuiftConfig.java index c90fbf98..fe025055 100644 --- a/hai-service/src/main/java/com/hai/pay/channel/huift/config/HuiftConfig.java +++ b/hai-service/src/main/java/com/hai/pay/channel/huift/config/HuiftConfig.java @@ -1,5 +1,7 @@ package com.hai.pay.channel.huift.config; +import com.hai.config.CommonSysConfig; +import com.hai.config.CommonSysConst; import org.apache.commons.lang3.StringUtils; import javax.xml.bind.annotation.adapters.HexBinaryAdapter; @@ -15,9 +17,9 @@ import java.util.Set; **/ public class HuiftConfig { - public final static String reqUrl = "https://linktest.huift.com.cn"; - public final static String shopcode = "50041b27-f985-dcb0-1cc0-f106b09bf1fe"; - public final static String signSecret = "DB4D8069A9AC6DDF9D75667EE5CF182A"; + public final static String reqUrl = CommonSysConst.getSysConfig().getHuiftReqUrl(); + public final static String shopcode = CommonSysConst.getSysConfig().getHuiftShopCode(); + public final static String signSecret = CommonSysConst.getSysConfig().getHuiftSignSecret(); /** * 参数排序 diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 618b842a..767b4ce2 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -57,6 +57,12 @@ huiliantongSinopecDistributorId=aNId4A3X huiliantongDistributorId=1JnL8YMV huiliantongSinopecUrl=fuelCoupons + +huiftReqUrl=https://gzyhmp.huift.com.cn +huiftShopCode=20240653-59c4-4181-9157-17fd4b95c3fc +huiftSignSecret=19C17F9E19B8DDDDF2FD2EE4EA9F6C61 + + HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json HuiLianTongUnionCardAccessCode=6FCAE1470CEF465988351BB65ABAA8AE HuiLianTongUnionCardSignCode=F8E91A3C diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index 4de0d04d..a87f03b0 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -101,6 +101,9 @@ HgApiKey=3fd74e7c16b04681a0f481c5bc0a96d3 HgMemberId=1622808562621276161 HgPostUrl=http://113.250.49.100:8088/recharge/ +huiftReqUrl=https://gzyhmp.huift.com.cn +huiftShopCode=20240653-59c4-4181-9157-17fd4b95c3fc +huiftSignSecret=19C17F9E19B8DDDDF2FD2EE4EA9F6C61 #CY CyApiKey=cyMYLABWa2H2u @@ -166,4 +169,4 @@ wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a #Sph SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry SphMerchant = 618809656349 -SphSecret = xstEWAhjw74GzMkXcPr2Cf7z00aYXaSy \ No newline at end of file +SphSecret = xstEWAhjw74GzMkXcPr2Cf7z00aYXaSy