ソースを参照

fix原生支付服务

Eric 1 年間 前
コミット
087a50e081

+ 8 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/open/UserPaymentClient.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.admin.controller.open;
 package com.yonge.cooleshow.admin.controller.open;
 
 
+import cn.hutool.extra.servlet.ServletUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.huifu.adapay.core.AdapayCore;
 import com.huifu.adapay.core.AdapayCore;
@@ -103,7 +104,8 @@ public class UserPaymentClient {
 
 
     @ApiOperation(value = "用户付款", notes = "用户付款")
     @ApiOperation(value = "用户付款", notes = "用户付款")
     @PostMapping("/executePayment/v2")
     @PostMapping("/executePayment/v2")
-    public R<UserPaymentOrderWrapper.PaymentReq> executePayment(@Validated @RequestBody UserPaymentOrderWrapper.PaymentOrderReqConfig config) {
+    public R<UserPaymentOrderWrapper.PaymentReq> executePayment(@Validated @RequestBody UserPaymentOrderWrapper.PaymentOrderReqConfig config,
+                                                                HttpServletRequest request) {
 
 
         // 用户登录状态校验
         // 用户登录状态校验
         if (StringUtils.isBlank(config.getUserId())) {
         if (StringUtils.isBlank(config.getUserId())) {
@@ -113,6 +115,11 @@ public class UserPaymentClient {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
+        reqConfig.setIp(ServletUtil.getClientIP(request));
+
         JwtUserInfo<Object> userInfo = JwtUserInfo.builder()
         JwtUserInfo<Object> userInfo = JwtUserInfo.builder()
             .userId(config.getUserId())
             .userId(config.getUserId())
             .clientType(config.getUserType().getCode())
             .clientType(config.getUserType().getCode())

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/UserOrderController.java

@@ -325,6 +325,9 @@ public class UserOrderController extends BaseController {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/open/UserPaymentClient.java

@@ -44,6 +44,9 @@ public class UserPaymentClient {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/vo/UserPaymentOrderVo.java

@@ -192,6 +192,9 @@ public class UserPaymentOrderVo {
     @ApiModel("订单支付参数配置")
     @ApiModel("订单支付参数配置")
     public static class PaymentReqConfig implements Serializable {
     public static class PaymentReqConfig implements Serializable {
 
 
+        @ApiModelProperty("支付厂商")
+        private String paymentVendor;
+
         @ApiModelProperty("支付渠道")
         @ApiModelProperty("支付渠道")
         private String paymentChannel;
         private String paymentChannel;
 
 

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/UserOrderController.java

@@ -287,6 +287,9 @@ public class UserOrderController extends BaseController {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/open/UserPaymentClient.java

@@ -44,6 +44,9 @@ public class UserPaymentClient {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/vo/UserPaymentOrderVo.java

@@ -192,6 +192,9 @@ public class UserPaymentOrderVo {
     @ApiModel("订单支付参数配置")
     @ApiModel("订单支付参数配置")
     public static class PaymentReqConfig implements Serializable {
     public static class PaymentReqConfig implements Serializable {
 
 
+        @ApiModelProperty("支付厂商")
+        private String paymentVendor;
+
         @ApiModelProperty("支付渠道")
         @ApiModelProperty("支付渠道")
         private String paymentChannel;
         private String paymentChannel;
 
 

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/controller/UserOrderController.java

@@ -108,6 +108,9 @@ public class UserOrderController {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/controller/open/UserPaymentClient.java

@@ -39,6 +39,9 @@ public class UserPaymentClient {
         // 用户下单请求
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/vo/UserPaymentOrderVo.java

@@ -192,6 +192,9 @@ public class UserPaymentOrderVo {
     @ApiModel("订单支付参数配置")
     @ApiModel("订单支付参数配置")
     public static class PaymentReqConfig implements Serializable {
     public static class PaymentReqConfig implements Serializable {
 
 
+        @ApiModelProperty("支付厂商")
+        private String paymentVendor;
+
         @ApiModelProperty("支付渠道")
         @ApiModelProperty("支付渠道")
         private String paymentChannel;
         private String paymentChannel;