Procházet zdrojové kódy

支付宝支付接口编写

weifanli před 3 roky
rodič
revize
6adb312a36
14 změnil soubory, kde provedl 473 přidání a 69 odebrání
  1. 14 3
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/PaymentController.java
  2. 20 10
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/adapay/AdapayTemplate.java
  3. 7 3
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/enums/PayChannelEnum.java
  4. 0 14
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/ClosePayment.java
  5. 68 0
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/OrderDetil.java
  6. 32 18
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/Payment.java
  7. 0 14
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/RefundBill.java
  8. 38 0
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/core/props/PaymentProperties.java
  9. 13 6
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/core/util/PaywayUtil.java
  10. 1 1
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/core/util/SpringBeansUtil.java
  11. 134 0
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/ali/OriginalAliAppTemplate.java
  12. 45 0
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/ali/config/AlipayConfiguration.java
  13. 52 0
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/ali/constant/AlipayConstant.java
  14. 49 0
      toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/wx/OriginalWxAppTemplate.java

+ 14 - 3
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/PaymentController.java

@@ -79,13 +79,24 @@ public class PaymentController extends BaseController {
     }
 
     /***
-     * 付回调
+     * 付回调
      * @author liweifan
      * @param: request
      * @updateTime 2022/3/11 18:35
      */
-    @PostMapping("/adapayCallback")
-    public void adapayCallback(HttpServletRequest request) {
+    @PostMapping("/callback/{openType}/{payChannel}/{payMethod}")
+    public void callback(
+            @PathVariable("openType") String openType,
+            @PathVariable("payChannel") String payChannel,
+            @PathVariable("payMethod") String payMethod,
+            HttpServletRequest request
+    ) {
+        if(OpenEnum.ADAPAY.getCode().equals(openType)){
+            adapayCallbackHandle(request);
+        }
+    }
+
+    private void adapayCallbackHandle(HttpServletRequest request){
         try {
             //验签传参data
             String data = request.getParameter("data");

+ 20 - 10
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/adapay/AdapayTemplate.java

@@ -12,6 +12,7 @@ import com.yonge.toolset.payment.base.model.ClosePayment;
 import com.yonge.toolset.payment.base.model.OpenAuth;
 import com.yonge.toolset.payment.base.model.Payment;
 import com.yonge.toolset.payment.base.model.RefundBill;
+import com.yonge.toolset.payment.core.props.PaymentProperties;
 import com.yonge.toolset.payment.core.service.SysConfigPaymentService;
 import com.yonge.toolset.utils.string.StringUtil;
 import org.slf4j.Logger;
@@ -28,6 +29,8 @@ public class AdapayTemplate implements PaymentTemplate {
     private final static Logger log = LoggerFactory.getLogger(AdapayTemplate.class);
 
     @Autowired
+    private PaymentProperties paymentProperties;
+    @Autowired
     private SysConfigPaymentService configPaymentService;
 
     @Override
@@ -36,7 +39,7 @@ public class AdapayTemplate implements PaymentTemplate {
     }
 
     @Override
-    public BaseResult<Payment> executePayment(Payment payment){
+    public BaseResult<Payment> executePayment(Payment payment) {
         Map<String, Object> paymentMap = new HashMap<>();
         paymentMap.put("order_no", payment.getPaymentNo());
         paymentMap.put("app_id", configPaymentService.getPaymentConfig(payment.getOpenType(), AdapayConstant.APP_ID).getParamValue());
@@ -48,8 +51,11 @@ public class AdapayTemplate implements PaymentTemplate {
         paymentMap.put("description", payment.getDescription());
         paymentMap.put("device_info", payment.getDeviceInfo());
         paymentMap.put("expend", payment.getExpend());
-        paymentMap.put("notify_url",
-                StringUtil.isEmpty(payment.getNotifyUrl()) ? configPaymentService.getPaymentConfig(payment.getOpenType(), AdapayConstant.NOTIFY_URL).getParamValue() : payment.getNotifyUrl());
+        paymentMap.put("notify_url", paymentProperties.getNotifyUrl()
+                + "/" + payment.getOpenType().getCode()
+                + "/" + payment.getPayChannel().getCode()
+                + "/executePayment"
+        );
 
         log.info("汇付[创建支付对象] Req:{}", JSONObject.toJSONString(paymentMap));
         //调用sdk方法,创建支付,得到支付对象
@@ -103,9 +109,11 @@ public class AdapayTemplate implements PaymentTemplate {
         paymentParams.put("payment_id", closePayment.getId());
         paymentParams.put("reason", closePayment.getReason());
         paymentParams.put("expend", closePayment.getExpend());
-        paymentParams.put("notify_url",
-                StringUtil.isEmpty(closePayment.getNotifyUrl()) ? configPaymentService.getPaymentConfig(closePayment.getOpenType(), AdapayConstant.NOTIFY_URL).getParamValue() : closePayment.getNotifyUrl());
-
+        paymentParams.put("notify_url", paymentProperties.getNotifyUrl()
+                + "/" + closePayment.getOpenType().getCode()
+                + "/" + closePayment.getPayChannel().getCode()
+                + "/closePayment"
+        );
         Map<String, Object> res;
         try {
             res = com.huifu.adapay.model.Payment.close(paymentParams);
@@ -126,13 +134,15 @@ public class AdapayTemplate implements PaymentTemplate {
     }
 
     @Override
-    public BaseResult<RefundBill> refundPayment(RefundBill refundBill)  {
+    public BaseResult<RefundBill> refundPayment(RefundBill refundBill) {
         Map<String, Object> refundParams = new HashMap<>(10);
         refundParams.put("refund_amt", refundBill.getRefundAmt());
         refundParams.put("refund_order_no", refundBill.getRefundNo());
-        refundParams.put("notify_url",
-                StringUtil.isEmpty(refundBill.getNotifyUrl()) ? configPaymentService.getPaymentConfig(refundBill.getOpenType(), AdapayConstant.NOTIFY_URL).getParamValue() : refundBill.getNotifyUrl());
-
+        refundParams.put("notify_url", paymentProperties.getNotifyUrl()
+                + "/" + refundBill.getOpenType().getCode()
+                + "/" + refundBill.getPayChannel().getCode()
+                + "/refundPayment"
+        );
         Map<String, Object> res;
         try {
             res = Refund.create(refundBill.getId(), refundParams);

+ 7 - 3
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/enums/PayChannelEnum.java

@@ -5,14 +5,18 @@ import com.yonge.toolset.base.enums.BaseEnum;
 
 /**
  * 支付渠道
- *
+ * 汇付支持 alipay、wx_lite
+ * 原生支持 alipay_app、wx_app
  * @author liweifan
  * @updateTime 2022/3/31 11:30
  */
 public enum PayChannelEnum implements BaseEnum<String, PayChannelEnum> {
     alipay("支付宝扫码"),
-    alipay_lite("支付宝小程序支付"),
-    wx_lite("微信小程序支付");
+    alipay_app("支付宝app"),
+
+    wx_app("微信app"),
+    wx_lite("微信小程序支付"),
+    ;
 
     @EnumValue
     private String code;

+ 0 - 14
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/ClosePayment.java

@@ -22,12 +22,6 @@ public class ClosePayment extends Base {
      */
     String reason;
     /***
-     * 回调url
-     * @author liweifan
-     * @updateTime 2022/5/10 15:30
-     */
-    String notifyUrl;
-    /***
      * 扩展域
      * @author liweifan
      * @updateTime 2022/5/10 15:30
@@ -54,14 +48,6 @@ public class ClosePayment extends Base {
         this.reason = reason;
     }
 
-    public String getNotifyUrl() {
-        return notifyUrl;
-    }
-
-    public void setNotifyUrl(String notifyUrl) {
-        this.notifyUrl = notifyUrl;
-    }
-
     public String getExpend() {
         return expend;
     }

+ 68 - 0
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/OrderDetil.java

@@ -0,0 +1,68 @@
+package com.yonge.toolset.payment.base.model;
+
+import java.io.Serializable;
+
+/**
+ * 订单详情信息
+ * @Author: liweifan
+ * @Data: 2022/3/31 11:36
+ */
+public class OrderDetil implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /***
+     * 商品编号
+     * @author liweifan
+     * @updateTime 2022/3/31 11:07
+     */
+    private String goodsId;
+    /***
+     * 商品名称
+     * @author liweifan
+     * @updateTime 2022/3/31 11:07
+     */
+    private String goodName;
+    /***
+     * 商品数量
+     * @author liweifan
+     * @updateTime 2022/3/31 11:07
+     */
+    private Integer quantity = 1;
+    /***
+     * 商品价格
+     * @author liweifan
+     * @updateTime 2022/3/31 11:07
+     */
+    private String price;
+
+    public String getGoodsId() {
+        return goodsId;
+    }
+
+    public void setGoodsId(String goodsId) {
+        this.goodsId = goodsId;
+    }
+
+    public String getGoodName() {
+        return goodName;
+    }
+
+    public void setGoodName(String goodName) {
+        this.goodName = goodName;
+    }
+
+    public Integer getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(Integer quantity) {
+        this.quantity = quantity;
+    }
+
+    public String getPrice() {
+        return price;
+    }
+
+    public void setPrice(String price) {
+        this.price = price;
+    }
+}

+ 32 - 18
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/Payment.java

@@ -26,6 +26,18 @@ public class Payment extends Base {
      */
     private String paymentNo;
     /***
+     * 原始订单号(可选)
+     * @author liweifan
+     * @updateTime 2022/3/31 11:00
+     */
+    private String orderNo;
+    /***
+     * 商品详情(可选)
+     * @author liweifan
+     * @updateTime 2022/5/12 15:31
+     */
+    private List<OrderDetil> orderDetils;
+    /***
      * 商品标题(必填)
      * @author liweifan
      * @updateTime 2022/3/31 11:01
@@ -44,31 +56,25 @@ public class Payment extends Base {
      */
     private String payAmt;
     /***
-     * 订单附加说明
+     * 订单附加说明(可选)
      * @author liweifan
      * @updateTime 2022/3/31 11:01
      */
     private String description;
     /***
-     * 异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
-     * @author liweifan
-     * @updateTime 2022/3/31 11:01
-     */
-    private String notifyUrl;
-    /***
-     * 分账对象信息列表
+     * 分账对象信息列表(可选)
      * @author liweifan
      * @updateTime 2022/3/31 11:01
      */
     private List<DivMember> divMembers;
     /***
-     * 前端设备信息
+     * 前端设备信息(可选)
      * @author liweifan
      * @updateTime 2022/3/31 11:01
      */
     private DeviceInfo deviceInfo;
     /***
-     * 支付渠道额外参数
+     * 支付渠道额外参数(可选)
      * @author liweifan
      * @updateTime 2022/3/31 11:01
      */
@@ -100,6 +106,14 @@ public class Payment extends Base {
         this.paymentNo = paymentNo;
     }
 
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
     public String getOrderTitle() {
         return orderTitle;
     }
@@ -132,14 +146,6 @@ public class Payment extends Base {
         this.description = description;
     }
 
-    public String getNotifyUrl() {
-        return notifyUrl;
-    }
-
-    public void setNotifyUrl(String notifyUrl) {
-        this.notifyUrl = notifyUrl;
-    }
-
     public List<DivMember> getDivMembers() {
         return divMembers;
     }
@@ -171,4 +177,12 @@ public class Payment extends Base {
     public void setPayInfo(String payInfo) {
         this.payInfo = payInfo;
     }
+
+    public List<OrderDetil> getOrderDetils() {
+        return orderDetils;
+    }
+
+    public void setOrderDetils(List<OrderDetil> orderDetils) {
+        this.orderDetils = orderDetils;
+    }
 }

+ 0 - 14
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/base/model/RefundBill.java

@@ -29,12 +29,6 @@ public class RefundBill extends Base {
      */
     private BigDecimal refundAmt;
     /***
-     * 异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
-     * @author liweifan
-     * @updateTime 2022/3/31 11:01
-     */
-    private String notifyUrl;
-    /***
      * 退款描述
      * @author liweifan
      * @updateTime 2022/3/31 11:00
@@ -69,14 +63,6 @@ public class RefundBill extends Base {
         this.refundAmt = refundAmt;
     }
 
-    public String getNotifyUrl() {
-        return notifyUrl;
-    }
-
-    public void setNotifyUrl(String notifyUrl) {
-        this.notifyUrl = notifyUrl;
-    }
-
     public String getReason() {
         return reason;
     }

+ 38 - 0
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/core/props/PaymentProperties.java

@@ -0,0 +1,38 @@
+package com.yonge.toolset.payment.core.props;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "payment")
+public class PaymentProperties {
+    /***
+     * 支付服务提供方
+     * @author liweifan
+     * @updateTime 2022/5/11 17:01
+     */
+    private String openType;
+
+    /***
+     * 支付回调url
+     * @author liweifan
+     * @updateTime 2022/5/11 17:01
+     */
+    private String notifyUrl;
+
+    public String getOpenType() {
+        return openType;
+    }
+
+    public void setOpenType(String openType) {
+        this.openType = openType;
+    }
+
+    public String getNotifyUrl() {
+        return notifyUrl;
+    }
+
+    public void setNotifyUrl(String notifyUrl) {
+        this.notifyUrl = notifyUrl;
+    }
+}

+ 13 - 6
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/core/util/PaywayUtil.java

@@ -3,7 +3,7 @@ package com.yonge.toolset.payment.core.util;
 import com.yonge.toolset.base.exception.BizException;
 import com.yonge.toolset.payment.base.PaymentTemplate;
 import com.yonge.toolset.payment.base.enums.OpenEnum;
-import com.yonge.toolset.payment.util.SpringBeansUtil;
+import com.yonge.toolset.payment.base.enums.PayChannelEnum;
 
 /***
  *
@@ -18,11 +18,18 @@ public class PaywayUtil {
      * @updateTime 2022/5/11 16:05
      * @return: com.yonge.toolset.payment.base.PaymentTemplate
      */
-    public static PaymentTemplate getRealTemplate(OpenEnum openType) {
-        if(OpenEnum.ORIGINAL.equals(openType)){
-            //原生
-            return (PaymentTemplate) SpringBeansUtil.getBean("");
-        }else if(OpenEnum.ADAPAY.equals(openType)){
+    public static PaymentTemplate getRealTemplate(OpenEnum openType, PayChannelEnum payChannel) {
+        //原生
+        if (OpenEnum.ORIGINAL.equals(openType)) {
+            //支付宝
+            if (PayChannelEnum.alipay_app.equals(payChannel)) {
+                return (PaymentTemplate) SpringBeansUtil.getBean("originalAliAppTemplate");
+            }
+            //微信
+            if (PayChannelEnum.wx_app.equals(payChannel)) {
+                return (PaymentTemplate) SpringBeansUtil.getBean("originalWxAppTemplate");
+            }
+        } else if (OpenEnum.ADAPAY.equals(openType)) {
             //汇付
             return (PaymentTemplate) SpringBeansUtil.getBean("adapayTemplate");
         }

+ 1 - 1
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/util/SpringBeansUtil.java → toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/core/util/SpringBeansUtil.java

@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.yonge.toolset.payment.util;
+package com.yonge.toolset.payment.core.util;
 
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;

+ 134 - 0
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/ali/OriginalAliAppTemplate.java

@@ -0,0 +1,134 @@
+package com.yonge.toolset.payment.original.ali;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.AlipayClient;
+import com.alipay.api.request.AlipayTradeAppPayRequest;
+import com.alipay.api.request.AlipayTradeQueryRequest;
+import com.alipay.api.response.AlipayTradeAppPayResponse;
+import com.alipay.api.response.AlipayTradeQueryResponse;
+import com.yonge.toolset.base.result.BaseResult;
+import com.yonge.toolset.payment.base.PaymentTemplate;
+import com.yonge.toolset.payment.base.enums.TradeStatusEnum;
+import com.yonge.toolset.payment.base.model.*;
+import com.yonge.toolset.payment.core.props.PaymentProperties;
+import com.yonge.toolset.payment.core.service.SysConfigPaymentService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class OriginalAliAppTemplate implements PaymentTemplate {
+
+    private final static Logger log = LoggerFactory.getLogger(OriginalAliAppTemplate.class);
+
+    @Autowired
+    private PaymentProperties paymentProperties;
+
+    @Autowired
+    private SysConfigPaymentService configPaymentService;
+
+    @Resource(name = "alipayClientApp")
+    private AlipayClient alipayClientApp;
+
+    @Override
+    public BaseResult<Map<String, Object>> getOpenAuthMsg(OpenAuth openAuth) {
+        return null;
+    }
+
+    @Override
+    public BaseResult<Payment> executePayment(Payment payment) {
+        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
+        request.setNotifyUrl(paymentProperties.getNotifyUrl()
+                + "/" + payment.getOpenType().getCode()
+                + "/" + payment.getPayChannel().getCode()
+                + "/executePayment");
+
+        JSONObject bizContent = new JSONObject();
+        bizContent.put("out_trade_no", payment.getPaymentNo());
+        bizContent.put("total_amount", payment.getPayAmt());
+        bizContent.put("subject", payment.getOrderTitle());
+
+        List<Map<String, Object>> orderDetils = new ArrayList<>();
+        for (OrderDetil orderDetil : payment.getOrderDetils()) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("goods_id", orderDetil.getGoodsId());
+            map.put("goods_name", orderDetil.getGoodName());
+            map.put("quantity", orderDetil.getQuantity());
+            map.put("price", orderDetil.getPrice());
+            orderDetils.add(map);
+        }
+        bizContent.put("goods_detail", orderDetils);
+        bizContent.put("merchant_order_no", payment.getOrderNo());
+        request.setBizContent(bizContent.toString());
+        try {
+            AlipayTradeAppPayResponse response = alipayClientApp.sdkExecute(request);
+            if (response.isSuccess()) {
+                payment.setId(response.getTradeNo());
+                payment.setStatus(TradeStatusEnum.pending);
+                return BaseResult.succeed(payment);
+            } else {
+                return BaseResult.failed(response.getMsg());
+            }
+        } catch (AlipayApiException e) {
+            log.error("调用支付宝App支付接口失败,err_code={} err_msg={}", e.getErrCode(), e.getErrMsg());
+            return BaseResult.failed("交易失败");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return BaseResult.failed("交易失败");
+        }
+    }
+
+    @Override
+    public BaseResult<Payment> queryPayment(Payment payment) {
+        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
+
+        JSONObject bizContent = new JSONObject();
+        bizContent.put("out_trade_no", payment.getId());
+        request.setBizContent(bizContent.toString());
+        try {
+            AlipayTradeQueryResponse response = alipayClientApp.execute(request);
+
+            if (response.isSuccess()) {
+                payment.setPayAmt(response.getPayAmount());
+                //获取交易状态
+                String tradeStatus = response.getTradeStatus();
+                if("WAIT_BUYER_PAY".equals(tradeStatus)){
+                    payment.setStatus(TradeStatusEnum.pending);
+                }else if("TRADE_CLOSED".equals(tradeStatus)){
+                    payment.setStatus(TradeStatusEnum.succeeded);
+                }else if("TRADE_SUCCESS".equals(tradeStatus)){
+                    payment.setStatus(TradeStatusEnum.succeeded);
+                }else if("TRADE_FINISHED".equals(tradeStatus)){
+                    payment.setStatus(TradeStatusEnum.succeeded);
+                }
+                return BaseResult.succeed(payment);
+            } else {
+                return BaseResult.failed(response.getMsg());
+            }
+        } catch (AlipayApiException e) {
+            log.error("调用支付宝APP查询订单接口失败,err_code={} err_msg={}", e.getErrCode(), e.getErrMsg());
+            return BaseResult.failed("查询失败");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return BaseResult.failed("查询失败");
+        }
+    }
+
+    @Override
+    public BaseResult<ClosePayment> closePayment(ClosePayment closePayment) {
+        return null;
+    }
+
+    @Override
+    public BaseResult<RefundBill> refundPayment(RefundBill refundBill) {
+        return null;
+    }
+}

+ 45 - 0
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/ali/config/AlipayConfiguration.java

@@ -0,0 +1,45 @@
+package com.yonge.toolset.payment.original.ali.config;
+
+import com.alipay.api.AlipayClient;
+import com.alipay.api.DefaultAlipayClient;
+import com.huifu.adapay.Adapay;
+import com.huifu.adapay.model.MerConfig;
+import com.yonge.toolset.payment.adapay.constant.AdapayConstant;
+import com.yonge.toolset.payment.base.enums.OpenEnum;
+import com.yonge.toolset.payment.core.service.SysConfigPaymentService;
+import com.yonge.toolset.payment.original.ali.constant.AlipayConstant;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022/5/12 10:12
+ */
+@Configuration
+public class AlipayConfiguration {
+    @Autowired
+    private SysConfigPaymentService configPaymentService;
+
+    /***
+     * 支付宝APP支付Bean
+     * @author liweifan
+     * @updateTime 2022/5/12 14:16
+     * @return: com.alipay.api.AlipayClient
+     */
+    @Bean(name = "alipayClientApp")
+    public AlipayClient alipayClientApp() {
+        AlipayClient alipayClient = new DefaultAlipayClient(
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_URL).getParamValue(),
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_APP_APPID).getParamValue(),
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_APP_APP_PRIVATE_KEY).getParamValue(),
+                "json", "UTF-8",
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_APP_ALIPAY_PUBLIC_KEY).getParamValue(),
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_APP_SIGN_TYPE).getParamValue(),
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_APP_CONTENT_SIGN_KEY).getParamValue(),
+                configPaymentService.getPaymentConfig(OpenEnum.ORIGINAL, AlipayConstant.ALI_APP_CONTENT_SIGN_TYPE).getParamValue()
+        );
+        return alipayClient;
+    }
+
+}

+ 52 - 0
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/ali/constant/AlipayConstant.java

@@ -0,0 +1,52 @@
+package com.yonge.toolset.payment.original.ali.constant;
+
+/**
+ *
+ * @Author: liweifan
+ * @Data: 2022/5/11 16:21
+ */
+public interface AlipayConstant {
+    /***
+     * 支付宝-支付网关
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_URL = "ALI_URL";
+    /***
+     * 支付宝-APP支付-应用ID
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_APP_APPID = "ALI_APP_APPID";
+    /***
+     * 支付宝-APP支付-应用私钥
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_APP_APP_PRIVATE_KEY = "ALI_APP_APP_PRIVATE_KEY";
+    /***
+     * 支付宝-APP支付-应用公钥
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_APP_ALIPAY_PUBLIC_KEY = "ALI_APP_ALIPAY_PUBLIC_KEY";
+    /***
+     * 支付宝-APP支付-验签方式
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_APP_SIGN_TYPE = "ALI_APP_SIGN_TYPE";
+    /***
+     * 支付宝-APP支付-接口内容加密密钥
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_APP_CONTENT_SIGN_KEY = "ALI_APP_CONTENT_SIGN_KEY";
+    /***
+     * 支付宝-APP支付-接口内容加密方式
+     * @author liweifan
+     * @updateTime 2022/5/12 14:12
+     */
+    String ALI_APP_CONTENT_SIGN_TYPE = "ALI_APP_CONTENT_SIGN_TYPE";
+
+}

+ 49 - 0
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/original/wx/OriginalWxAppTemplate.java

@@ -0,0 +1,49 @@
+package com.yonge.toolset.payment.original.wx;
+
+import com.yonge.toolset.base.result.BaseResult;
+import com.yonge.toolset.payment.base.PaymentTemplate;
+import com.yonge.toolset.payment.base.model.ClosePayment;
+import com.yonge.toolset.payment.base.model.OpenAuth;
+import com.yonge.toolset.payment.base.model.Payment;
+import com.yonge.toolset.payment.base.model.RefundBill;
+import com.yonge.toolset.payment.core.service.SysConfigPaymentService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public class OriginalWxAppTemplate implements PaymentTemplate {
+
+    private final static Logger log = LoggerFactory.getLogger(OriginalWxAppTemplate.class);
+
+    @Autowired
+    private SysConfigPaymentService configPaymentService;
+
+    @Override
+    public BaseResult<Map<String, Object>> getOpenAuthMsg(OpenAuth openAuth) {
+        return null;
+    }
+
+    @Override
+    public BaseResult<Payment> executePayment(Payment payment){
+        return null;
+    }
+
+    @Override
+    public BaseResult<Payment> queryPayment(Payment payment) {
+        return null;
+    }
+
+    @Override
+    public BaseResult<ClosePayment> closePayment(ClosePayment closePayment) {
+        return null;
+    }
+
+    @Override
+    public BaseResult<RefundBill> refundPayment(RefundBill refundBill)  {
+        return null;
+    }
+}