Explorar el Código

fix原生支付服务

Eric hace 1 año
padre
commit
a05c3b555c

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

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.admin.controller.open;
 
+import cn.hutool.extra.servlet.ServletUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.huifu.adapay.core.AdapayCore;
@@ -94,7 +95,8 @@ public class UserPaymentClient {
 
     @ApiOperation(value = "用户付款", notes = "用户付款")
     @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())) {
@@ -104,6 +106,11 @@ public class UserPaymentClient {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
+        reqConfig.setIp(ServletUtil.getClientIP(request));
+
         JwtUserInfo<Object> userInfo = JwtUserInfo.builder()
             .userId(config.getUserId())
             .clientType(config.getUserType().getCode())

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

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

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

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

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

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

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

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

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

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

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

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

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

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