Explorar o código

删除无用代码

Seven hai 6 meses
pai
achega
2bf840be24
Modificáronse 72 ficheiros con 3375 adicións e 7844 borrados
  1. 5 25
      pay/pom.xml
  2. 2657 0
      pay/src/main/java/pay/platform/alipay/enums/AliPayApi.java
  3. 385 0
      pay/src/main/java/pay/platform/alipay/enums/AliPayApiConfig.java
  4. 120 0
      pay/src/main/java/pay/platform/alipay/enums/AliPayApiConfigKit.java
  5. 131 0
      pay/src/main/java/pay/platform/alipay/enums/AliPayCore.java
  6. 29 0
      pay/src/main/java/pay/platform/alipay/enums/SignType.java
  7. 0 279
      pay/src/main/java/pay/platform/common/sign/Base64.java
  8. 0 48
      pay/src/main/java/pay/platform/common/sign/MD5.java
  9. 0 147
      pay/src/main/java/pay/platform/common/sign/RSA.java
  10. 0 175
      pay/src/main/java/pay/platform/common/utils/ConnUtil.java
  11. 0 50
      pay/src/main/java/pay/platform/common/utils/JsonUtil.java
  12. 0 289
      pay/src/main/java/pay/platform/common/utils/ThlwsBeanUtil.java
  13. 0 142
      pay/src/main/java/pay/platform/common/utils/ZxingUtil.java
  14. 0 133
      pay/src/main/java/pay/platform/payment/alipay/AlipayClient.java
  15. 0 591
      pay/src/main/java/pay/platform/payment/alipay/core/AlipayCore.java
  16. 0 70
      pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayMobileSiteRequest.java
  17. 0 83
      pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayQrcodeRequest.java
  18. 0 57
      pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayRefundRequest.java
  19. 0 91
      pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayTradeRequest.java
  20. 0 70
      pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayWebSiteRequest.java
  21. 0 32
      pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayCancelResponse.java
  22. 0 44
      pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayNotifyResponse.java
  23. 0 37
      pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayQrcodeResponse.java
  24. 0 34
      pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayQueryResponse.java
  25. 0 33
      pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayRefundResponse.java
  26. 0 35
      pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayTradeResponse.java
  27. 0 66
      pay/src/main/java/pay/platform/payment/alipay/trade/config/Constants.java
  28. 0 42
      pay/src/main/java/pay/platform/payment/alipay/trade/model/ExtendParams.java
  29. 0 222
      pay/src/main/java/pay/platform/payment/alipay/trade/model/GoodsDetail.java
  30. 0 20
      pay/src/main/java/pay/platform/payment/alipay/trade/model/TradeStatus.java
  31. 0 564
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayHeartbeatSynRequestBuilder.java
  32. 0 82
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradeCancelRequestBuilder.java
  33. 0 518
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradePayRequestBuilder.java
  34. 0 450
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradePrecreateRequestBuilder.java
  35. 0 108
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradeQueryRequestBuilder.java
  36. 0 264
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradeRefundRequestBuilder.java
  37. 0 84
      pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/RequestBuilder.java
  38. 0 42
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/EquipStatus.java
  39. 0 19
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/EquipStatusAdapter.java
  40. 0 20
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/ExceptionInfo.java
  41. 0 27
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/ExceptionInfoAdapter.java
  42. 0 40
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/HbStatus.java
  43. 0 88
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/PosTradeInfo.java
  44. 0 15
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/Product.java
  45. 0 88
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/SysTradeInfo.java
  46. 0 20
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/TradeInfo.java
  47. 0 32
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/TradeInfoAdapter.java
  48. 0 35
      pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/Type.java
  49. 0 66
      pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FCancelResult.java
  50. 0 65
      pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FPayResult.java
  51. 0 65
      pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FPrecreateResult.java
  52. 0 65
      pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FQueryResult.java
  53. 0 65
      pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FRefundResult.java
  54. 0 15
      pay/src/main/java/pay/platform/payment/alipay/trade/model/result/Result.java
  55. 0 21
      pay/src/main/java/pay/platform/payment/alipay/trade/service/AlipayMonitorService.java
  56. 0 53
      pay/src/main/java/pay/platform/payment/alipay/trade/service/AlipayTradeService.java
  57. 0 58
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AbsAlipayService.java
  58. 0 420
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AbsAlipayTradeService.java
  59. 0 192
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AlipayMonitorServiceImpl.java
  60. 0 232
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AlipayTradeServiceImpl.java
  61. 0 377
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AlipayTradeWithHBServiceImpl.java
  62. 0 129
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/AbsHbRunner.java
  63. 0 56
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/HbListener.java
  64. 0 65
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/HbQueue.java
  65. 0 61
      pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/TradeListener.java
  66. 0 40
      pay/src/main/java/pay/platform/payment/alipay/trade/utils/GsonFactory.java
  67. 0 98
      pay/src/main/java/pay/platform/payment/alipay/trade/utils/Utils.java
  68. 0 98
      pay/src/main/java/pay/platform/payment/alipay/trade/utils/ZxingUtils.java
  69. 0 168
      pay/src/main/java/pay/platform/payment/alipay/utils/AlipayUtil.java
  70. 0 67
      pay/src/main/java/pay/platform/payment/alipay/utils/VerifyUtil.java
  71. 47 56
      pay/src/test/java/pay/platform/AlipayTest.java
  72. 1 1
      web/admin-api/pom.xml

+ 5 - 25
pay/pom.xml

@@ -37,43 +37,23 @@
             <scope>provided</scope>
         </dependency>
 
-        <dependency>
-            <groupId>jakarta.xml.bind</groupId>
-            <artifactId>jakarta.xml.bind-api</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-
         <dependency>
             <groupId>com.alipay.sdk</groupId>
             <artifactId>alipay-sdk-java</artifactId>
             <version>${alipay.sdk.version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-            <version>5.8.26</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>com.google.zxing</groupId>
             <artifactId>core</artifactId>
             <version>3.5.1</version>
         </dependency>
+
         <dependency>
-            <groupId>com.google.zxing</groupId>
-            <artifactId>javase</artifactId>
-            <version>3.5.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.27</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>

+ 2657 - 0
pay/src/main/java/pay/platform/alipay/enums/AliPayApi.java

@@ -0,0 +1,2657 @@
+package pay.platform.alipay.enums;
+
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.*;
+import com.alipay.api.domain.*;
+import com.alipay.api.internal.util.StringUtils;
+import com.alipay.api.request.*;
+import com.alipay.api.response.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * <p>
+ * IJPay 让支付触手可及,封装了微信支付、支付宝支付、银联支付常用的支付方式以及各种常用的接口。
+ * </p>
+ *
+ * <p>
+ * 不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。
+ * </p>
+ *
+ * <p>
+ * IJPay 交流群: 723992875、864988890
+ * </p>
+ *
+ * <p>
+ * Node.js 版: https://gitee.com/javen205/TNWX
+ * </p>
+ *
+ * <p>
+ * 支付宝支付相关接口
+ * </p>
+ *
+ * @author Javen
+ */
+public class AliPayApi {
+
+    /**
+     * 支付宝提供给商户的服务接入网关URL(新)
+     */
+    private static final String GATEWAY_NEW = "https://mapi.alipay.com/gateway.do?";
+
+    public static <T extends AlipayResponse> T doExecute(AlipayRequest<T> request) throws AlipayApiException {
+        if (AliPayApiConfigKit.getAliPayApiConfig().isCertModel()) {
+            return certificateExecute(request);
+        } else {
+            return execute(request);
+        }
+    }
+
+    public static <T extends AlipayResponse> T doExecute(AlipayClient alipayClient, Boolean certModel, AlipayRequest<T> request) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        if (certModel) {
+            return certificateExecute(alipayClient, request);
+        } else {
+            return execute(alipayClient, request);
+        }
+    }
+
+
+    public static <T extends AlipayResponse> T doExecute(AlipayClient alipayClient, Boolean certModel, AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        if (certModel) {
+            return certificateExecute(alipayClient, request, authToken);
+        } else {
+            return execute(alipayClient, request, authToken);
+        }
+    }
+
+
+    public static <T extends AlipayResponse> T doExecute(AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        if (AliPayApiConfigKit.getAliPayApiConfig().isCertModel()) {
+            return certificateExecute(request, authToken);
+        } else {
+            return execute(request, authToken);
+        }
+    }
+
+
+    public static <T extends AlipayResponse> T doExecute(AlipayClient alipayClient, AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        if (AliPayApiConfigKit.getAliPayApiConfig().isCertModel()) {
+            return certificateExecute(alipayClient, request, authToken);
+        } else {
+            return execute(alipayClient, request, authToken);
+        }
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayRequest<T> request) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().execute(request);
+    }
+
+
+    public static <T extends AlipayResponse> T execute(AlipayClient alipayClient, AlipayRequest<T> request) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.execute(request);
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().execute(request, authToken);
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayClient alipayClient, AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.execute(request, authToken);
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().execute(request, accessToken, appAuthToken);
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayClient alipayClient, AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.execute(request, accessToken, appAuthToken);
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayRequest<T> request, String accessToken, String appAuthToken, String targetAppId) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().execute(request, accessToken, appAuthToken, targetAppId);
+    }
+
+    public static <T extends AlipayResponse> T execute(AlipayClient alipayClient, AlipayRequest<T> request, String accessToken, String appAuthToken, String targetAppId) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.execute(request, accessToken, appAuthToken, targetAppId);
+    }
+
+    public static <T extends AlipayResponse> T pageExecute(AlipayRequest<T> request) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().pageExecute(request);
+    }
+
+    public static <T extends AlipayResponse> T pageExecute(AlipayClient alipayClient, AlipayRequest<T> request) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.pageExecute(request);
+    }
+
+    public static <T extends AlipayResponse> T pageExecute(AlipayRequest<T> request, String method) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().pageExecute(request, method);
+    }
+
+    public static <T extends AlipayResponse> T pageExecute(AlipayClient alipayClient, AlipayRequest<T> request, String method) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.pageExecute(request, method);
+    }
+
+    public static <T extends AlipayResponse> T sdkExecute(AlipayRequest<T> request) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().sdkExecute(request);
+    }
+
+    public static <T extends AlipayResponse> T sdkExecute(AlipayClient alipayClient, AlipayRequest<T> request) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.sdkExecute(request);
+    }
+
+    public static BatchAlipayResponse execute(BatchAlipayRequest request) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().execute(request);
+    }
+
+    public static BatchAlipayResponse execute(AlipayClient alipayClient, BatchAlipayRequest request) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.execute(request);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayRequest<T> request) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().certificateExecute(request);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayClient alipayClient, AlipayRequest<T> request) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.certificateExecute(request);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().certificateExecute(request, authToken);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayClient alipayClient, AlipayRequest<T> request, String authToken) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.certificateExecute(request, authToken);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().certificateExecute(request, accessToken, appAuthToken);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayClient alipayClient, AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.certificateExecute(request, accessToken, appAuthToken);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayRequest<T> request, String accessToken, String appAuthToken, String targetAppId) throws AlipayApiException {
+        return AliPayApiConfigKit.getAliPayApiConfig().getAliPayClient().certificateExecute(request, accessToken, appAuthToken, targetAppId);
+    }
+
+    public static <T extends AlipayResponse> T certificateExecute(AlipayClient alipayClient, AlipayRequest<T> request, String accessToken, String appAuthToken, String targetAppId) throws AlipayApiException {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient.certificateExecute(request, accessToken, appAuthToken, targetAppId);
+    }
+
+    /**
+     * APP支付
+     *
+     * @param model     {@link AlipayTradeAppPayModel}
+     * @param notifyUrl 异步通知 URL
+     * @return {@link AlipayTradeAppPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeAppPayResponse appPayToResponse(AlipayTradeAppPayModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return sdkExecute(request);
+    }
+
+
+    /**
+     * APP支付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeAppPayModel}
+     * @param notifyUrl    异步通知 URL
+     * @return {@link AlipayTradeAppPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeAppPayResponse appPayToResponse(AlipayClient alipayClient, AlipayTradeAppPayModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return sdkExecute(alipayClient, request);
+    }
+
+    /**
+     * APP支付
+     *
+     * @param model        {@link AlipayTradeAppPayModel}
+     * @param notifyUrl    异步通知 URL
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeAppPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeAppPayResponse appPayToResponse(AlipayTradeAppPayModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        return sdkExecute(request);
+    }
+
+
+    /**
+     * APP支付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeAppPayModel}
+     * @param notifyUrl    异步通知 URL
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeAppPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeAppPayResponse appPayToResponse(AlipayClient alipayClient, AlipayTradeAppPayModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        return sdkExecute(alipayClient, request);
+    }
+
+    /**
+     * WAP支付
+     *
+     * @param response  {@link HttpServletResponse}
+     * @param model     {@link AlipayTradeWapPayModel}
+     * @param returnUrl 同步通知URL
+     * @param notifyUrl 异步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPay(HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl) throws AlipayApiException, IOException {
+        String form = wapPayStr(model, returnUrl, notifyUrl);
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+
+    /**
+     * WAP支付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPay(AlipayClient alipayClient, HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl) throws AlipayApiException, IOException {
+        String form = wapPayStr(alipayClient, model, returnUrl, notifyUrl);
+        response.setContentType("text/html;charset=UTF-8");
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+
+    /**
+     * WAP支付
+     *
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPay(HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl, String appAuthToken) throws AlipayApiException, IOException {
+        String form = wapPayStr(model, returnUrl, notifyUrl, appAuthToken);
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+
+    /**
+     * WAP支付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPay(AlipayClient alipayClient, HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl, String appAuthToken) throws AlipayApiException, IOException {
+        String form = wapPayStr(alipayClient, model, returnUrl, notifyUrl, appAuthToken);
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * <p>
+     * WAP支付
+     * </p>
+     *
+     * <p>
+     * 为了解决 Filter 中使用 OutputStream getOutputStream() 和 PrintWriter getWriter() 冲突异常问题
+     * </p>
+     *
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPayByOutputStream(HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl, String appAuthToken) throws AlipayApiException, IOException {
+        String form = wapPayStr(model, returnUrl, notifyUrl, appAuthToken);
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(AliPayApiConfigKit.getAliPayApiConfig().getCharset()));
+        response.getOutputStream().flush();
+    }
+
+
+    /**
+     * <p>
+     * WAP支付
+     * </p>
+     *
+     * <p>
+     * 为了解决 Filter 中使用 OutputStream getOutputStream() 和 PrintWriter getWriter() 冲突异常问题
+     * </p>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPayByOutputStream(AlipayClient alipayClient, HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl, String appAuthToken) throws AlipayApiException, IOException {
+        String form = wapPayStr(alipayClient, model, returnUrl, notifyUrl, appAuthToken);
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(charset));
+        response.getOutputStream().flush();
+    }
+
+    /**
+     * <p>
+     * WAP支付
+     * </p>
+     *
+     * <p>
+     * 为了解决 Filter 中使用 OutputStream getOutputStream() 和 PrintWriter getWriter() 冲突异常问题
+     * </p>
+     *
+     * @param response  {@link HttpServletResponse}
+     * @param model     {@link AlipayTradeWapPayModel}
+     * @param returnUrl 异步通知URL
+     * @param notifyUrl 同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPayByOutputStream(HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl) throws AlipayApiException, IOException {
+        String form = wapPayStr(model, returnUrl, notifyUrl);
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(AliPayApiConfigKit.getAliPayApiConfig().getCharset()));
+        response.getOutputStream().flush();
+    }
+
+
+    /**
+     * <p>
+     * WAP支付
+     * </p>
+     *
+     * <p>
+     * 为了解决 Filter 中使用 OutputStream getOutputStream() 和 PrintWriter getWriter() 冲突异常问题
+     * </p>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void wapPayByOutputStream(AlipayClient alipayClient, HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl) throws AlipayApiException, IOException {
+        String form = wapPayStr(alipayClient, model, returnUrl, notifyUrl);
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(charset));
+        response.getOutputStream().flush();
+    }
+
+    /**
+     * WAP支付
+     *
+     * @param model     {@link AlipayTradeWapPayModel}
+     * @param returnUrl 异步通知URL
+     * @param notifyUrl 同步通知URL
+     * @return {String}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static String wapPayStr(AlipayTradeWapPayModel model, String returnUrl, String notifyUrl) throws AlipayApiException {
+        AlipayTradeWapPayRequest aliPayRequest = new AlipayTradeWapPayRequest();
+        aliPayRequest.setReturnUrl(returnUrl);
+        aliPayRequest.setNotifyUrl(notifyUrl);
+        aliPayRequest.setBizModel(model);
+        return pageExecute(aliPayRequest).getBody();
+    }
+
+    /**
+     * WAP支付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @return {String}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static String wapPayStr(AlipayClient alipayClient, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl) throws AlipayApiException {
+        AlipayTradeWapPayRequest aliPayRequest = new AlipayTradeWapPayRequest();
+        aliPayRequest.setReturnUrl(returnUrl);
+        aliPayRequest.setNotifyUrl(notifyUrl);
+        aliPayRequest.setBizModel(model);
+        return pageExecute(alipayClient, aliPayRequest).getBody();
+    }
+
+    /**
+     * WAP支付
+     *
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {String}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static String wapPayStr(AlipayTradeWapPayModel model, String returnUrl, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradeWapPayRequest aliPayRequest = new AlipayTradeWapPayRequest();
+        aliPayRequest.setReturnUrl(returnUrl);
+        aliPayRequest.setNotifyUrl(notifyUrl);
+        aliPayRequest.setBizModel(model);
+        aliPayRequest.putOtherTextParam("app_auth_token", appAuthToken);
+        return pageExecute(aliPayRequest).getBody();
+    }
+
+    /**
+     * WAP支付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeWapPayModel}
+     * @param returnUrl    异步通知URL
+     * @param notifyUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {String}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static String wapPayStr(AlipayClient alipayClient, AlipayTradeWapPayModel model, String returnUrl, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradeWapPayRequest aliPayRequest = new AlipayTradeWapPayRequest();
+        aliPayRequest.setReturnUrl(returnUrl);
+        aliPayRequest.setNotifyUrl(notifyUrl);
+        aliPayRequest.setBizModel(model);
+        aliPayRequest.putOtherTextParam("app_auth_token", appAuthToken);
+        return pageExecute(alipayClient, aliPayRequest).getBody();
+    }
+
+    /**
+     * 统一收单交易支付接口接口 <br>
+     * 适用于:条形码支付、声波支付等 <br>
+     *
+     * @param model     {@link AlipayTradePayModel}
+     * @param notifyUrl 异步通知URL
+     * @return {@link AlipayTradePayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePayResponse tradePayToResponse(AlipayTradePayModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradePayRequest request = new AlipayTradePayRequest();
+        // 填充业务参数
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易支付接口接口 <br>
+     * 适用于:条形码支付、声波支付等 <br>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradePayModel}
+     * @param notifyUrl    异步通知URL
+     * @return {@link AlipayTradePayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePayResponse tradePayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradePayModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradePayRequest request = new AlipayTradePayRequest();
+        // 填充业务参数
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易支付接口接口 <br>
+     * 适用于:条形码支付、声波支付等 <br>
+     *
+     * @param model        {AlipayTradePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {AlipayTradePayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePayResponse tradePayToResponse(AlipayTradePayModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradePayRequest request = new AlipayTradePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易支付接口接口 <br>
+     * 适用于:条形码支付、声波支付等 <br>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {AlipayTradePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {AlipayTradePayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePayResponse tradePayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradePayModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradePayRequest request = new AlipayTradePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 统一收单线下交易预创建 <br>
+     * 适用于:扫码支付等 <br>
+     *
+     * @param model     {@link AlipayTradePrecreateModel}
+     * @param notifyUrl 异步通知URL
+     * @return {@link AlipayTradePrecreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePrecreateResponse tradePrecreatePayToResponse(AlipayTradePrecreateModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(request);
+    }
+
+
+    /**
+     * 统一收单线下交易预创建 <br>
+     * 适用于:扫码支付等 <br>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradePrecreateModel}
+     * @param notifyUrl    异步通知URL
+     * @return {@link AlipayTradePrecreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePrecreateResponse tradePrecreatePayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradePrecreateModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 统一收单线下交易预创建 <br>
+     * 适用于:扫码支付等 <br>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradePrecreateModel}
+     * @param notifyUrl    异步通知URL
+     * @return {@link AlipayTradePrecreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePrecreateResponse tradePrecreatePayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradePrecreateModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(alipayClient, certModel, request, appAuthToken);
+    }
+
+    /**
+     * 统一收单线下交易预创建 <br>
+     * 适用于:扫码支付等 <br>
+     *
+     * @param model        {@link AlipayTradePrecreateModel}
+     * @param notifyUrl    异步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradePrecreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePrecreateResponse tradePrecreatePayToResponse(AlipayTradePrecreateModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单线下交易预创建 <br>
+     * 适用于:扫码支付等 <br>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradePrecreateModel}
+     * @param notifyUrl    异步通知URL
+     * @return {@link AlipayTradePrecreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePrecreateResponse tradePrecreatePayToResponse(AlipayClient alipayClient, AlipayTradePrecreateModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return execute(alipayClient, request, null, null);
+    }
+
+    /**
+     * 统一收单线下交易预创建 <br>
+     * 适用于:扫码支付等 <br>
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradePrecreateModel}
+     * @param notifyUrl    异步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradePrecreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePrecreateResponse tradePrecreatePayToResponse(AlipayClient alipayClient, AlipayTradePrecreateModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 单笔转账到支付宝账户
+     *
+     * @param model {@link AlipayFundTransToaccountTransferModel}
+     * @return 转账是否成功
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    @Deprecated
+    public static boolean transfer(AlipayFundTransToaccountTransferModel model) throws AlipayApiException {
+        AlipayFundTransToaccountTransferResponse response = transferToResponse(model);
+        String result = response.getBody();
+        if (response.isSuccess()) {
+            return true;
+        } else {
+            // 调用查询接口查询数据
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            String outBizNo = jsonObject.getJSONObject("alipay_fund_trans_toaccount_transfer_response").getString("out_biz_no");
+            AlipayFundTransOrderQueryModel queryModel = new AlipayFundTransOrderQueryModel();
+            model.setOutBizNo(outBizNo);
+            return transferQuery(queryModel);
+        }
+    }
+
+
+    /**
+     * 单笔转账到支付宝账户
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundTransToaccountTransferModel}
+     * @return 转账是否成功
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    @Deprecated
+    public static boolean transfer(AlipayClient alipayClient, Boolean certModel, AlipayFundTransToaccountTransferModel model) throws AlipayApiException {
+        AlipayFundTransToaccountTransferResponse response = transferToResponse(model);
+        String result = response.getBody();
+        if (response.isSuccess()) {
+            return true;
+        } else {
+            // 调用查询接口查询数据
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            String outBizNo = jsonObject.getJSONObject("alipay_fund_trans_toaccount_transfer_response").getString("out_biz_no");
+            AlipayFundTransOrderQueryModel queryModel = new AlipayFundTransOrderQueryModel();
+            model.setOutBizNo(outBizNo);
+            return transferQuery(alipayClient, certModel, queryModel);
+        }
+    }
+
+    /**
+     * 单笔转账到支付宝账户
+     *
+     * @param model {@link AlipayFundTransToaccountTransferModel}
+     * @return {@link AlipayFundTransToaccountTransferResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransToaccountTransferResponse transferToResponse(AlipayFundTransToaccountTransferModel model) throws AlipayApiException {
+        AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+
+    /**
+     * 单笔转账到支付宝账户
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundTransToaccountTransferModel}
+     * @return {@link AlipayFundTransToaccountTransferResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransToaccountTransferResponse transferToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundTransToaccountTransferModel model) throws AlipayApiException {
+        AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 转账查询接口
+     *
+     * @param model {@link AlipayFundTransOrderQueryModel}
+     * @return 是否存在此
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    @Deprecated
+    public static boolean transferQuery(AlipayFundTransOrderQueryModel model) throws AlipayApiException {
+        AlipayFundTransOrderQueryResponse response = transferQueryToResponse(model);
+        return response.isSuccess();
+    }
+
+    /**
+     * 转账查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundTransOrderQueryModel}
+     * @return 是否存在此
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    @Deprecated
+    public static boolean transferQuery(AlipayClient alipayClient, Boolean certModel, AlipayFundTransOrderQueryModel model) throws AlipayApiException {
+        AlipayFundTransOrderQueryResponse response = transferQueryToResponse(alipayClient, certModel, model);
+        return response.isSuccess();
+    }
+
+    /**
+     * 转账查询接口
+     *
+     * @param model {@link AlipayFundTransOrderQueryModel}
+     * @return {@link AlipayFundTransOrderQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransOrderQueryResponse transferQueryToResponse(AlipayFundTransOrderQueryModel model) throws AlipayApiException {
+        AlipayFundTransOrderQueryRequest request = new AlipayFundTransOrderQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 转账查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundTransOrderQueryModel}
+     * @return {@link AlipayFundTransOrderQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransOrderQueryResponse transferQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundTransOrderQueryModel model) throws AlipayApiException {
+        AlipayFundTransOrderQueryRequest request = new AlipayFundTransOrderQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一转账接口
+     *
+     * @param model        model {@link AlipayFundTransUniTransferModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayFundTransUniTransferResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransUniTransferResponse uniTransferToResponse(AlipayFundTransUniTransferModel model, String appAuthToken) throws AlipayApiException {
+        AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
+        request.setBizModel(model);
+        if (!StringUtils.isEmpty(appAuthToken)) {
+            request.putOtherTextParam("app_auth_token", appAuthToken);
+        }
+        return doExecute(request);
+    }
+
+    /**
+     * 统一转账接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        model {@link AlipayFundTransUniTransferModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayFundTransUniTransferResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransUniTransferResponse uniTransferToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundTransUniTransferModel model, String appAuthToken) throws AlipayApiException {
+        AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
+        request.setBizModel(model);
+        if (!StringUtils.isEmpty(appAuthToken)) {
+            request.putOtherTextParam("app_auth_token", appAuthToken);
+        }
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 转账业务单据查询接口
+     *
+     * @param model        model {@link AlipayFundTransCommonQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayFundTransCommonQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransCommonQueryResponse transCommonQueryToResponse(AlipayFundTransCommonQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayFundTransCommonQueryRequest request = new AlipayFundTransCommonQueryRequest();
+        request.setBizModel(model);
+        if (!StringUtils.isEmpty(appAuthToken)) {
+            request.putOtherTextParam("app_auth_token", appAuthToken);
+        }
+        return doExecute(request);
+    }
+
+    /**
+     * 转账业务单据查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        model {@link AlipayFundTransCommonQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayFundTransCommonQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundTransCommonQueryResponse transCommonQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundTransCommonQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayFundTransCommonQueryRequest request = new AlipayFundTransCommonQueryRequest();
+        request.setBizModel(model);
+        if (!StringUtils.isEmpty(appAuthToken)) {
+            request.putOtherTextParam("app_auth_token", appAuthToken);
+        }
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 支付宝资金账户资产查询接口
+     *
+     * @param model        model {@link AlipayFundAccountQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayFundAccountQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAccountQueryResponse accountQueryToResponse(AlipayFundAccountQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayFundAccountQueryRequest request = new AlipayFundAccountQueryRequest();
+        request.setBizModel(model);
+        if (!StringUtils.isEmpty(appAuthToken)) {
+            request.putOtherTextParam("app_auth_token", appAuthToken);
+        }
+        return doExecute(request);
+    }
+
+
+    /**
+     * 支付宝资金账户资产查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        model {@link AlipayFundAccountQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayFundAccountQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAccountQueryResponse accountQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundAccountQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayFundAccountQueryRequest request = new AlipayFundAccountQueryRequest();
+        request.setBizModel(model);
+        if (!StringUtils.isEmpty(appAuthToken)) {
+            request.putOtherTextParam("app_auth_token", appAuthToken);
+        }
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单线下交易查询接口
+     *
+     * @param model {@link AlipayTradeQueryModel}
+     * @return {@link AlipayTradeQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeQueryResponse tradeQueryToResponse(AlipayTradeQueryModel model) throws AlipayApiException {
+        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单线下交易查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeQueryModel}
+     * @return {@link AlipayTradeQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeQueryResponse tradeQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeQueryModel model) throws AlipayApiException {
+        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单线下交易查询接口
+     *
+     * @param model        {@link AlipayTradeQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeQueryResponse tradeQueryToResponse(AlipayTradeQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单线下交易查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeQueryResponse tradeQueryToResponse(AlipayClient alipayClient, AlipayTradeQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易撤销接口
+     *
+     * @param model        {@link AlipayTradeCancelModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeCancelResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCancelResponse tradeCancelToResponse(AlipayTradeCancelModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeCancelRequest request = new AlipayTradeCancelRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易撤销接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeCancelModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeCancelResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCancelResponse tradeCancelToResponse(AlipayClient alipayClient, AlipayTradeCancelModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeCancelRequest request = new AlipayTradeCancelRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易撤销接口
+     *
+     * @param model {@link AlipayTradeCancelModel}
+     * @return {@link AlipayTradeCancelResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCancelResponse tradeCancelToResponse(AlipayTradeCancelModel model) throws AlipayApiException {
+        AlipayTradeCancelRequest request = new AlipayTradeCancelRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易撤销接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeCancelModel}
+     * @return {@link AlipayTradeCancelResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCancelResponse tradeCancelToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeCancelModel model) throws AlipayApiException {
+        AlipayTradeCancelRequest request = new AlipayTradeCancelRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易关闭接口
+     *
+     * @param model        {@link AlipayTradeCloseModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeCloseResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCloseResponse tradeCloseToResponse(AlipayTradeCloseModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+
+    }
+
+    /**
+     * 统一收单交易关闭接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeCloseModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeCloseResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCloseResponse tradeCloseToResponse(AlipayClient alipayClient, AlipayTradeCloseModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+
+    }
+
+    /**
+     * 统一收单交易关闭接口
+     *
+     * @param model {@link AlipayTradeCloseModel}
+     * @return {@link AlipayTradeCloseResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCloseResponse tradeCloseToResponse(AlipayTradeCloseModel model) throws AlipayApiException {
+        AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易关闭接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeCloseModel}
+     * @return {@link AlipayTradeCloseResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCloseResponse tradeCloseToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeCloseModel model) throws AlipayApiException {
+        AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易创建接口
+     *
+     * @param model     {@link AlipayTradeCreateModel}
+     * @param notifyUrl 异步通知URL
+     * @return {@link AlipayTradeCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCreateResponse tradeCreateToResponse(AlipayTradeCreateModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易创建接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeCreateModel}
+     * @param notifyUrl    异步通知URL
+     * @return {@link AlipayTradeCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCreateResponse tradeCreateToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeCreateModel model, String notifyUrl) throws AlipayApiException {
+        AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易创建接口
+     *
+     * @param model        {@link AlipayTradeCreateModel}
+     * @param notifyUrl    异步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCreateResponse tradeCreateToResponse(AlipayTradeCreateModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易创建接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeCreateModel}
+     * @param notifyUrl    异步通知URL
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeCreateResponse tradeCreateToResponse(AlipayClient alipayClient, AlipayTradeCreateModel model, String notifyUrl, String appAuthToken) throws AlipayApiException {
+        AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易退款接口
+     *
+     * @param model {@link AlipayTradeRefundModel}
+     * @return {@link AlipayTradeRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRefundResponse tradeRefundToResponse(AlipayTradeRefundModel model) throws AlipayApiException {
+        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易退款接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeRefundModel}
+     * @return {@link AlipayTradeRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRefundResponse tradeRefundToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeRefundModel model) throws AlipayApiException {
+        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易退款接口
+     *
+     * @param model        {@link AlipayTradeRefundModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRefundResponse tradeRefundToResponse(AlipayTradeRefundModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易退款接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeRefundModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRefundResponse tradeRefundToResponse(AlipayClient alipayClient, AlipayTradeRefundModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单退款页面接口
+     *
+     * @param model {@link AlipayTradePageRefundModel}
+     * @return {@link AlipayTradePageRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePageRefundResponse tradeRefundToResponse(AlipayTradePageRefundModel model) throws AlipayApiException {
+        AlipayTradePageRefundRequest request = new AlipayTradePageRefundRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单退款页面接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradePageRefundModel}
+     * @return {@link AlipayTradePageRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePageRefundResponse tradeRefundToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradePageRefundModel model) throws AlipayApiException {
+        AlipayTradePageRefundRequest request = new AlipayTradePageRefundRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 统一收单退款页面接口
+     *
+     * @param model        {@link AlipayTradePageRefundModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradePageRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePageRefundResponse tradeRefundToResponse(AlipayTradePageRefundModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradePageRefundRequest request = new AlipayTradePageRefundRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单退款页面接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradePageRefundModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradePageRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradePageRefundResponse tradeRefundToResponse(AlipayClient alipayClient, AlipayTradePageRefundModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradePageRefundRequest request = new AlipayTradePageRefundRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易退款查询
+     *
+     * @param model {@link AlipayTradeFastpayRefundQueryModel}
+     * @return {@link AlipayTradeFastpayRefundQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeFastpayRefundQueryResponse tradeRefundQueryToResponse(AlipayTradeFastpayRefundQueryModel model) throws AlipayApiException {
+        AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易退款查询
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeFastpayRefundQueryModel}
+     * @return {@link AlipayTradeFastpayRefundQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeFastpayRefundQueryResponse tradeRefundQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeFastpayRefundQueryModel model) throws AlipayApiException {
+        AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易退款查询
+     *
+     * @param model        {@link AlipayTradeFastpayRefundQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeFastpayRefundQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeFastpayRefundQueryResponse tradeRefundQueryToResponse(AlipayTradeFastpayRefundQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易退款查询
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeFastpayRefundQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeFastpayRefundQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeFastpayRefundQueryResponse tradeRefundQueryToResponse(AlipayClient alipayClient, AlipayTradeFastpayRefundQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 查询对账单下载地址
+     *
+     * @param model {@link AlipayDataDataserviceBillDownloadurlQueryModel}
+     * @return 对账单下载地址
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static String billDownloadUrlQuery(AlipayDataDataserviceBillDownloadurlQueryModel model) throws AlipayApiException {
+        AlipayDataDataserviceBillDownloadurlQueryResponse response = billDownloadUrlQueryToResponse(model);
+        return response.getBillDownloadUrl();
+    }
+
+    /**
+     * 查询对账单下载地址
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayDataDataserviceBillDownloadurlQueryModel}
+     * @return 对账单下载地址
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static String billDownloadUrlQuery(AlipayClient alipayClient, Boolean certModel, AlipayDataDataserviceBillDownloadurlQueryModel model) throws AlipayApiException {
+        AlipayDataDataserviceBillDownloadurlQueryResponse response = billDownloadUrlQueryToResponse(alipayClient, certModel, model);
+        return response.getBillDownloadUrl();
+    }
+
+    /**
+     * 查询对账单下载地址
+     *
+     * @param model {@link AlipayDataDataserviceBillDownloadurlQueryModel}
+     * @return {@link AlipayDataDataserviceBillDownloadurlQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayDataDataserviceBillDownloadurlQueryResponse billDownloadUrlQueryToResponse(AlipayDataDataserviceBillDownloadurlQueryModel model) throws AlipayApiException {
+        AlipayDataDataserviceBillDownloadurlQueryRequest request = new AlipayDataDataserviceBillDownloadurlQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 查询对账单下载地址
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayDataDataserviceBillDownloadurlQueryModel}
+     * @return {@link AlipayDataDataserviceBillDownloadurlQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayDataDataserviceBillDownloadurlQueryResponse billDownloadUrlQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayDataDataserviceBillDownloadurlQueryModel model) throws AlipayApiException {
+        AlipayDataDataserviceBillDownloadurlQueryRequest request = new AlipayDataDataserviceBillDownloadurlQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 查询对账单下载地址
+     *
+     * @param model        {@link AlipayDataDataserviceBillDownloadurlQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayDataDataserviceBillDownloadurlQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayDataDataserviceBillDownloadurlQueryResponse billDownloadUrlQueryToResponse(AlipayDataDataserviceBillDownloadurlQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayDataDataserviceBillDownloadurlQueryRequest request = new AlipayDataDataserviceBillDownloadurlQueryRequest();
+        request.setBizModel(model);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        return doExecute(request);
+    }
+
+    /**
+     * 查询对账单下载地址
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayDataDataserviceBillDownloadurlQueryModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayDataDataserviceBillDownloadurlQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayDataDataserviceBillDownloadurlQueryResponse billDownloadUrlQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayDataDataserviceBillDownloadurlQueryModel model, String appAuthToken) throws AlipayApiException {
+        AlipayDataDataserviceBillDownloadurlQueryRequest request = new AlipayDataDataserviceBillDownloadurlQueryRequest();
+        request.setBizModel(model);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 统一收单交易结算接口
+     *
+     * @param model        {@link AlipayTradeOrderSettleModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeOrderSettleResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeOrderSettleResponse tradeOrderSettleToResponse(AlipayTradeOrderSettleModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest();
+        request.setBizModel(model);
+        return execute(request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易结算接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param model        {@link AlipayTradeOrderSettleModel}
+     * @param appAuthToken 应用授权token
+     * @return {@link AlipayTradeOrderSettleResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeOrderSettleResponse tradeOrderSettleToResponse(AlipayClient alipayClient, AlipayTradeOrderSettleModel model, String appAuthToken) throws AlipayApiException {
+        AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest();
+        request.setBizModel(model);
+        return execute(alipayClient, request, null, appAuthToken);
+    }
+
+    /**
+     * 统一收单交易结算接口
+     *
+     * @param model {@link AlipayTradeOrderSettleModel}
+     * @return {@link AlipayTradeOrderSettleResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeOrderSettleResponse tradeOrderSettleToResponse(AlipayTradeOrderSettleModel model) throws AlipayApiException {
+        AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 统一收单交易结算接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeOrderSettleModel}
+     * @return {@link AlipayTradeOrderSettleResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeOrderSettleResponse tradeOrderSettleToResponse(AlipayClient alipayClient, Boolean certModel, AlipayTradeOrderSettleModel model) throws AlipayApiException {
+        AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param response  {@link HttpServletResponse}
+     * @param model     {@link AlipayTradePagePayModel}
+     * @param notifyUrl 异步通知URL
+     * @param returnUrl 同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePage(HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        String form = pageExecute(request).getBody();
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param response  {@link HttpServletResponse}
+     * @param method    GET/POST GET 返回url,POST 返回 FORM <a href="https://opensupport.alipay.com/support/helpcenter/192/201602488772?ant_source=antsupport">参考文章</a>
+     * @param model     {@link AlipayTradePagePayModel}
+     * @param notifyUrl 异步通知URL
+     * @param returnUrl 同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePage(HttpServletResponse response, String method, AlipayTradePagePayModel model, String notifyUrl, String returnUrl) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        String form = pageExecute(request, method).getBody();
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePage(AlipayClient alipayClient, HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        String form = pageExecute(alipayClient, request).getBody();
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param method       GET/POST GET 返回url,POST 返回 FORM <a href="https://opensupport.alipay.com/support/helpcenter/192/201602488772?ant_source=antsupport">参考文章</a>
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePage(AlipayClient alipayClient, HttpServletResponse response, String method, AlipayTradePagePayModel model, String notifyUrl, String returnUrl) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        String form = pageExecute(alipayClient, request, method).getBody();
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePage(HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl, String appAuthToken) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        String form = pageExecute(request).getBody();
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePage(AlipayClient alipayClient, HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl, String appAuthToken) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        String form = pageExecute(alipayClient, request).getBody();
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        PrintWriter out = response.getWriter();
+        out.write(form);
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param response  {@link HttpServletResponse}
+     * @param model     {@link AlipayTradePagePayModel}
+     * @param notifyUrl 异步通知URL
+     * @param returnUrl 同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePageByOutputStream(HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        String form = pageExecute(request).getBody();
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(AliPayApiConfigKit.getAliPayApiConfig().getCharset()));
+        response.getOutputStream().flush();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePageByOutputStream(AlipayClient alipayClient, HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        String form = pageExecute(alipayClient, request).getBody();
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(charset));
+        response.getOutputStream().flush();
+    }
+
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePageByOutputStream(HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl, String appAuthToken) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        String form = pageExecute(request).getBody();
+        response.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(AliPayApiConfigKit.getAliPayApiConfig().getCharset()));
+        response.getOutputStream().flush();
+    }
+
+    /**
+     * 电脑网站支付(PC支付)
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param response     {@link HttpServletResponse}
+     * @param model        {@link AlipayTradePagePayModel}
+     * @param notifyUrl    异步通知URL
+     * @param returnUrl    同步通知URL
+     * @param appAuthToken 应用授权token
+     * @throws AlipayApiException 支付宝 Api 异常
+     * @throws IOException        IO 异常
+     */
+    public static void tradePageByOutputStream(AlipayClient alipayClient, HttpServletResponse response, AlipayTradePagePayModel model, String notifyUrl, String returnUrl, String appAuthToken) throws AlipayApiException, IOException {
+        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
+        request.setBizModel(model);
+        request.setNotifyUrl(notifyUrl);
+        request.setReturnUrl(returnUrl);
+        request.putOtherTextParam("app_auth_token", appAuthToken);
+        String form = pageExecute(alipayClient, request).getBody();
+        String charset = "UTF-8";
+        response.setContentType("text/html;charset=" + charset);
+        OutputStream out = response.getOutputStream();
+        out.write(form.getBytes(charset));
+        response.getOutputStream().flush();
+    }
+
+    /**
+     * 资金预授权冻结接口
+     *
+     * @param model {@link AlipayFundAuthOrderFreezeModel}
+     * @return {@link AlipayFundAuthOrderFreezeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOrderFreezeResponse authOrderFreezeToResponse(AlipayFundAuthOrderFreezeModel model) throws AlipayApiException {
+        AlipayFundAuthOrderFreezeRequest request = new AlipayFundAuthOrderFreezeRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 资金预授权冻结接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundAuthOrderFreezeModel}
+     * @return {@link AlipayFundAuthOrderFreezeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOrderFreezeResponse authOrderFreezeToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundAuthOrderFreezeModel model) throws AlipayApiException {
+        AlipayFundAuthOrderFreezeRequest request = new AlipayFundAuthOrderFreezeRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 资金授权解冻接口
+     *
+     * @param model {@link AlipayFundAuthOrderUnfreezeModel}
+     * @return {@link AlipayFundAuthOrderUnfreezeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOrderUnfreezeResponse authOrderUnfreezeToResponse(AlipayFundAuthOrderUnfreezeModel model) throws AlipayApiException {
+        AlipayFundAuthOrderUnfreezeRequest request = new AlipayFundAuthOrderUnfreezeRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 资金授权解冻接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundAuthOrderUnfreezeModel}
+     * @return {@link AlipayFundAuthOrderUnfreezeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOrderUnfreezeResponse authOrderUnfreezeToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundAuthOrderUnfreezeModel model) throws AlipayApiException {
+        AlipayFundAuthOrderUnfreezeRequest request = new AlipayFundAuthOrderUnfreezeRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 资金预授权冻结接口
+     *
+     * @param model {@link AlipayFundAuthOrderVoucherCreateModel}
+     * @return {@link AlipayFundAuthOrderVoucherCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOrderVoucherCreateResponse authOrderVoucherCreateToResponse(AlipayFundAuthOrderVoucherCreateModel model) throws AlipayApiException {
+        AlipayFundAuthOrderVoucherCreateRequest request = new AlipayFundAuthOrderVoucherCreateRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 资金预授权冻结接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundAuthOrderVoucherCreateModel}
+     * @return {@link AlipayFundAuthOrderVoucherCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOrderVoucherCreateResponse authOrderVoucherCreateToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundAuthOrderVoucherCreateModel model) throws AlipayApiException {
+        AlipayFundAuthOrderVoucherCreateRequest request = new AlipayFundAuthOrderVoucherCreateRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 资金授权撤销接口
+     *
+     * @param model {@link AlipayFundAuthOperationCancelModel}
+     * @return {@link AlipayFundAuthOperationCancelResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOperationCancelResponse authOperationCancelToResponse(AlipayFundAuthOperationCancelModel model) throws AlipayApiException {
+        AlipayFundAuthOperationCancelRequest request = new AlipayFundAuthOperationCancelRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 资金授权撤销接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundAuthOperationCancelModel}
+     * @return {@link AlipayFundAuthOperationCancelResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOperationCancelResponse authOperationCancelToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundAuthOperationCancelModel model) throws AlipayApiException {
+        AlipayFundAuthOperationCancelRequest request = new AlipayFundAuthOperationCancelRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 资金授权操作查询接口
+     *
+     * @param model {@link AlipayFundAuthOperationDetailQueryModel}
+     * @return {@link AlipayFundAuthOperationDetailQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOperationDetailQueryResponse authOperationDetailQueryToResponse(AlipayFundAuthOperationDetailQueryModel model) throws AlipayApiException {
+        AlipayFundAuthOperationDetailQueryRequest request = new AlipayFundAuthOperationDetailQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 资金授权操作查询接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundAuthOperationDetailQueryModel}
+     * @return {@link AlipayFundAuthOperationDetailQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundAuthOperationDetailQueryResponse authOperationDetailQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundAuthOperationDetailQueryModel model) throws AlipayApiException {
+        AlipayFundAuthOperationDetailQueryRequest request = new AlipayFundAuthOperationDetailQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 红包无线支付接口
+     *
+     * @param model {@link AlipayFundCouponOrderAppPayModel}
+     * @return {@link AlipayFundCouponOrderAppPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderAppPayResponse fundCouponOrderAppPayToResponse(AlipayFundCouponOrderAppPayModel model) throws AlipayApiException {
+        AlipayFundCouponOrderAppPayRequest request = new AlipayFundCouponOrderAppPayRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 红包无线支付接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundCouponOrderAppPayModel}
+     * @return {@link AlipayFundCouponOrderAppPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderAppPayResponse fundCouponOrderAppPayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundCouponOrderAppPayModel model) throws AlipayApiException {
+        AlipayFundCouponOrderAppPayRequest request = new AlipayFundCouponOrderAppPayRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 红包页面支付接口
+     *
+     * @param model {@link AlipayFundCouponOrderPagePayModel}
+     * @return {@link AlipayFundCouponOrderPagePayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderPagePayResponse fundCouponOrderPagePayToResponse(AlipayFundCouponOrderPagePayModel model) throws AlipayApiException {
+        AlipayFundCouponOrderPagePayRequest request = new AlipayFundCouponOrderPagePayRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 红包页面支付接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundCouponOrderPagePayModel}
+     * @return {@link AlipayFundCouponOrderPagePayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderPagePayResponse fundCouponOrderPagePayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundCouponOrderPagePayModel model) throws AlipayApiException {
+        AlipayFundCouponOrderPagePayRequest request = new AlipayFundCouponOrderPagePayRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 红包协议支付接口
+     *
+     * @param model {@link AlipayFundCouponOrderAgreementPayModel}
+     * @return {@link AlipayFundCouponOrderAgreementPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderAgreementPayResponse fundCouponOrderAgreementPayToResponse(AlipayFundCouponOrderAgreementPayModel model) throws AlipayApiException {
+        AlipayFundCouponOrderAgreementPayRequest request = new AlipayFundCouponOrderAgreementPayRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 红包协议支付接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundCouponOrderAgreementPayModel}
+     * @return {@link AlipayFundCouponOrderAgreementPayResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderAgreementPayResponse fundCouponOrderAgreementPayToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundCouponOrderAgreementPayModel model) throws AlipayApiException {
+        AlipayFundCouponOrderAgreementPayRequest request = new AlipayFundCouponOrderAgreementPayRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 红包打款接口
+     *
+     * @param model {@link AlipayFundCouponOrderDisburseModel}
+     * @return {@link AlipayFundCouponOrderDisburseResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderDisburseResponse fundCouponOrderDisburseToResponse(AlipayFundCouponOrderDisburseModel model) throws AlipayApiException {
+        AlipayFundCouponOrderDisburseRequest request = new AlipayFundCouponOrderDisburseRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 红包打款接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundCouponOrderDisburseModel}
+     * @return {@link AlipayFundCouponOrderDisburseResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderDisburseResponse fundCouponOrderDisburseToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundCouponOrderDisburseModel model) throws AlipayApiException {
+        AlipayFundCouponOrderDisburseRequest request = new AlipayFundCouponOrderDisburseRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 红包退回接口
+     *
+     * @param model {@link AlipayFundCouponOrderRefundModel}
+     * @return {@link AlipayFundCouponOrderRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderRefundResponse fundCouponOrderRefundToResponse(AlipayFundCouponOrderRefundModel model) throws AlipayApiException {
+        AlipayFundCouponOrderRefundRequest request = new AlipayFundCouponOrderRefundRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 红包退回接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundCouponOrderRefundModel}
+     * @return {@link AlipayFundCouponOrderRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOrderRefundResponse fundCouponOrderRefundToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundCouponOrderRefundModel model) throws AlipayApiException {
+        AlipayFundCouponOrderRefundRequest request = new AlipayFundCouponOrderRefundRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 红包退回接口
+     *
+     * @param model {@link AlipayFundCouponOperationQueryModel}
+     * @return {@link AlipayFundCouponOperationQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOperationQueryResponse fundCouponOperationQueryToResponse(AlipayFundCouponOperationQueryModel model) throws AlipayApiException {
+        AlipayFundCouponOperationQueryRequest request = new AlipayFundCouponOperationQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 红包退回接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayFundCouponOperationQueryModel}
+     * @return {@link AlipayFundCouponOperationQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayFundCouponOperationQueryResponse fundCouponOperationQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayFundCouponOperationQueryModel model) throws AlipayApiException {
+        AlipayFundCouponOperationQueryRequest request = new AlipayFundCouponOperationQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 应用授权 URL 拼装
+     *
+     * @param appId       应用编号
+     * @param redirectUri 回调 URI
+     * @return 应用授权 URL
+     * @throws UnsupportedEncodingException 编码异常
+     */
+    public static String getOauth2Url(String appId, String redirectUri) throws UnsupportedEncodingException {
+        return new StringBuffer().append("https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=").append(appId).append("&redirect_uri=").append(URLEncoder.encode(redirectUri, "UTF-8")).toString();
+    }
+
+    /**
+     * 使用 app_auth_code 换取 app_auth_token
+     *
+     * @param model {@link AlipayOpenAuthTokenAppModel}
+     * @return {@link AlipayOpenAuthTokenAppResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayOpenAuthTokenAppResponse openAuthTokenAppToResponse(AlipayOpenAuthTokenAppModel model) throws AlipayApiException {
+        AlipayOpenAuthTokenAppRequest request = new AlipayOpenAuthTokenAppRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 使用 app_auth_code 换取 app_auth_token
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayOpenAuthTokenAppModel}
+     * @return {@link AlipayOpenAuthTokenAppResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayOpenAuthTokenAppResponse openAuthTokenAppToResponse(AlipayClient alipayClient, Boolean certModel, AlipayOpenAuthTokenAppModel model) throws AlipayApiException {
+        AlipayOpenAuthTokenAppRequest request = new AlipayOpenAuthTokenAppRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 查询授权信息
+     *
+     * @param model {@link AlipayOpenAuthTokenAppQueryModel}
+     * @return {@link AlipayOpenAuthTokenAppQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayOpenAuthTokenAppQueryResponse openAuthTokenAppQueryToResponse(AlipayOpenAuthTokenAppQueryModel model) throws AlipayApiException {
+        AlipayOpenAuthTokenAppQueryRequest request = new AlipayOpenAuthTokenAppQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+
+    /**
+     * 查询授权信息
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayOpenAuthTokenAppQueryModel}
+     * @return {@link AlipayOpenAuthTokenAppQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayOpenAuthTokenAppQueryResponse openAuthTokenAppQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayOpenAuthTokenAppQueryModel model) throws AlipayApiException {
+        AlipayOpenAuthTokenAppQueryRequest request = new AlipayOpenAuthTokenAppQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 地铁购票发码
+     *
+     * @param model {@link AlipayCommerceCityfacilitatorVoucherGenerateModel}
+     * @return {@link AlipayCommerceCityfacilitatorVoucherGenerateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorVoucherGenerateResponse voucherGenerateToResponse(AlipayCommerceCityfacilitatorVoucherGenerateModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorVoucherGenerateRequest request = new AlipayCommerceCityfacilitatorVoucherGenerateRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 地铁购票发码
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayCommerceCityfacilitatorVoucherGenerateModel}
+     * @return {@link AlipayCommerceCityfacilitatorVoucherGenerateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorVoucherGenerateResponse voucherGenerateToResponse(AlipayClient alipayClient, Boolean certModel, AlipayCommerceCityfacilitatorVoucherGenerateModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorVoucherGenerateRequest request = new AlipayCommerceCityfacilitatorVoucherGenerateRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 地铁购票发码退款
+     *
+     * @param model {@link AlipayCommerceCityfacilitatorVoucherRefundModel}
+     * @return {@link AlipayCommerceCityfacilitatorVoucherRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorVoucherRefundResponse metroRefundToResponse(AlipayCommerceCityfacilitatorVoucherRefundModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorVoucherRefundRequest request = new AlipayCommerceCityfacilitatorVoucherRefundRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 地铁购票发码退款
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayCommerceCityfacilitatorVoucherRefundModel}
+     * @return {@link AlipayCommerceCityfacilitatorVoucherRefundResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorVoucherRefundResponse metroRefundToResponse(AlipayClient alipayClient, Boolean certModel, AlipayCommerceCityfacilitatorVoucherRefundModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorVoucherRefundRequest request = new AlipayCommerceCityfacilitatorVoucherRefundRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 地铁车站数据查询
+     *
+     * @param model {@link AlipayCommerceCityfacilitatorStationQueryModel}
+     * @return {@link AlipayCommerceCityfacilitatorStationQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorStationQueryResponse stationQueryToResponse(AlipayCommerceCityfacilitatorStationQueryModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorStationQueryRequest request = new AlipayCommerceCityfacilitatorStationQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+
+    /**
+     * 地铁车站数据查询
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayCommerceCityfacilitatorStationQueryModel}
+     * @return {@link AlipayCommerceCityfacilitatorStationQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorStationQueryResponse stationQueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayCommerceCityfacilitatorStationQueryModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorStationQueryRequest request = new AlipayCommerceCityfacilitatorStationQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 核销码批量查询
+     *
+     * @param model {@link AlipayCommerceCityfacilitatorVoucherBatchqueryModel}
+     * @return {@link AlipayCommerceCityfacilitatorVoucherBatchqueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorVoucherBatchqueryResponse voucherBatchqueryToResponse(AlipayCommerceCityfacilitatorVoucherBatchqueryModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorVoucherBatchqueryRequest request = new AlipayCommerceCityfacilitatorVoucherBatchqueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 核销码批量查询
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayCommerceCityfacilitatorVoucherBatchqueryModel}
+     * @return {@link AlipayCommerceCityfacilitatorVoucherBatchqueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceCityfacilitatorVoucherBatchqueryResponse voucherBatchqueryToResponse(AlipayClient alipayClient, Boolean certModel, AlipayCommerceCityfacilitatorVoucherBatchqueryModel model) throws AlipayApiException {
+        AlipayCommerceCityfacilitatorVoucherBatchqueryRequest request = new AlipayCommerceCityfacilitatorVoucherBatchqueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    public static void batchTrans(Map<String, String> params, String privateKey, String signType, HttpServletResponse response) throws IOException {
+        params.put("service", "batch_trans_notify");
+        params.put("_input_charset", "UTF-8");
+        params.put("pay_date", DateUtil.format(new Date(), "YYYYMMDD"));
+        Map<String, String> param = AliPayCore.buildRequestPara(params, privateKey, signType);
+        response.sendRedirect(GATEWAY_NEW.concat(AliPayCore.createLinkString(param)));
+    }
+
+    /**
+     * 将异步通知的参数转化为Map
+     *
+     * @param request {HttpServletRequest}
+     * @return 转化后的Map
+     */
+    public static Map<String, String> toMap(HttpServletRequest request) {
+        Map<String, String> params = new HashMap<String, String>();
+        Map<String, String[]> requestParams = request.getParameterMap();
+        for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext(); ) {
+            String name = iter.next();
+            String[] values = requestParams.get(name);
+            String valueStr = "";
+            for (int i = 0; i < values.length; i++) {
+                valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ",";
+            }
+            params.put(name, valueStr);
+        }
+        return params;
+    }
+
+    /**
+     * 生活缴费查询账单
+     *
+     * @param orderType       支付宝订单类型
+     * @param merchantOrderNo 业务流水号
+     * @return {@link AlipayEbppBillGetResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayEbppBillGetResponse ebppBillGet(String orderType, String merchantOrderNo) throws AlipayApiException {
+        AlipayEbppBillGetRequest request = new AlipayEbppBillGetRequest();
+        request.setOrderType(orderType);
+        request.setMerchantOrderNo(merchantOrderNo);
+        return doExecute(request);
+    }
+
+    /**
+     * 生活缴费查询账单
+     *
+     * @param alipayClient    {@link AlipayClient}
+     * @param certModel       是否证书模式
+     * @param orderType       支付宝订单类型
+     * @param merchantOrderNo 业务流水号
+     * @return {@link AlipayEbppBillGetResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayEbppBillGetResponse ebppBillGet(AlipayClient alipayClient, Boolean certModel, String orderType, String merchantOrderNo) throws AlipayApiException {
+        AlipayEbppBillGetRequest request = new AlipayEbppBillGetRequest();
+        request.setOrderType(orderType);
+        request.setMerchantOrderNo(merchantOrderNo);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * H5刷脸认证初始化
+     *
+     * @param model {@link ZolozIdentificationUserWebInitializeModel}
+     * @return {@link ZolozIdentificationUserWebInitializeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozIdentificationUserWebInitializeResponse identificationUserWebInitialize(ZolozIdentificationUserWebInitializeModel model) throws AlipayApiException {
+        ZolozIdentificationUserWebInitializeRequest request = new ZolozIdentificationUserWebInitializeRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * H5刷脸认证初始化
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozIdentificationUserWebInitializeModel}
+     * @return {@link ZolozIdentificationUserWebInitializeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozIdentificationUserWebInitializeResponse identificationUserWebInitialize(AlipayClient alipayClient, Boolean certModel, ZolozIdentificationUserWebInitializeModel model) throws AlipayApiException {
+        ZolozIdentificationUserWebInitializeRequest request = new ZolozIdentificationUserWebInitializeRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * H5刷脸认证查询
+     *
+     * @param model {@link ZolozIdentificationUserWebQueryModel}
+     * @return {@link ZolozIdentificationUserWebQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozIdentificationUserWebQueryResponse identificationUserWebInitialize(ZolozIdentificationUserWebQueryModel model) throws AlipayApiException {
+        ZolozIdentificationUserWebQueryRequest request = new ZolozIdentificationUserWebQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * H5刷脸认证查询
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozIdentificationUserWebQueryModel}
+     * @return {@link ZolozIdentificationUserWebQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozIdentificationUserWebQueryResponse identificationUserWebInitialize(AlipayClient alipayClient, Boolean certModel, ZolozIdentificationUserWebQueryModel model) throws AlipayApiException {
+        ZolozIdentificationUserWebQueryRequest request = new ZolozIdentificationUserWebQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 热脸入库
+     *
+     * @param model {@link ZolozAuthenticationCustomerFacemanageCreateModel}
+     * @return {@link ZolozAuthenticationCustomerFacemanageCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerFacemanageCreateResponse authenticationCustomerFaceManageCreate(ZolozAuthenticationCustomerFacemanageCreateModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerFacemanageCreateRequest request = new ZolozAuthenticationCustomerFacemanageCreateRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 热脸入库
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozAuthenticationCustomerFacemanageCreateModel}
+     * @return {@link ZolozAuthenticationCustomerFacemanageCreateResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerFacemanageCreateResponse authenticationCustomerFaceManageCreate(AlipayClient alipayClient, Boolean certModel, ZolozAuthenticationCustomerFacemanageCreateModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerFacemanageCreateRequest request = new ZolozAuthenticationCustomerFacemanageCreateRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 热脸出库
+     *
+     * @param model {@link ZolozAuthenticationCustomerFacemanageDeleteModel}
+     * @return {@link ZolozAuthenticationCustomerFacemanageDeleteResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerFacemanageDeleteResponse authenticationCustomerFaceManageDelete(ZolozAuthenticationCustomerFacemanageDeleteModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerFacemanageDeleteRequest request = new ZolozAuthenticationCustomerFacemanageDeleteRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 热脸出库
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozAuthenticationCustomerFacemanageDeleteModel}
+     * @return {@link ZolozAuthenticationCustomerFacemanageDeleteResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerFacemanageDeleteResponse authenticationCustomerFaceManageDelete(AlipayClient alipayClient, Boolean certModel, ZolozAuthenticationCustomerFacemanageDeleteModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerFacemanageDeleteRequest request = new ZolozAuthenticationCustomerFacemanageDeleteRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 人脸 ftoken 查询消费接口
+     *
+     * @param model {@link ZolozAuthenticationCustomerFtokenQueryModel}
+     * @return {@link ZolozAuthenticationCustomerFtokenQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerFtokenQueryResponse authenticationCustomerFTokenQuery(ZolozAuthenticationCustomerFtokenQueryModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerFtokenQueryRequest request = new ZolozAuthenticationCustomerFtokenQueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 人脸 ftoken 查询消费接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozAuthenticationCustomerFtokenQueryModel}
+     * @return {@link ZolozAuthenticationCustomerFtokenQueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerFtokenQueryResponse authenticationCustomerFTokenQuery(AlipayClient alipayClient, Boolean certModel, ZolozAuthenticationCustomerFtokenQueryModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerFtokenQueryRequest request = new ZolozAuthenticationCustomerFtokenQueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+
+    /**
+     * 人脸初始化刷脸付
+     *
+     * @param model {@link ZolozAuthenticationSmilepayInitializeModel}
+     * @return {@link ZolozAuthenticationSmilepayInitializeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationSmilepayInitializeResponse authenticationSmilePayInitialize(ZolozAuthenticationSmilepayInitializeModel model) throws AlipayApiException {
+        ZolozAuthenticationSmilepayInitializeRequest request = new ZolozAuthenticationSmilepayInitializeRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 人脸初始化刷脸付
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozAuthenticationSmilepayInitializeModel}
+     * @return {@link ZolozAuthenticationSmilepayInitializeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationSmilepayInitializeResponse authenticationSmilePayInitialize(AlipayClient alipayClient, Boolean certModel, ZolozAuthenticationSmilepayInitializeModel model) throws AlipayApiException {
+        ZolozAuthenticationSmilepayInitializeRequest request = new ZolozAuthenticationSmilepayInitializeRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 人脸初始化唤起zim
+     *
+     * @param model {@link ZolozAuthenticationCustomerSmilepayInitializeModel}
+     * @return {@link ZolozAuthenticationCustomerSmilepayInitializeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerSmilepayInitializeResponse authenticationCustomerSmilePayInitialize(ZolozAuthenticationCustomerSmilepayInitializeModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerSmilepayInitializeRequest request = new ZolozAuthenticationCustomerSmilepayInitializeRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 人脸初始化唤起zim
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link ZolozAuthenticationCustomerSmilepayInitializeModel}
+     * @return {@link ZolozAuthenticationCustomerSmilepayInitializeResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static ZolozAuthenticationCustomerSmilepayInitializeResponse authenticationCustomerSmilePayInitialize(AlipayClient alipayClient, Boolean certModel, ZolozAuthenticationCustomerSmilepayInitializeModel model) throws AlipayApiException {
+        ZolozAuthenticationCustomerSmilepayInitializeRequest request = new ZolozAuthenticationCustomerSmilepayInitializeRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 生态激励项目ISV代签约接口
+     *
+     * @return {@link AlipayCommerceAdContractSignResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceAdContractSignResponse commerceAdContractSign() throws AlipayApiException {
+        AlipayCommerceAdContractSignRequest request = new AlipayCommerceAdContractSignRequest();
+        return doExecute(request);
+    }
+
+    /**
+     * 生态激励项目ISV代签约接口
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @return {@link AlipayCommerceAdContractSignResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayCommerceAdContractSignResponse commerceAdContractSign(AlipayClient alipayClient, Boolean certModel) throws AlipayApiException {
+        AlipayCommerceAdContractSignRequest request = new AlipayCommerceAdContractSignRequest();
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 分账关系绑定
+     *
+     * @param model {@link AlipayTradeRoyaltyRelationBindModel}
+     * @return {@link AlipayTradeRoyaltyRelationBindResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRoyaltyRelationBindResponse tradeRoyaltyRelationBind(AlipayTradeRoyaltyRelationBindModel model) throws AlipayApiException {
+        AlipayTradeRoyaltyRelationBindRequest request = new AlipayTradeRoyaltyRelationBindRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 分账关系绑定
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeRoyaltyRelationBindModel}
+     * @return {@link AlipayTradeRoyaltyRelationBindResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRoyaltyRelationBindResponse tradeRoyaltyRelationBind(AlipayClient alipayClient, Boolean certModel, AlipayTradeRoyaltyRelationBindModel model) throws AlipayApiException {
+        AlipayTradeRoyaltyRelationBindRequest request = new AlipayTradeRoyaltyRelationBindRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 分账关系解绑
+     *
+     * @param model {@link AlipayTradeRoyaltyRelationUnbindModel}
+     * @return {@link AlipayTradeRoyaltyRelationUnbindResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRoyaltyRelationUnbindResponse tradeRoyaltyRelationUnBind(AlipayTradeRoyaltyRelationUnbindModel model) throws AlipayApiException {
+        AlipayTradeRoyaltyRelationUnbindRequest request = new AlipayTradeRoyaltyRelationUnbindRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+    /**
+     * 分账关系解绑
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeRoyaltyRelationUnbindModel}
+     * @return {@link AlipayTradeRoyaltyRelationUnbindResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRoyaltyRelationUnbindResponse tradeRoyaltyRelationUnBind(AlipayClient alipayClient, Boolean certModel, AlipayTradeRoyaltyRelationUnbindModel model) throws AlipayApiException {
+        AlipayTradeRoyaltyRelationUnbindRequest request = new AlipayTradeRoyaltyRelationUnbindRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+    /**
+     * 分账关系查询
+     *
+     * @param model {@link AlipayTradeRoyaltyRelationBatchqueryModel}
+     * @return {@link AlipayTradeRoyaltyRelationBatchqueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRoyaltyRelationBatchqueryResponse tradeRoyaltyRelationBatchQuery(AlipayTradeRoyaltyRelationBatchqueryModel model) throws AlipayApiException {
+        AlipayTradeRoyaltyRelationBatchqueryRequest request = new AlipayTradeRoyaltyRelationBatchqueryRequest();
+        request.setBizModel(model);
+        return doExecute(request);
+    }
+
+
+    /**
+     * 分账关系查询
+     *
+     * @param alipayClient {@link AlipayClient}
+     * @param certModel    是否证书模式
+     * @param model        {@link AlipayTradeRoyaltyRelationBatchqueryModel}
+     * @return {@link AlipayTradeRoyaltyRelationBatchqueryResponse}
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public static AlipayTradeRoyaltyRelationBatchqueryResponse tradeRoyaltyRelationBatchQuery(AlipayClient alipayClient, Boolean certModel, AlipayTradeRoyaltyRelationBatchqueryModel model) throws AlipayApiException {
+        AlipayTradeRoyaltyRelationBatchqueryRequest request = new AlipayTradeRoyaltyRelationBatchqueryRequest();
+        request.setBizModel(model);
+        return doExecute(alipayClient, certModel, request);
+    }
+
+}

+ 385 - 0
pay/src/main/java/pay/platform/alipay/enums/AliPayApiConfig.java

@@ -0,0 +1,385 @@
+package pay.platform.alipay.enums;
+
+import cn.hutool.core.util.StrUtil;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.AlipayClient;
+import com.alipay.api.CertAlipayRequest;
+import com.alipay.api.DefaultAlipayClient;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * <p>支付宝支付配置</p>
+ */
+public class AliPayApiConfig implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    public final static String DEFAULT_GATEWAY_URL = "https://openapi.alipay.com/gateway.do";
+
+    /**
+     * 沙箱环境网关
+     */
+    public final static String SANDBOX_GATEWAY_URL = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
+
+    /**
+     * 应用私钥
+     */
+    private String privateKey;
+
+    /**
+     * 支付宝公钥
+     */
+    private String aliPayPublicKey;
+
+    /**
+     * 应用编号
+     */
+    private String appId;
+
+    /**
+     * 支付宝支付网关
+     */
+    private String serviceUrl;
+
+    /**
+     * 字符集,为空默认为 UTF-8
+     */
+    private String charset;
+
+    /**
+     * 为空默认为 RSA2
+     */
+    private String signType;
+
+    /**
+     * 为空默认为 JSON
+     */
+    private String format;
+
+    /**
+     * 是否为证书模式
+     */
+    private boolean certModel;
+
+    /**
+     * 应用公钥证书 (证书模式必须)
+     */
+    private String appCertPath;
+
+    /**
+     * 应用公钥证书文本内容
+     */
+    private String appCertContent;
+
+    /**
+     * 支付宝公钥证书 (证书模式必须)
+     */
+    private String aliPayCertPath;
+
+    /**
+     * 支付宝公钥证书文本内容
+     */
+    private String aliPayCertContent;
+
+    /**
+     * 支付宝根证书 (证书模式必须)
+     */
+    private String aliPayRootCertPath;
+
+    /**
+     * 支付宝根证书文本内容
+     */
+    private String aliPayRootCertContent;
+
+    /**
+     * 支付宝客户端
+     */
+    private AlipayClient alipayClient;
+
+    /**
+     * 其他附加参数
+     */
+    private Object exParams;
+
+    /**
+     * 域名
+     */
+    private String domain;
+
+    private AliPayApiConfig() {
+    }
+
+    public static AliPayApiConfig builder() {
+        return new AliPayApiConfig();
+    }
+
+    /**
+     * 直接传入阿里客户端方式
+     *
+     * @param defaultAlipayClient 默认阿里客户端
+     * @return {@link AliPayApiConfig}  支付宝支付配置
+     */
+    public AliPayApiConfig build(DefaultAlipayClient defaultAlipayClient) {
+        this.alipayClient = defaultAlipayClient;
+        return this;
+    }
+
+    /**
+     * 普通公钥方式
+     *
+     * @return AliPayApiConfig 支付宝配置
+     */
+    public AliPayApiConfig build() {
+        this.alipayClient = new DefaultAlipayClient(getServiceUrl(), getAppId(), getPrivateKey(), getFormat(),
+                getCharset(), getAliPayPublicKey(), getSignType());
+        return this;
+    }
+
+    /**
+     * 证书模式
+     *
+     * @return AliPayApiConfig 支付宝配置
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public AliPayApiConfig buildByCert() throws AlipayApiException {
+        return build(getAppCertPath(), getAliPayCertPath(), getAliPayRootCertPath());
+    }
+
+    /**
+     * 证书模式
+     *
+     * @return AliPayApiConfig 支付宝配置
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public AliPayApiConfig buildByCertContent() throws AlipayApiException {
+        return buildByCertContent(getAppCertContent(), getAliPayCertContent(), getAliPayRootCertContent());
+    }
+
+    /**
+     * @param appCertPath        应用公钥证书路径
+     * @param aliPayCertPath     支付宝公钥证书文件路径
+     * @param aliPayRootCertPath 支付宝CA根证书文件路径
+     * @return {@link AliPayApiConfig}  支付宝支付配置
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public AliPayApiConfig build(String appCertPath, String aliPayCertPath, String aliPayRootCertPath) throws AlipayApiException {
+        CertAlipayRequest certAlipayRequest = new CertAlipayRequest();
+        certAlipayRequest.setServerUrl(getServiceUrl());
+        certAlipayRequest.setAppId(getAppId());
+        certAlipayRequest.setPrivateKey(getPrivateKey());
+        certAlipayRequest.setFormat(getFormat());
+        certAlipayRequest.setCharset(getCharset());
+        certAlipayRequest.setSignType(getSignType());
+        certAlipayRequest.setCertPath(appCertPath);
+        certAlipayRequest.setAlipayPublicCertPath(aliPayCertPath);
+        certAlipayRequest.setRootCertPath(aliPayRootCertPath);
+        this.alipayClient = new DefaultAlipayClient(certAlipayRequest);
+        this.certModel = true;
+        return this;
+    }
+
+    /**
+     * @param appCertContent        应用公钥证书
+     * @param aliPayCertContent     支付宝公钥证书
+     * @param aliPayRootCertContent 支付宝CA根证书
+     * @return {@link AliPayApiConfig}  支付宝支付配置
+     * @throws AlipayApiException 支付宝 Api 异常
+     */
+    public AliPayApiConfig buildByCertContent(String appCertContent, String aliPayCertContent, String aliPayRootCertContent) throws AlipayApiException {
+        CertAlipayRequest certAlipayRequest = new CertAlipayRequest();
+        certAlipayRequest.setServerUrl(getServiceUrl());
+        certAlipayRequest.setAppId(getAppId());
+        certAlipayRequest.setPrivateKey(getPrivateKey());
+        certAlipayRequest.setFormat(getFormat());
+        certAlipayRequest.setCharset(getCharset());
+        certAlipayRequest.setSignType(getSignType());
+        certAlipayRequest.setCertContent(appCertContent);
+        certAlipayRequest.setAlipayPublicCertContent(aliPayCertContent);
+        certAlipayRequest.setRootCertContent(aliPayRootCertContent);
+        this.alipayClient = new DefaultAlipayClient(certAlipayRequest);
+        this.certModel = true;
+        return this;
+    }
+
+    public String getPrivateKey() {
+        if (StrUtil.isBlank(privateKey)) {
+            throw new IllegalStateException("privateKey 未被赋值");
+        }
+        return privateKey;
+    }
+
+    public AliPayApiConfig setPrivateKey(String privateKey) {
+        if (StrUtil.isEmpty(privateKey)) {
+            throw new IllegalArgumentException("privateKey 值不能为 null");
+        }
+        this.privateKey = privateKey;
+        return this;
+    }
+
+    public String getAliPayPublicKey() {
+        return aliPayPublicKey;
+    }
+
+    public AliPayApiConfig setAliPayPublicKey(String aliPayPublicKey) {
+        this.aliPayPublicKey = aliPayPublicKey;
+        return this;
+    }
+
+    public String getAppId() {
+        if (StrUtil.isEmpty(appId)) {
+            throw new IllegalStateException("appId 未被赋值");
+        }
+        return appId;
+    }
+
+    public AliPayApiConfig setAppId(String appId) {
+        if (StrUtil.isEmpty(appId)) {
+            throw new IllegalArgumentException("appId 值不能为 null");
+        }
+        this.appId = appId;
+        return this;
+    }
+
+    public String getServiceUrl() {
+        if (StrUtil.isEmpty(serviceUrl)) {
+            throw new IllegalStateException("serviceUrl 未被赋值");
+        }
+        return serviceUrl;
+    }
+
+    public AliPayApiConfig setServiceUrl(String serviceUrl) {
+        if (StrUtil.isEmpty(serviceUrl)) {
+            serviceUrl = DEFAULT_GATEWAY_URL;
+        }
+        this.serviceUrl = serviceUrl;
+        return this;
+    }
+
+    public String getCharset() {
+        if (StrUtil.isEmpty(charset)) {
+            charset = "UTF-8";
+        }
+        return charset;
+    }
+
+    public AliPayApiConfig setCharset(String charset) {
+        if (StrUtil.isEmpty(charset)) {
+            charset = "UTF-8";
+        }
+        this.charset = charset;
+        return this;
+    }
+
+    public String getSignType() {
+        if (StrUtil.isEmpty(signType)) {
+            signType = "RSA2";
+        }
+        return signType;
+    }
+
+    public AliPayApiConfig setSignType(String signType) {
+        if (StrUtil.isEmpty(signType)) {
+            signType = "RSA2";
+        }
+        this.signType = signType;
+        return this;
+    }
+
+    public String getFormat() {
+        if (StrUtil.isEmpty(format)) {
+            format = "json";
+        }
+        return format;
+    }
+
+    public String getAppCertPath() {
+        return appCertPath;
+    }
+
+    public AliPayApiConfig setAppCertPath(String appCertPath) {
+        this.appCertPath = appCertPath;
+        return this;
+    }
+
+    public String getAppCertContent() {
+        return appCertContent;
+    }
+
+    public AliPayApiConfig setAppCertContent(String appCertContent) {
+        this.appCertContent = appCertContent;
+        return this;
+    }
+
+    public String getAliPayCertPath() {
+        return aliPayCertPath;
+    }
+
+    public AliPayApiConfig setAliPayCertPath(String aliPayCertPath) {
+        this.aliPayCertPath = aliPayCertPath;
+        return this;
+    }
+
+    public String getAliPayCertContent() {
+        return aliPayCertContent;
+    }
+
+    public AliPayApiConfig setAliPayCertContent(String aliPayCertContent) {
+        this.aliPayCertContent = aliPayCertContent;
+        return this;
+    }
+
+    public String getAliPayRootCertPath() {
+        return aliPayRootCertPath;
+    }
+
+    public AliPayApiConfig setAliPayRootCertPath(String aliPayRootCertPath) {
+        this.aliPayRootCertPath = aliPayRootCertPath;
+        return this;
+    }
+
+    public String getAliPayRootCertContent() {
+        return aliPayRootCertContent;
+    }
+
+    public AliPayApiConfig setAliPayRootCertContent(String aliPayRootCertContent) {
+        this.aliPayRootCertContent = aliPayRootCertContent;
+        return this;
+    }
+
+    public boolean isCertModel() {
+        return certModel;
+    }
+
+    public AliPayApiConfig setCertModel(boolean certModel) {
+        this.certModel = certModel;
+        return this;
+    }
+
+    public AlipayClient getAliPayClient() {
+        if (alipayClient == null) {
+            throw new IllegalStateException("aliPayClient 未被初始化");
+        }
+        return alipayClient;
+    }
+
+    public Object getExParams() {
+        return exParams;
+    }
+
+    public AliPayApiConfig setExParams(Object exParams) {
+        this.exParams = exParams;
+        return this;
+    }
+
+    public String getDomain() {
+        return domain;
+    }
+
+    public AliPayApiConfig setDomain(String domain) {
+        this.domain = domain;
+        return this;
+    }
+}

+ 120 - 0
pay/src/main/java/pay/platform/alipay/enums/AliPayApiConfigKit.java

@@ -0,0 +1,120 @@
+package pay.platform.alipay.enums;
+
+import cn.hutool.core.util.StrUtil;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 支付宝支付配置
+ */
+public class AliPayApiConfigKit {
+    private static final ThreadLocal<String> TL = new ThreadLocal<String>();
+
+    private static final Map<String, AliPayApiConfig> CFG_MAP = new ConcurrentHashMap<String, AliPayApiConfig>();
+    private static final String DEFAULT_CFG_KEY = "_default_key_";
+
+    /**
+     * <p>向缓存中设置 AliPayApiConfig </p>
+     * <p>每个 appId 只需添加一次,相同 appId 将被覆盖</p>
+     *
+     * @param aliPayApiConfig 支付宝支付配置
+     * @return {@link AliPayApiConfig}
+     */
+    public static AliPayApiConfig putApiConfig(AliPayApiConfig aliPayApiConfig) {
+        if (CFG_MAP.size() == 0) {
+            CFG_MAP.put(DEFAULT_CFG_KEY, aliPayApiConfig);
+        }
+        CFG_MAP.put(aliPayApiConfig.getAppId(), aliPayApiConfig);
+        return aliPayApiConfig;
+    }
+
+    /**
+     * 向当前线程中设置 {@link AliPayApiConfig}
+     *
+     * @param aliPayApiConfig {@link AliPayApiConfig} 支付宝配置对象
+     * @return {@link AliPayApiConfig}
+     */
+    public static AliPayApiConfig setThreadLocalAliPayApiConfig(AliPayApiConfig aliPayApiConfig) {
+        if (StrUtil.isNotEmpty(aliPayApiConfig.getAppId())) {
+            setThreadLocalAppId(aliPayApiConfig.getAppId());
+        }
+        return putApiConfig(aliPayApiConfig);
+    }
+
+    /**
+     * 通过 AliPayApiConfig 移除支付配置
+     *
+     * @param aliPayApiConfig {@link AliPayApiConfig} 支付宝配置对象
+     * @return {@link AliPayApiConfig}
+     */
+    public static AliPayApiConfig removeApiConfig(AliPayApiConfig aliPayApiConfig) {
+        return removeApiConfig(aliPayApiConfig.getAppId());
+    }
+
+    /**
+     * 通过 appId 移除支付配置
+     *
+     * @param appId 支付宝应用编号
+     * @return {@link AliPayApiConfig}
+     */
+    public static AliPayApiConfig removeApiConfig(String appId) {
+        return CFG_MAP.remove(appId);
+    }
+
+    /**
+     * 向当前线程中设置 appId
+     *
+     * @param appId 支付宝应用编号
+     */
+    public static void setThreadLocalAppId(String appId) {
+        if (StrUtil.isEmpty(appId)) {
+            appId = CFG_MAP.get(DEFAULT_CFG_KEY).getAppId();
+        }
+        TL.set(appId);
+    }
+
+    /**
+     * 移除当前线程中的 appId
+     */
+    public static void removeThreadLocalAppId() {
+        TL.remove();
+    }
+
+    /**
+     * 获取当前线程中的  appId
+     *
+     * @return 支付宝应用编号 appId
+     */
+    public static String getAppId() {
+        String appId = TL.get();
+        if (StrUtil.isEmpty(appId)) {
+            appId = CFG_MAP.get(DEFAULT_CFG_KEY).getAppId();
+        }
+        return appId;
+    }
+
+    /**
+     * 获取当前线程中的 AliPayApiConfig
+     *
+     * @return {@link AliPayApiConfig}
+     */
+    public static AliPayApiConfig getAliPayApiConfig() {
+        String appId = getAppId();
+        return getApiConfig(appId);
+    }
+
+    /**
+     * 通过 appId 获取 AliPayApiConfig
+     *
+     * @param appId 支付宝应用编号
+     * @return {@link AliPayApiConfig}
+     */
+    public static AliPayApiConfig getApiConfig(String appId) {
+        AliPayApiConfig cfg = CFG_MAP.get(appId);
+        if (cfg == null) {
+            throw new IllegalStateException("需事先调用 AliPayApiConfigKit.putApiConfig(aliPayApiConfig) 将 appId对应的 aliPayApiConfig 对象存入,才可以使用 AliPayApiConfigKit.getAliPayApiConfig() 的系列方法");
+        }
+        return cfg;
+    }
+}

+ 131 - 0
pay/src/main/java/pay/platform/alipay/enums/AliPayCore.java

@@ -0,0 +1,131 @@
+package pay.platform.alipay.enums;
+
+import cn.hutool.crypto.SecureUtil;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.AlipayConstants;
+import com.alipay.api.internal.util.AlipaySignature;
+import com.alipay.api.internal.util.AntCertificationUtil;
+import com.alipay.api.internal.util.codec.Base64;
+
+import java.util.*;
+
+import static com.alipay.api.internal.util.AlipaySignature.rsaCheckV1;
+
+/**
+ * 支付宝接口请求核心类
+ */
+public class AliPayCore {
+
+    /**
+     * 生成签名结果
+     *
+     * @param params   要签名的数组
+     * @param key      签名密钥
+     * @param signType 签名类型
+     * @return 签名结果字符串
+     */
+    public static String buildRequestMySign(Map<String, String> params, String key, String signType) throws AlipayApiException {
+        // 把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
+        String preStr = createLinkString(params);
+        if (SignType.MD5.getType().equals(signType)) {
+            return SecureUtil.md5(preStr.concat(key));
+        } else if (SignType.RSA2.getType().equals(signType)) {
+            return AlipaySignature.rsa256Sign(preStr, key, AlipayConstants.CHARSET_UTF8);
+        } else if (SignType.RSA.getType().equals(signType)) {
+            return AlipaySignature.rsaSign(preStr, key, AlipayConstants.CHARSET_UTF8);
+        }
+        return null;
+    }
+
+    /**
+     * 生成要请求给支付宝的参数数组
+     *
+     * @param params   请求前的参数数组
+     * @param key      商户的私钥
+     * @param signType 签名类型
+     * @return 要请求的参数数组
+     */
+    public static Map<String, String> buildRequestPara(Map<String, String> params, String key, String signType) {
+        // 除去数组中的空值和签名参数
+        Map<String, String> tempMap = paraFilter(params);
+        // 生成签名结果
+        String mySign;
+        try {
+            mySign = buildRequestMySign(params, key, signType);
+        } catch (AlipayApiException e) {
+            e.printStackTrace();
+            return null;
+        }
+        // 签名结果与签名方式加入请求提交参数组中
+        tempMap.put("sign", mySign);
+        tempMap.put("sign_type", signType);
+        return tempMap;
+    }
+
+    /**
+     * 除去数组中的空值和签名参数
+     *
+     * @param params 签名参数组
+     * @return 去掉空值与签名参数后的新签名参数组
+     */
+    public static Map<String, String> paraFilter(Map<String, String> params) {
+        if (params == null) {
+            return null;
+        }
+        Map<String, String> result = new HashMap<>(params.size());
+        if (params.size() <= 0) {
+            return result;
+        }
+        for (String key : params.keySet()) {
+            String value = params.get(key);
+            if (value == null || "".equals(value) || "sign".equalsIgnoreCase(key)
+                    || "sign_type".equalsIgnoreCase(key)) {
+                continue;
+            }
+            result.put(key, value);
+        }
+        return result;
+    }
+
+    /**
+     * 把数组所有元素排序
+     *
+     * @param params 需要排序并参与字符拼接的参数组
+     * @return 拼接后字符串
+     */
+    public static String createLinkString(Map<String, String> params) {
+        List<String> keys = new ArrayList<>(params.keySet());
+        Collections.sort(keys);
+        StringBuilder content = new StringBuilder();
+        for (String key : keys) {
+            String value = params.get(key);
+            // 拼接时,不包括最后一个&字符
+            content.append(key).append("=").append(value).append("&");
+        }
+        if (content.lastIndexOf("&") == content.length() - 1) {
+            content.deleteCharAt(content.length() - 1);
+        }
+        return content.toString();
+    }
+
+    /**
+     * 从证书内容验签
+     *
+     * @param params                  待验签的从支付宝接收到的参数Map
+     * @param alipayPublicCertContent 支付宝公钥证书内容
+     * @param charset                 参数内容编码集
+     * @param signType                指定采用的签名方式,RSA或RSA2
+     * @return true:验签通过;false:验签不通过
+     * @throws AlipayApiException
+     */
+    public static boolean rsaCertCheckV1ByContent(Map<String, String> params, String alipayPublicCertContent,
+                                                  String charset, String signType) throws AlipayApiException {
+        String publicKey = Base64.encodeBase64String(
+                AntCertificationUtil
+                        .getCertFromContent(alipayPublicCertContent)
+                        .getPublicKey()
+                        .getEncoded()
+        );
+        return rsaCheckV1(params, publicKey, charset, signType);
+    }
+}

+ 29 - 0
pay/src/main/java/pay/platform/alipay/enums/SignType.java

@@ -0,0 +1,29 @@
+package pay.platform.alipay.enums;
+
+/**
+ * <p>签名方式</p>
+ */
+public enum SignType {
+    /**
+     * MD5 加密
+     */
+    MD5("MD5"),
+    /**
+     * RSA2
+     */
+    RSA2("RSA2"),
+    /**
+     * RSA
+     */
+    RSA("RSA");
+
+    SignType(String type) {
+        this.type = type;
+    }
+
+    private final String type;
+
+    public String getType() {
+        return type;
+    }
+}

+ 0 - 279
pay/src/main/java/pay/platform/common/sign/Base64.java

@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2010 The MobileSecurePay Project
- * All right reserved.
- * author: shiqun.shi@alipay.com
- */
-
-package pay.platform.common.sign;
-
-public final class Base64 {
-
-    static private final int BASELENGTH = 128;
-    static private final int LOOKUPLENGTH = 64;
-    static private final int TWENTYFOURBITGROUP = 24;
-    static private final int EIGHTBIT = 8;
-    static private final int SIXTEENBIT = 16;
-    static private final int FOURBYTE = 4;
-    static private final int SIGN = -128;
-    static private final char PAD = '=';
-    static private final boolean fDebug = false;
-    static final private byte[] base64Alphabet = new byte[BASELENGTH];
-    static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
-
-    static {
-        for (int i = 0; i < BASELENGTH; ++i) {
-            base64Alphabet[i] = -1;
-        }
-        for (int i = 'Z'; i >= 'A'; i--) {
-            base64Alphabet[i] = (byte) (i - 'A');
-        }
-        for (int i = 'z'; i >= 'a'; i--) {
-            base64Alphabet[i] = (byte) (i - 'a' + 26);
-        }
-
-        for (int i = '9'; i >= '0'; i--) {
-            base64Alphabet[i] = (byte) (i - '0' + 52);
-        }
-
-        base64Alphabet['+'] = 62;
-        base64Alphabet['/'] = 63;
-
-        for (int i = 0; i <= 25; i++) {
-            lookUpBase64Alphabet[i] = (char) ('A' + i);
-        }
-
-        for (int i = 26, j = 0; i <= 51; i++, j++) {
-            lookUpBase64Alphabet[i] = (char) ('a' + j);
-        }
-
-        for (int i = 52, j = 0; i <= 61; i++, j++) {
-            lookUpBase64Alphabet[i] = (char) ('0' + j);
-        }
-        lookUpBase64Alphabet[62] = (char) '+';
-        lookUpBase64Alphabet[63] = (char) '/';
-
-    }
-
-    private static boolean isWhiteSpace(char octect) {
-        return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
-    }
-
-    private static boolean isPad(char octect) {
-        return (octect == PAD);
-    }
-
-    private static boolean isData(char octect) {
-        return (octect < BASELENGTH && base64Alphabet[octect] != -1);
-    }
-
-    /**
-     * Encodes hex octects into Base64
-     *
-     * @param binaryData Array containing binaryData
-     * @return Encoded Base64 array
-     */
-    public static String encode(byte[] binaryData) {
-
-        if (binaryData == null) {
-            return null;
-        }
-
-        int lengthDataBits = binaryData.length * EIGHTBIT;
-        if (lengthDataBits == 0) {
-            return "";
-        }
-
-        int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
-        int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
-        int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
-        char encodedData[] = null;
-
-        encodedData = new char[numberQuartet * 4];
-
-        byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
-
-        int encodedIndex = 0;
-        int dataIndex = 0;
-        if (fDebug) {
-            System.out.println("number of triplets = " + numberTriplets);
-        }
-
-        for (int i = 0; i < numberTriplets; i++) {
-            b1 = binaryData[dataIndex++];
-            b2 = binaryData[dataIndex++];
-            b3 = binaryData[dataIndex++];
-
-            if (fDebug) {
-                System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
-            }
-
-            l = (byte) (b2 & 0x0f);
-            k = (byte) (b1 & 0x03);
-
-            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
-            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
-            byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
-
-            if (fDebug) {
-                System.out.println("val2 = " + val2);
-                System.out.println("k4   = " + (k << 4));
-                System.out.println("vak  = " + (val2 | (k << 4)));
-            }
-
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
-        }
-
-        // form integral number of 6-bit groups
-        if (fewerThan24bits == EIGHTBIT) {
-            b1 = binaryData[dataIndex];
-            k = (byte) (b1 & 0x03);
-            if (fDebug) {
-                System.out.println("b1=" + b1);
-                System.out.println("b1<<2 = " + (b1 >> 2));
-            }
-            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
-            encodedData[encodedIndex++] = PAD;
-            encodedData[encodedIndex++] = PAD;
-        } else if (fewerThan24bits == SIXTEENBIT) {
-            b1 = binaryData[dataIndex];
-            b2 = binaryData[dataIndex + 1];
-            l = (byte) (b2 & 0x0f);
-            k = (byte) (b1 & 0x03);
-
-            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
-            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
-
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
-            encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
-            encodedData[encodedIndex++] = PAD;
-        }
-
-        return new String(encodedData);
-    }
-
-    /**
-     * Decodes Base64 data into octects
-     *
-     * @param encoded string containing Base64 data
-     * @return Array containind decoded data.
-     */
-    public static byte[] decode(String encoded) {
-
-        if (encoded == null) {
-            return null;
-        }
-
-        char[] base64Data = encoded.toCharArray();
-        // remove white spaces
-        int len = removeWhiteSpace(base64Data);
-
-        if (len % FOURBYTE != 0) {
-            return null;//should be divisible by four
-        }
-
-        int numberQuadruple = (len / FOURBYTE);
-
-        if (numberQuadruple == 0) {
-            return new byte[0];
-        }
-
-        byte decodedData[] = null;
-        byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
-        char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
-
-        int i = 0;
-        int encodedIndex = 0;
-        int dataIndex = 0;
-        decodedData = new byte[(numberQuadruple) * 3];
-
-        for (; i < numberQuadruple - 1; i++) {
-
-            if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
-                    || !isData((d3 = base64Data[dataIndex++]))
-                    || !isData((d4 = base64Data[dataIndex++]))) {
-                return null;
-            }//if found "no data" just return null
-
-            b1 = base64Alphabet[d1];
-            b2 = base64Alphabet[d2];
-            b3 = base64Alphabet[d3];
-            b4 = base64Alphabet[d4];
-
-            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
-            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
-            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
-        }
-
-        if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
-            return null;//if found "no data" just return null
-        }
-
-        b1 = base64Alphabet[d1];
-        b2 = base64Alphabet[d2];
-
-        d3 = base64Data[dataIndex++];
-        d4 = base64Data[dataIndex++];
-        if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
-            if (isPad(d3) && isPad(d4)) {
-                if ((b2 & 0xf) != 0)//last 4 bits should be zero
-                {
-                    return null;
-                }
-                byte[] tmp = new byte[i * 3 + 1];
-                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
-                tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
-                return tmp;
-            } else if (!isPad(d3) && isPad(d4)) {
-                b3 = base64Alphabet[d3];
-                if ((b3 & 0x3) != 0)//last 2 bits should be zero
-                {
-                    return null;
-                }
-                byte[] tmp = new byte[i * 3 + 2];
-                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
-                tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
-                tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
-                return tmp;
-            } else {
-                return null;
-            }
-        } else { //No PAD e.g 3cQl
-            b3 = base64Alphabet[d3];
-            b4 = base64Alphabet[d4];
-            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
-            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
-            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
-
-        }
-
-        return decodedData;
-    }
-
-    /**
-     * remove WhiteSpace from MIME containing encoded Base64 data.
-     *
-     * @param data the byte array of base64 data (with WS)
-     * @return the new length
-     */
-    private static int removeWhiteSpace(char[] data) {
-        if (data == null) {
-            return 0;
-        }
-
-        // count characters that's not whitespace
-        int newSize = 0;
-        int len = data.length;
-        for (int i = 0; i < len; i++) {
-            if (!isWhiteSpace(data[i])) {
-                data[newSize++] = data[i];
-            }
-        }
-        return newSize;
-    }
-}

+ 0 - 48
pay/src/main/java/pay/platform/common/sign/MD5.java

@@ -1,48 +0,0 @@
-package pay.platform.common.sign;
-
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-
-import java.security.MessageDigest;
-
-/**
- * MD5 签名
- * <p>
- * Created by HanleyTang on 2018/1/5
- *
- * @author Hanley[hanley @thlws.com]
- * @version 1.0
- */
-public class MD5 {
-
-    private static final Log log = LogFactory.get();
-
-    /**
-     * 签名得32位字符
-     *
-     * @param val the val
-     * @return the string
-     */
-    public static String sign(String val) {
-        char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-        try {
-            byte[] btInput = val.getBytes();
-            MessageDigest mdInst = MessageDigest.getInstance("MD5");
-            mdInst.update(btInput);
-            byte[] md = mdInst.digest();
-            int j = md.length;
-            char str[] = new char[j * 2];
-            int k = 0;
-            for (int i = 0; i < j; i++) {
-                byte byte0 = md[i];
-                str[k++] = hexDigits[byte0 >>> 4 & 0xf];
-                str[k++] = hexDigits[byte0 & 0xf];
-            }
-            return new String(str);
-        } catch (Exception e) {
-            log.error("MD5 sign error:{}", e.getMessage());
-            return null;
-        }
-    }
-
-}

+ 0 - 147
pay/src/main/java/pay/platform/common/sign/RSA.java

@@ -1,147 +0,0 @@
-
-package pay.platform.common.sign;
-
-import javax.crypto.Cipher;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.security.KeyFactory;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-
-/**
- * The type Rsa.
- */
-public class RSA {
-
-    /**
-     * The constant SIGN_ALGORITHMS.
-     */
-    public static final String SIGN_ALGORITHMS = "SHA1WithRSA";
-
-    /**
-     * RSA签名
-     *
-     * @param content       待签名数据
-     * @param privateKey    商户私钥
-     * @param input_charset 编码格式
-     * @return 签名值 string
-     */
-    public static String sign(String content, String privateKey, String input_charset) {
-        try {
-            PKCS8EncodedKeySpec priPKCS8 = new PKCS8EncodedKeySpec(Base64.decode(privateKey));
-            KeyFactory keyf = KeyFactory.getInstance("RSA");
-            PrivateKey priKey = keyf.generatePrivate(priPKCS8);
-
-            java.security.Signature signature = java.security.Signature
-                    .getInstance(SIGN_ALGORITHMS);
-
-            signature.initSign(priKey);
-            signature.update(content.getBytes(input_charset));
-
-            byte[] signed = signature.sign();
-
-            return Base64.encode(signed);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    /**
-     * RSA验签名检查
-     *
-     * @param content        待签名数据
-     * @param sign           签名值
-     * @param ali_public_key 支付宝公钥
-     * @param input_charset  编码格式
-     * @return 布尔值 boolean
-     */
-    public static boolean verify(String content, String sign, String ali_public_key, String input_charset) {
-        try {
-            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
-            byte[] encodedKey = Base64.decode(ali_public_key);
-            PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
-
-
-            java.security.Signature signature = java.security.Signature
-                    .getInstance(SIGN_ALGORITHMS);
-
-            signature.initVerify(pubKey);
-            signature.update(content.getBytes(input_charset));
-
-            boolean bverify = signature.verify(Base64.decode(sign));
-            return bverify;
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return false;
-    }
-
-    /**
-     * 解密
-     *
-     * @param content       密文
-     * @param private_key   商户私钥
-     * @param input_charset 编码格式
-     * @return 解密后的字符串 string
-     * @throws Exception the exception
-     */
-    public static String decrypt(String content, String private_key, String input_charset) throws Exception {
-        PrivateKey prikey = getPrivateKey(private_key);
-
-        Cipher cipher = Cipher.getInstance("RSA");
-        cipher.init(Cipher.DECRYPT_MODE, prikey);
-
-        InputStream ins = new ByteArrayInputStream(Base64.decode(content));
-        ByteArrayOutputStream writer = new ByteArrayOutputStream();
-        //rsa解密的字节大小最多是128,将需要解密的内容,按128位拆开解密
-        byte[] buf = new byte[128];
-        int bufl;
-
-        while ((bufl = ins.read(buf)) != -1) {
-            byte[] block = null;
-
-            if (buf.length == bufl) {
-                block = buf;
-            } else {
-                block = new byte[bufl];
-                for (int i = 0; i < bufl; i++) {
-                    block[i] = buf[i];
-                }
-            }
-
-            writer.write(cipher.doFinal(block));
-        }
-
-        return new String(writer.toByteArray(), input_charset);
-    }
-
-
-    /**
-     * 得到私钥
-     *
-     * @param key 密钥字符串(经过base64编码)
-     * @return the private key
-     * @throws Exception the exception
-     */
-    public static PrivateKey getPrivateKey(String key) throws Exception {
-
-        byte[] keyBytes;
-
-        keyBytes = Base64.decode(key);
-
-        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
-
-        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
-
-        PrivateKey privateKey = keyFactory.generatePrivate(keySpec);
-
-        return privateKey;
-    }
-}

+ 0 - 175
pay/src/main/java/pay/platform/common/utils/ConnUtil.java

@@ -1,175 +0,0 @@
-package pay.platform.common.utils;
-
-import cn.hutool.http.HttpUtil;
-import cn.hutool.http.Method;
-import cn.hutool.http.ssl.SSLSocketFactoryBuilder;
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLSocketFactory;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.security.KeyStore;
-
-
-/**
- * The type Conn util.
- */
-public final class ConnUtil {
-
-    private static final Log log = LogFactory.get();
-
-    private static final int CONNECTION_TIMEOUT = 1000 * 10;
-
-    private static final int SOCKET_TIMEOUT = 1000 * 10;
-
-    private static final int CONNECTION_REQUEST_TIMEOUT = 1000 * 30;
-
-    /**
-     * Conn remote string.
-     *
-     * @param request the request
-     * @param url     the url
-     * @return the string
-     * @throws Exception the exception
-     */
-    public static String connRemote(String request, String url) throws Exception {
-        String result = "";
-        try {
-            result = connRemoteWithJson(result, url);
-        } catch (Exception e) {
-            log.error("connRemote error: {}", e.getMessage());
-            throw new Exception(e.getMessage());
-        }
-        return result;
-    }
-
-
-    /**
-     * Conn remote with json string.
-     *
-     * @param json the json
-     * @param url  the url
-     * @return the string
-     * @throws Exception the exception
-     */
-    public static String connRemoteWithJson(String json, String url) throws Exception {
-
-        String result = "";
-        try {
-            result = HttpUtil.createRequest(Method.POST, url)
-                    .body(json, "application/json;charset=UTF-8")
-                    .execute().body();
-
-        } catch (Exception e) {
-            log.error("connRemoteWithJson error:{} ", e.getMessage());
-            throw new Exception(e.getMessage());
-        }
-
-        return result;
-    }
-
-
-    /**
-     * Conn remote with xml string.
-     *
-     * @param xml the xml
-     * @param url the url
-     * @return the string
-     * @throws Exception the exception
-     */
-    public static String connRemoteWithXml(String xml, String url) throws Exception {
-
-        String result;
-        try {
-            result = HttpUtil.createRequest(Method.POST, url)
-                    .body(xml, "text/xml;charset=UTF-8")
-                    .execute().body();
-        } catch (Exception e) {
-            log.error("connRemoteWithXml error: {}", e.getMessage());
-            throw new Exception(e.getMessage());
-        }
-
-        return result;
-    }
-
-
-    /**
-     * Encrypt post string.
-     *
-     * @param data         the data
-     * @param url          the url
-     * @param pwd          the pwd
-     * @param absoluteFile the absolute file
-     * @return the string
-     */
-    public static String encryptPost(String data, String url, String pwd, String absoluteFile) {
-
-        log.debug("请求网关:" + url);
-        log.debug("证书号:" + pwd);
-        log.debug("p12本地文件保存地址:" + absoluteFile);
-
-        String result;
-
-        try {
-            File p12File = new File(absoluteFile);
-            if (!p12File.exists()) {
-                log.error("p12文件不存在,请检查路径下是否存在p12:" + absoluteFile);
-                throw new FileNotFoundException("p12文件不存在,请检查路径下是否存在p12:" + absoluteFile);
-            }
-
-            //读取证书,初始化http相关参数
-            KeyStore keyStore = KeyStore.getInstance("PKCS12");
-            FileInputStream instream = new FileInputStream(new File(absoluteFile));
-            try {
-                keyStore.load(instream, pwd.toCharArray());
-            } finally {
-                instream.close();
-            }
-
-            // 实例化密钥库 & 初始化密钥工厂
-            KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
-            kmf.init(keyStore, pwd.toCharArray());
-            KeyManager[] keyManagers = kmf.getKeyManagers();
-
-            SSLSocketFactoryBuilder sslBuilder = SSLSocketFactoryBuilder.create();
-            SSLSocketFactory ssf = sslBuilder.setKeyManagers(keyManagers).build();
-
-            result = cn.hutool.http.HttpRequest.post(url)
-                    .body(data, "text/xml;charset=UTF-8")
-                    .setSSLSocketFactory(ssf)
-                    .execute()
-                    .body();
-
-        } catch (Exception e) {
-            result = e.getMessage();
-            log.error("encryptPost error:{}", e.getMessage());
-        }
-
-        return result;
-    }
-
-
-    /**
-     * Conn url string.
-     *
-     * @param url the url
-     * @return the string
-     * @throws Exception the exception
-     */
-    public static String connURL(String url) throws Exception {
-        String result;
-        try {
-            result = HttpUtil.get(url);
-        } catch (Exception e) {
-            log.error("connURL error:{} ", e.getMessage());
-            throw new Exception(e.getMessage());
-        }
-        return result;
-    }
-
-
-}

+ 0 - 50
pay/src/main/java/pay/platform/common/utils/JsonUtil.java

@@ -1,50 +0,0 @@
-package pay.platform.common.utils;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-
-/**
- * Created by HanleyTang on 2017/3/6.
- */
-public class JsonUtil {
-
-    /**
-     * Format string.
-     *
-     * @param o the o
-     * @return the string
-     */
-    public static String format(Object o) {
-        Gson gson = new GsonBuilder().setPrettyPrinting().create();
-        String prettyJson = gson.toJson(o);
-        return prettyJson;
-    }
-
-    /**
-     * Format string.
-     *
-     * @param uglyJson the ugly json
-     * @return the string
-     */
-    public static String format(String uglyJson) {
-        Gson gson = new GsonBuilder().setPrettyPrinting().create();
-        JsonParser jsonParser = new JsonParser();
-        JsonElement jsonElement = jsonParser.parse(uglyJson);
-        String prettyJson = gson.toJson(jsonElement);
-        return prettyJson;
-    }
-
-
-    /**
-     * Bean to jsontring string.
-     *
-     * @param bean the bean
-     * @return the string
-     */
-    public static String beanToJsontring(Object bean) {
-        return new Gson().toJson(bean);
-    }
-
-}

+ 0 - 289
pay/src/main/java/pay/platform/common/utils/ThlwsBeanUtil.java

@@ -1,289 +0,0 @@
-package pay.platform.common.utils;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.json.JSONUtil;
-import com.google.gson.Gson;
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.JAXBException;
-import jakarta.xml.bind.Marshaller;
-import jakarta.xml.bind.Unmarshaller;
-import org.dom4j.DocumentHelper;
-import org.dom4j.io.XMLWriter;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.nio.charset.StandardCharsets;
-import java.util.*;
-
-/**
- * The type Data util.
- *
- * @author Hanley Tang | hanley@thlws.com
- * @version 1.0
- */
-public class ThlwsBeanUtil {
-
-
-    /**
-     * Object to Map (will ignore null properties)
-     *
-     * @param o the o
-     * @return map map
-     * @author HanleyTang
-     */
-    public static Map<String, Object> objectToMap(Object o) {
-
-        return BeanUtil.beanToMap(o, false, true);
-    }
-
-
-    /***
-     * 去除空值
-     * @param map the map
-     * @return map map
-     * @author HanleyTang
-     */
-    public static Map<String, Object> dataFilter(Map<String, Object> map) {
-
-        Map<String, Object> result = new HashMap<>();
-        if (map == null || map.size() <= 0) {
-            return result;
-        }
-        for (String key : map.keySet()) {
-            Object value = map.get(key);
-            if (value == null || "".equals(value)) {
-                continue;
-            }
-            result.put(key, value);
-        }
-
-        return result;
-    }
-
-
-    /**
-     * 把数组所有元素排序,并按照“参数=参数值”的模式用 &amp; 字符拼接成字符串
-     *
-     * @param params 需要排序并参与字符拼接的参数组
-     * @return 拼接后字符串 string
-     */
-    public static String createLinkString(Map<String, Object> params) {
-        List<String> keys = new ArrayList<>(params.keySet());
-        Collections.sort(keys);
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < keys.size(); i++) {
-            String key = keys.get(i);
-            Object value = params.get(key);
-            //拼接时,不包括最后一个&字符
-            if (i == keys.size() - 1) {
-                sb.append(key).append("=").append(value);
-            } else {
-                sb.append(key).append("=").append(value).append("&");
-            }
-        }
-        return sb.toString();
-    }
-
-
-    /**
-     * map数据转换为GET URL后的参数
-     *
-     * @param mapData the map data
-     * @return string string
-     * @author HanleyTang
-     */
-    public static String mapToParams(Map<String, Object> mapData) {
-        StringBuilder sb = new StringBuilder();
-        if (mapData.isEmpty()) {
-            return "";
-        } else {
-            for (String key : mapData.keySet()) {
-                String value = (String) mapData.get(key);
-                if (sb.length() < 1) {
-                    sb.append(key).append("=").append(value);
-                } else {
-                    sb.append("&").append(key).append("=").append(value);
-                }
-            }
-            return sb.toString();
-        }
-    }
-
-
-    /**
-     * Map to object object.
-     *
-     * @param map       the map
-     * @param beanClass the bean class
-     * @return the object
-     */
-    public static Object mapToObject(Map<String, Object> map, Class<?> beanClass) {
-
-        return BeanUtil.mapToBean(map, beanClass, true);
-    }
-
-
-    /***
-     * generate MD5 text
-     * @param data the data
-     * @return md 5
-     * @author HanleyTang
-     */
-    public static String getMD5(String data) {
-        String s = null;
-        // 用来将字节转换成16进制表示的字符
-        char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-        try {
-            byte[] source = data.getBytes(StandardCharsets.UTF_8);
-            java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
-            md.update(source);
-            // MD5 的计算结果是一个 128 位的长整数,
-            byte tmp[] = md.digest();
-            // 用字节表示就是 16 个字节
-            char str[] = new char[16 * 2];
-            // 每个字节用 16 进制表示的话,使用两个字符, 所以表示成 16
-            // 进制需要 32 个字符
-            int k = 0;
-            // 表示转换结果中对应的字符位置
-            for (int i = 0; i < 16; i++) {
-                // 从第一个字节开始,对 MD5 的每一个字节
-                // 转换成 16
-                // 进制字符的转换
-                byte byte0 = tmp[i];
-                // 取第 i 个字节
-                str[k++] = hexDigits[byte0 >>> 4 & 0xf];
-                // 取字节中高 4 位的数字转换,// >>> // 为逻辑右移,将符号位一起右移
-                str[k++] = hexDigits[byte0 & 0xf];
-                // 取字节中低 4 位的数字转换
-            }
-            s = new String(str);
-            // 换后的结果转换为字符串
-        } catch (Exception e) {
-            //e.printStackTrace();
-        }
-        return s;
-    }
-
-
-    /***
-     * 随机数产生
-     * @param length 产生长度
-     * @return random string
-     * @author HanleyTang
-     */
-    public static String getRandomString(int length) { //length表示生成字符串的长度
-        String base = "abcdefghijklmnopqrstuvwxyz0123456789";
-        Random random = new Random();
-        StringBuffer sb = new StringBuffer();
-        for (int i = 0; i < length; i++) {
-            int number = random.nextInt(base.length());
-            sb.append(base.charAt(number));
-        }
-        return sb.toString();
-    }
-
-
-    /***
-     * 格式化XML
-     * @param xml the xml
-     * @return string
-     * @throws Exception the exception
-     */
-    public static String formatXml(String xml) throws Exception {
-        org.dom4j.Document document = DocumentHelper.parseText(xml);
-        org.dom4j.io.OutputFormat format = org.dom4j.io.OutputFormat.createPrettyPrint();
-        format.setEncoding("utf-8");
-        StringWriter writer = new StringWriter();
-        XMLWriter xmlWriter = new XMLWriter(writer, format);
-        xmlWriter.write(document);
-        xmlWriter.close();
-
-        return writer.toString();
-    }
-
-
-    /***
-     * bean to xml,调用此方便需在Bean配置相关Annotation
-     * @param clazz the clazz
-     * @param bean the bean
-     * @return string
-     * @throws JAXBException the jaxb exception
-     */
-    public static String beanToXml(Class clazz, Object bean) throws JAXBException {
-
-        StringWriter writer = new StringWriter();
-        ;
-        JAXBContext jaxbContext = JAXBContext.newInstance(clazz);
-        Marshaller marshaller = jaxbContext.createMarshaller();
-        //默认为false表示含xml头部信息,true不包含
-        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
-        marshaller.marshal(bean, writer);
-        return writer.toString();
-    }
-
-
-    /***
-     * xml to bean,调用此方便需在Bean配置相关Annotation
-     * @param <T>  the type parameter
-     * @param xml the xml
-     * @param cls the cls
-     * @return t
-     * @throws JAXBException the jaxb exception
-     */
-    public static <T> T xmlToBean(String xml, Class<T> cls) throws JAXBException {
-
-        StringReader reader = new StringReader(xml);
-        JAXBContext context = JAXBContext.newInstance(cls);
-        Unmarshaller unmarshaller = context.createUnmarshaller();
-        return (T) unmarshaller.unmarshal(reader);
-
-    }
-
-
-    /**
-     * 格式化JSON.
-     *
-     * @param o 任意对象
-     * @return 格式友好的 JSON String
-     */
-    public static String formatJson(Object o) {
-        return JSONUtil.parse(o).toStringPretty();
-    }
-
-    /**
-     * 格式化JSON.
-     *
-     * @param jsonStr JSON格式字符串
-     * @return 格式友好的 JSON String
-     */
-    public static String formatJson(String jsonStr) {
-        return JSONUtil.formatJsonStr(jsonStr);
-    }
-
-
-    /**
-     * Json to bean t.
-     *
-     * @param <T>  the type parameter
-     * @param json the json
-     * @param cls  the cls
-     * @return the t
-     */
-    public static <T> T jsonToBean(String json, Class<T> cls) {
-
-        Gson gson = new Gson();
-        return gson.fromJson(json, cls);
-    }
-
-
-    /**
-     * Bean to json string.
-     *
-     * @param o the o
-     * @return the string
-     */
-    public static String beanToJson(Object o) {
-        return new Gson().toJson(o);
-    }
-
-}

+ 0 - 142
pay/src/main/java/pay/platform/common/utils/ZxingUtil.java

@@ -1,142 +0,0 @@
-package pay.platform.common.utils;
-
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.EncodeHintType;
-import com.google.zxing.MultiFormatWriter;
-import com.google.zxing.client.j2se.MatrixToImageWriter;
-import com.google.zxing.common.BitMatrix;
-
-import java.io.File;
-import java.util.Hashtable;
-
-/***
- * 条形码 二维码 生成工具类
- */
-public class ZxingUtil {
-
-    /**
-     * The Qrcode default width.
-     */
-    static int qrcode_default_width = 250;
-    /**
-     * The Qrcode default height.
-     */
-    static int qrcode_default_height = 250;
-
-    /**
-     * The Barcode default width.
-     */
-    static int barcode_default_width = 700;
-    /**
-     * The Barcode default height.
-     */
-    static int barcode_default_height = 200;
-    private static final Log log = LogFactory.get();
-
-    /**
-     * Bar code.
-     *
-     * @param contents the contents
-     * @param imgPath  the img path
-     * @param width    the width
-     * @param height   the height
-     */
-    public static void barCode(String contents, String imgPath, int width, int height) {
-        int codeWidth = 3 +
-                (7 * 6) +
-                5 +
-                (7 * 6) +
-                3;
-        codeWidth = Math.max(codeWidth, width);
-        try {
-            BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, BarcodeFormat.CODE_128, codeWidth, height, null);
-            bitMatrix = deleteWhite(bitMatrix);
-            MatrixToImageWriter.writeToFile(bitMatrix, "png", new File(imgPath));
-        } catch (Exception e) {
-            log.error(e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Qr code.
-     *
-     * @param width   the width
-     * @param height  the height
-     * @param content the content
-     * @param suffix  the suffix
-     * @param imgPath the img path
-     */
-    public static void qrCode(int width, int height, String content, String suffix, String imgPath) {
-        Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>();
-        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
-        BitMatrix bitMatrix;
-        try {
-            bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints);
-            bitMatrix = deleteWhite(bitMatrix);
-            File outputFile = new File(imgPath);
-            MatrixToImageWriter.writeToFile(bitMatrix, suffix, outputFile);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Bar code.
-     *
-     * @param contents the contents
-     * @param imgPath  the img path
-     */
-    public static void barCode(String contents, String imgPath) {
-        barCode(contents, imgPath, barcode_default_width, barcode_default_height);
-    }
-
-
-    /**
-     * Qr code.
-     *
-     * @param content the content
-     * @param suffix  the suffix
-     * @param imgPath the img path
-     */
-    public static void qrCode(String content, String suffix, String imgPath) {
-        qrCode(qrcode_default_width, qrcode_default_height, content, suffix, imgPath);
-    }
-
-
-    /**
-     * Delete white bit matrix.
-     *
-     * @param matrix the matrix
-     * @return the bit matrix
-     */
-    public static BitMatrix deleteWhite(BitMatrix matrix) {
-        int[] rec = matrix.getEnclosingRectangle();
-        int resWidth = rec[2] + 1;
-        int resHeight = rec[3] + 1;
-
-        BitMatrix resMatrix = new BitMatrix(resWidth, resHeight);
-        resMatrix.clear();
-        for (int i = 0; i < resWidth; i++) {
-            for (int j = 0; j < resHeight; j++) {
-                if (matrix.get(i + rec[0], j + rec[1])) {
-                    resMatrix.set(i, j);
-                }
-            }
-        }
-        return resMatrix;
-    }
-
-
-    /**
-     * The entry point of application.
-     *
-     * @param args the input arguments
-     */
-    public static void main(String[] args) {
-        qrCode(250, 250, "18650002030j0803151618030", "png", "/zone/test.png");
-        barCode("18650002030j0803151618030", "/zone/barcode.png", 700, 200);
-    }
-}

+ 0 - 133
pay/src/main/java/pay/platform/payment/alipay/AlipayClient.java

@@ -1,133 +0,0 @@
-package pay.platform.payment.alipay;
-
-import cn.hutool.core.lang.Assert;
-import pay.platform.payment.alipay.core.AlipayCore;
-import pay.platform.payment.alipay.entity.request.*;
-import pay.platform.payment.alipay.entity.response.*;
-
-import java.util.Objects;
-
-/**
- * 支付宝支付入口Class
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-public class AlipayClient {
-
-    /**
-     * 手机网页支付
-     * {@link AlipayCore#payInMobileSite}
-     *
-     * @param request    request
-     * @param alipayCore alipayCore
-     * @return html string
-     * @throws Exception Exception
-     */
-    public static String payInMobileSite(AlipayMobileSiteRequest request, AlipayCore alipayCore) throws Exception {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be nul.");
-        Objects.requireNonNull(request, "AlipayMobileSiteRequest can not be null.");
-
-        return alipayCore.payInMobileSite(request);
-
-    }
-
-    /***
-     * 普通网站支付
-     * {@link AlipayCore#payInWebSite}
-     * @param request request
-     * @param alipayCore alipayCore
-     * @return html string
-     * @throws Exception Exception
-     */
-    public static String payInWebSite(AlipayWebSiteRequest request, AlipayCore alipayCore) throws Exception {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be nul.");
-        Objects.requireNonNull(request, "AlipayWebSiteRequest can not be null.");
-
-        return alipayCore.payInWebSite(request);
-    }
-
-
-    /***
-     * 支付宝预支付订单(用于用户主动扫码支付)
-     * {@link AlipayCore#preCreate}
-     * @param request the request
-     * @param alipayCore the alipay core
-     * @return alipay qrcode response
-     */
-    public static AlipayQrcodeResponse preCreate(AlipayQrcodeRequest request, AlipayCore alipayCore) {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be nul.");
-        Objects.requireNonNull(request, "AlipayQrcodeRequest can not be null.");
-
-        return alipayCore.preCreate(request);
-    }
-
-
-    /***
-     * 支付宝当面付,用户被扫码(商家扫用户手机收款码)
-     * {@link AlipayCore#pay}
-     * @param request the request
-     * @param alipayCore the alipay core
-     * @return alipay trade response
-     */
-    public static AlipayTradeResponse pay(AlipayTradeRequest request, AlipayCore alipayCore) {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be nul.");
-        Objects.requireNonNull(request, "AlipayTradeRequest can not be null.");
-
-        return alipayCore.pay(request);
-    }
-
-
-    /***
-     * 支付订单查询
-     * {@link AlipayCore#query}
-     * @param outTradeNo the out trade no
-     * @param alipayCore the alipay core
-     * @return alipay query response
-     */
-    public static AlipayQueryResponse query(String outTradeNo, AlipayCore alipayCore) {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be null.");
-        Assert.notEmpty(outTradeNo, "outTradeNo can not be null");
-
-        return alipayCore.query(outTradeNo);
-    }
-
-
-    /***
-     *
-     * 支付订单退款
-     * {@link AlipayCore#refund}
-     * @param request the request
-     * @param alipayCore the alipay core
-     * @return alipay refund response
-     * @throws Exception the exception
-     */
-    public static AlipayRefundResponse refund(AlipayRefundRequest request, AlipayCore alipayCore) throws Exception {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be null.");
-        Objects.requireNonNull(request, "AlipayRefundRequest can not be null.");
-
-        return alipayCore.refund(request);
-    }
-
-
-    /***
-     * 订单取消
-     * {@link AlipayCore#cancel}
-     * @param outTradeNo the out trade no
-     * @param alipayCore the alipay core
-     * @return alipay cancel response
-     */
-    public static AlipayCancelResponse cancel(String outTradeNo, AlipayCore alipayCore) {
-
-        Objects.requireNonNull(alipayCore, "alipayCore can not be null.");
-        Assert.notEmpty(outTradeNo, "outTradeNo can not be null.");
-
-        return alipayCore.cancel(outTradeNo);
-    }
-}

+ 0 - 591
pay/src/main/java/pay/platform/payment/alipay/core/AlipayCore.java

@@ -1,591 +0,0 @@
-package pay.platform.payment.alipay.core;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.lang.Assert;
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-import com.alipay.api.AlipayClient;
-import com.alipay.api.AlipayConstants;
-import com.alipay.api.DefaultAlipayClient;
-import com.alipay.api.request.AlipayTradePagePayRequest;
-import com.alipay.api.request.AlipayTradeWapPayRequest;
-import io.micrometer.common.util.StringUtils;
-import pay.platform.common.utils.JsonUtil;
-import pay.platform.payment.alipay.entity.request.*;
-import pay.platform.payment.alipay.entity.response.*;
-import pay.platform.payment.alipay.trade.model.ExtendParams;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-import pay.platform.payment.alipay.trade.model.builder.*;
-import pay.platform.payment.alipay.trade.model.result.*;
-import pay.platform.payment.alipay.trade.service.AlipayTradeService;
-import pay.platform.payment.alipay.trade.service.impl.AlipayTradeServiceImpl;
-
-import java.util.Objects;
-
-/**
- * 支付宝支付核心处理入口,封装支付常用API,包括当面付、新版网页支付、退款操作、订单查询;
- * 使用任何方法前,需先行设置ClientBuilder中核心参数,并调用build方法初始化.<br>
- * https://docs.open.alipay.com/api
- *
- * <pre>
- *  AlipayCore.ClientBuilder clientBuilderclientBuilder = new AlipayCore.ClientBuilder();
- *  AlipayCore alipayCore = .setAlipayPublicKey("xxx").setAppId("xxx").setPrivateKey("xxx").build();
- *  AlipayClient.pay(request,alipayCore);
- *  AlipayClient.refund(request,alipayCore);
- *  AlipayClient.preCreate(request,alipayCore);
- *  AlipayClient.query("out_trade_no",alipayCore);
- *  AlipayClient.payInMobileSite(request,alipayCore);
- * </pre>
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-public class AlipayCore {
-
-    private static final Log log = LogFactory.get();
-
-    /**
-     * 支付交易核心服务,调用API前,调用前API前先行初始化
-     */
-    private AlipayTradeService tradeService;
-
-    /**
-     * 支付宝核心参数构件器,调用前API前先行初始化
-     */
-    private ClientBuilder builder;
-
-
-    /***
-     * 参数构件第三步,初始化 tradeService,builder
-     * @param builder the builder
-     */
-    private AlipayCore(ClientBuilder builder) {
-
-        Assert.notEmpty(builder.getAppId(), "appId should not be NULL!");
-        Assert.notEmpty(builder.getPrivateKey(), "private should not be NULL!");
-        this.builder = builder;
-        AlipayTradeServiceImpl.ClientBuilder alipayTradebuilder = new AlipayTradeServiceImpl.ClientBuilder();
-        alipayTradebuilder.setAlipayPublicKey(builder.getAlipayPublicKey());
-        alipayTradebuilder.setAppid(builder.getAppId());
-        alipayTradebuilder.setCharset("utf-8");
-        alipayTradebuilder.setFormat("json");
-        // 线上环境
-        String gatewayUrl = "https://openapi.alipay.com/gateway.do";
-        // 沙箱环境
-        String sandboxGatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
-        alipayTradebuilder.setGatewayUrl(builder.isSandbox() ? sandboxGatewayUrl : gatewayUrl);
-        // 私钥
-        alipayTradebuilder.setPrivateKey(builder.getPrivateKey());
-        // 签名方式
-        alipayTradebuilder.setSignType(builder.getSignType());
-        tradeService = alipayTradebuilder.build();
-    }
-
-    /***
-     * 参数构件Class,参数构件第一步,请完成所有参数设置后调用build 方法.
-     */
-    public static class ClientBuilder {
-
-        private String privateKey;
-        private String alipayPublicKey;
-        private String appId;
-        private String signType;
-        private boolean isSandbox;
-
-        /***
-         * 参数构件第二步,构件supper class instance.
-         * Modified by Hanley
-         * @return the alipay core
-         */
-        public AlipayCore build() {
-
-            Assert.notEmpty(appId, "please set appid first!");
-            Assert.notEmpty(privateKey, "please set private_key first!");
-            Assert.notEmpty(signType, "please set sign_type first!");
-
-            if (signType.equalsIgnoreCase(AlipayConstants.SIGN_TYPE_RSA2)) {
-                Assert.notEmpty(alipayPublicKey, "please set alipay_public_key first,when the sign_type is RSA2!");
-            }
-
-            return new AlipayCore(this);
-        }
-
-        private String getPrivateKey() {
-            return privateKey;
-        }
-
-        /**
-         * Sets private key.
-         *
-         * @param privateKey the private key
-         * @return the private key
-         */
-        public ClientBuilder setPrivateKey(String privateKey) {
-            this.privateKey = privateKey;
-            return this;
-        }
-
-        private String getAlipayPublicKey() {
-            return alipayPublicKey;
-        }
-
-        /**
-         * Sets alipay public key.
-         *
-         * @param alipayPublicKey the alipay public key
-         * @return the alipay public key
-         */
-        public ClientBuilder setAlipayPublicKey(String alipayPublicKey) {
-            this.alipayPublicKey = alipayPublicKey;
-            return this;
-        }
-
-        /**
-         * Gets app id.
-         *
-         * @return the app id
-         */
-        public String getAppId() {
-            return appId;
-        }
-
-        /**
-         * Sets app id.
-         *
-         * @param appId the app id
-         * @return the app id
-         */
-        public ClientBuilder setAppId(String appId) {
-            this.appId = appId;
-            return this;
-        }
-
-        /**
-         * Gets sign type.
-         *
-         * @return the sign type
-         */
-        String getSignType() {
-            return signType;
-        }
-
-        /**
-         * Sets sign type.
-         *
-         * @param signType the sign type
-         * @return the sign type
-         */
-        public ClientBuilder setSignType(String signType) {
-            this.signType = signType;
-            return this;
-        }
-
-        /**
-         * 设置沙箱模式
-         *
-         * @param sandbox
-         * @return
-         */
-        public ClientBuilder setSandbox(boolean sandbox) {
-            isSandbox = sandbox;
-            return this;
-        }
-
-        /**
-         * 是否沙箱模式
-         *
-         * @return
-         */
-        public boolean isSandbox() {
-            return isSandbox;
-        }
-    }
-
-
-    /***
-     * 支付宝手机网页支付,支付宝新接口,在手机上可直接调用支付宝APP完成支付宝(有安装支付宝APP情况)<br>
-     * @param request the request 新版网页支付参数
-     * @return string 支付宝产生用于网页支付的html.
-     * @throws Exception the exception
-     * @see  <a href="https://docs.open.alipay.com/203/105285">https://docs.open.alipay.com/203/105285</a>
-     * @see  <a href="https://docs.open.alipay.com/203/105286">https://docs.open.alipay.com/203/105286</a>
-     */
-    public String payInMobileSite(AlipayMobileSiteRequest request) throws Exception {
-
-        if (log.isDebugEnabled()) {
-            log.debug("payInMobileSite request={}", request.toString());
-        }
-
-        String form = "<font style='color: red'>请求支付宝超时,请稍后再试!</font>";
-
-        try {
-            Assert.notNull(builder, " payInMobileSite -> Please set AlipayCore.ClientBuider first.");
-
-            String bizContent = JsonUtil.beanToJsontring(request.getBizContent());
-            AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
-                    builder.getAppId(), builder.getPrivateKey(), "json", "utf-8", builder.getAlipayPublicKey(), builder.getSignType());
-
-            AlipayTradeWapPayRequest alipayTradeWapPayRequest = new AlipayTradeWapPayRequest();
-            alipayTradeWapPayRequest.setReturnUrl(request.getReturnUrl());
-            alipayTradeWapPayRequest.setNotifyUrl(request.getNotifyUrl());
-            alipayTradeWapPayRequest.setBizContent(bizContent);
-            form = alipayClient.pageExecute(alipayTradeWapPayRequest).getBody();
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("payInMobileSite response={}", form);
-        }
-
-        return form;
-    }
-
-    /***
-     * 支付宝电脑网站支付,该操作会跳转到支付宝的支付页面中完成支付动作,以 异步/同步 的形式告知支付结果
-     * @param request 支付参数对象
-     * @return 返回支付宝页面, 直接输出在页面中 string
-     * @throws Exception 程序异常
-     */
-    public String payInWebSite(AlipayWebSiteRequest request) throws Exception {
-
-        log.debug("payInWebSite request={}", request.toString());
-        String form = "<font style='color: red'>请求支付宝超时,请稍后再试!</font>";
-
-        try {
-
-            Assert.notNull(builder, "payInWebSite-> Please set AlipayCore.ClientBuider first.");
-
-            String bizContent = JsonUtil.beanToJsontring(request.getBizContent());
-            AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
-                    builder.getAppId(), builder.getPrivateKey(), "json", "utf-8", builder.getAlipayPublicKey(), builder.getSignType());
-            AlipayTradePagePayRequest alipayTradePagePayRequest = new AlipayTradePagePayRequest();
-            alipayTradePagePayRequest.setReturnUrl(request.getReturnUrl());
-            alipayTradePagePayRequest.setNotifyUrl(request.getNotifyUrl());
-            alipayTradePagePayRequest.setBizContent(bizContent);
-            form = alipayClient.pageExecute(alipayTradePagePayRequest).getBody();
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("payInWebSite response={}", form);
-        }
-
-        return form;
-    }
-
-
-    /**
-     * 当面付.扫码支付,指用户打开支付宝钱包中的“扫一扫”功能,扫描商户针对每个订单实时生成的订单二维码,并在手机端确认支付。
-     * 收银员通过收银台或商户后台调用支付宝接口,生成二维码后,展示给用户,由用户扫描二维码完成订单支付。
-     *
-     * @param request the request 扫码支付所需参数
-     * @return the alipay qrcode response 扫码支付结果
-     * @see <a href="https://docs.open.alipay.com/194/105170">https://docs.open.alipay.com/194/105170</a>
-     */
-    public AlipayQrcodeResponse preCreate(AlipayQrcodeRequest request) {
-
-        log.debug("preCreate request={}", request.toString());
-        AlipayQrcodeResponse response = new AlipayQrcodeResponse();
-
-        try {
-
-            Objects.requireNonNull(tradeService, "Please set AlipayCore.ClientBuider first and call build().");
-
-            // 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
-            ExtendParams extendParams = new ExtendParams();
-            extendParams.setSysServiceProviderId(request.getSysServiceProviderId());
-
-            AlipayTradePrecreateRequestBuilder builder = new AlipayTradePrecreateRequestBuilder()
-                    .setSubject(request.getSubject())
-                    .setTotalAmount(request.getTotalAmount())
-                    .setOutTradeNo(request.getOutTradeNo())
-                    .setUndiscountableAmount(request.getUndiscountableAmount())
-                    .setSellerId(request.getSellerId())
-                    .setBody(request.getBody())
-                    .setOperatorId(request.getOperatorId())
-                    .setStoreId(request.getStoreId())
-                    .setExtendParams(extendParams);
-
-            AlipayF2FPrecreateResult result = tradeService.tradePrecreate(builder);
-            response.setSuccess(result.isTradeSuccess());
-            response.setSubCode(result.getResponse().getSubCode());
-            response.setSubMsg(result.getResponse().getSubMsg());
-            response.setCode(result.getResponse().getCode());
-            response.setMsg(result.getResponse().getMsg());
-
-            switch (result.getTradeStatus()) {
-                case SUCCESS:
-                    response.setDesc("支付宝预下单成功");
-                    response.setOutTradeNo(result.getResponse().getOutTradeNo());
-                    response.setQrCode(result.getResponse().getQrCode());
-                    break;
-                case FAILED:
-                    response.setDesc("支付宝预下单失败!");
-                    break;
-                case UNKNOWN:
-                    response.setDesc("系统异常,预下单状态未知!");
-                    break;
-                default:
-                    response.setDesc("不支持的交易状态,交易返回异常!");
-                    break;
-            }
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("precreate response={}", response.toString());
-        }
-        return response;
-    }
-
-    /***
-     * 当面付.条码支付,是支付宝给到线下传统行业的一种收款方式。商户使用扫码枪等条码识别设备扫描用户支付宝钱包上的条码/二维码,完成收款。用户仅需出示付款码,所有操作由商户端完成。
-     * @param request the request 条码支付 所需参数
-     * @return alipay trade response 条码支付所需参数
-     * @see  <a href="https://docs.open.alipay.com/194/105170">https://docs.open.alipay.com/194/105170</a>
-     */
-    public AlipayTradeResponse pay(AlipayTradeRequest request) {
-
-        log.debug("pay request={}", request.toString());
-        AlipayTradeResponse response = new AlipayTradeResponse();
-
-        try {
-
-            Objects.requireNonNull(tradeService, "Please set AlipayCore.ClientBuider first and call build().");
-
-            // 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
-            ExtendParams extendParams = new ExtendParams();
-            extendParams.setSysServiceProviderId(request.getSysServiceProviderId());
-
-            AlipayTradePayRequestBuilder builder = new AlipayTradePayRequestBuilder()
-                    //            .setAppAuthToken(appAuthToken)
-                    .setOutTradeNo(request.getOutTradeNo()).setSubject(request.getSubject()).setAuthCode(request.getAuthCode())
-                    .setTotalAmount(request.getTotalAmount()).setStoreId(request.getStoreId())
-                    .setUndiscountableAmount(request.getUndiscountableAmount()).setBody(request.getBody()).setOperatorId(request.getOperatorId())
-                    .setExtendParams(extendParams).setSellerId(request.getSellerId())
-                    .setGoodsDetailList(request.getGoodsDetailList());
-
-            AlipayF2FPayResult result = tradeService.tradePay(builder);
-
-            response.setSuccess(result.isTradeSuccess());
-            response.setSubCode(result.getResponse().getSubCode());
-            response.setSubMsg(result.getResponse().getSubMsg());
-            response.setCode(result.getResponse().getCode());
-            response.setMsg(result.getResponse().getMsg());
-
-            switch (result.getTradeStatus()) {
-                case SUCCESS:
-                    BeanUtil.copyProperties(result.getResponse(), response);
-                    response.setDesc("支付宝支付成功");
-                    break;
-                case FAILED:
-                    response.setDesc("支付宝支付失败");
-                    break;
-                case UNKNOWN:
-                    response.setDesc("系统异常,订单状态未知!");
-                    break;
-                default:
-                    response.setDesc("不支持的交易状态,交易返回异常!");
-                    break;
-            }
-
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("pay response={}", response.toString());
-        }
-        return response;
-    }
-
-
-    /**
-     * 查询支付订单.
-     *
-     * @param outTradeNo the out trade no
-     * @return the alipay query response
-     */
-    public AlipayQueryResponse query(String outTradeNo) {
-
-        log.debug("query outTradeNo={}", outTradeNo);
-        AlipayQueryResponse response = new AlipayQueryResponse();
-
-        try {
-            Objects.requireNonNull(tradeService, "Please set AlipayCore.ClientBuider first and call build().");
-
-            AlipayTradeQueryRequestBuilder builder = new AlipayTradeQueryRequestBuilder()
-                    .setOutTradeNo(outTradeNo);
-            AlipayF2FQueryResult result = tradeService.queryTradeResult(builder);
-            response.setSuccess(result.isTradeSuccess());
-
-            response.setSubCode(result.getResponse().getSubCode());
-            response.setSubMsg(result.getResponse().getSubMsg());
-            response.setCode(result.getResponse().getCode());
-            response.setMsg(result.getResponse().getMsg());
-
-            switch (result.getTradeStatus()) {
-                case TradeStatus.SUCCESS:
-                    BeanUtil.copyProperties(result.getResponse(), response);
-                    response.setDesc("查询返回该订单信息成功");
-                    response.setCode(result.getResponse().getCode());
-                    response.setMsg(result.getResponse().getMsg());
-                    break;
-                case TradeStatus.FAILED:
-                    response.setDesc("查询返回该订单支付失败或被关闭!");
-                    break;
-                case TradeStatus.UNKNOWN:
-                    response.setDesc("系统异常,订单支付状态未知!");
-                    break;
-                default:
-                    response.setDesc("不支持的交易状态,交易返回异常!");
-                    break;
-            }
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("query response={}", response.toString());
-        }
-        return response;
-    }
-
-
-    /**
-     * 支付宝退款,商户因业务原因需要退款时,可通过成功交易的商户订单号或支付宝交易号进行退款 ,支持部分退款。
-     * 退款接口会根据外部请求号out_request_no幂等返回,因此同一笔需要多次部分退款时,必须使用不同的out_request_no
-     *
-     * @param request the request 退款参数
-     * @return 退款结果 alipay refund response
-     * @throws Exception the exception
-     * @see <a href="https://docs.open.alipay.com/api_1/alipay.trade.refund">https://docs.open.alipay.com/api_1/alipay.trade.refund</a>
-     */
-    public AlipayRefundResponse refund(AlipayRefundRequest request) throws Exception {
-
-        log.debug("refund request={}", request.toString());
-
-        AlipayRefundResponse response = new AlipayRefundResponse();
-
-        try {
-            Objects.requireNonNull(tradeService, "Please set AlipayCore.ClientBuider first and call build().");
-
-            AlipayTradeRefundRequestBuilder builder = new AlipayTradeRefundRequestBuilder();
-
-            if (StringUtils.isBlank(request.getOutTradeNo()) && StringUtils.isBlank(request.getTradeNo())) {
-                throw new Exception("trade_no , out_trade_no 不能同时为空");
-            }
-            if (StringUtils.isBlank(request.getRefundAmount())) {
-                throw new Exception("refundAmount 不能为空");
-            }
-            if (StringUtils.isNotBlank(request.getOutTradeNo())) {
-                builder.setOutTradeNo(request.getOutTradeNo());
-            }
-            if (StringUtils.isNotBlank(request.getTradeNo())) {
-                builder.setTradeNo(request.getTradeNo());
-            }
-            if (StringUtils.isNotBlank(request.getRefundReason())) {
-                builder.setRefundReason(request.getRefundReason());
-            }
-            if (StringUtils.isNotBlank(request.getStoreId())) {
-                builder.setStoreId(request.getStoreId());
-            }
-            if (StringUtils.isNotBlank(request.getOutRequestNo())) {
-                builder.setOutRequestNo(request.getOutRequestNo());
-            }
-
-            //trade_no , out_trade_no 不能同时存在,否则支付宝会报错ACQ.TRADE_STATUS_ERROR.交易状态不合法
-            if (StringUtils.isNotBlank(builder.getOutTradeNo()) && StringUtils.isNotBlank(builder.getTradeNo())) {
-                builder.setTradeNo(null);
-            }
-
-            builder.setRefundAmount(request.getRefundAmount());
-            AlipayF2FRefundResult result = tradeService.tradeRefund(builder);
-            response.setSuccess(result.isTradeSuccess());
-            response.setSubCode(result.getResponse().getSubCode());
-            response.setSubMsg(result.getResponse().getSubMsg());
-            response.setCode(result.getResponse().getCode());
-            response.setMsg(result.getResponse().getMsg());
-
-            switch (result.getTradeStatus()) {
-                case TradeStatus.SUCCESS:
-                    BeanUtil.copyProperties(result.getResponse(), response);
-                    response.setDesc("支付宝退款成功");
-                    break;
-                case TradeStatus.FAILED:
-                    response.setDesc("支付宝退款失败");
-                    break;
-                case TradeStatus.UNKNOWN:
-                    response.setDesc("系统异常,订单退款状态未知!");
-                    break;
-                default:
-                    response.setDesc("不支持的交易状态,交易返回异常!");
-                    break;
-            }
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("refund response={}", response.toString());
-        }
-
-        return response;
-    }
-
-    /**
-     * 撤销订单
-     *
-     * @param outTradeNo the out trade no
-     * @return the alipay cancel response
-     */
-    public AlipayCancelResponse cancel(String outTradeNo) {
-        AlipayCancelResponse response = new AlipayCancelResponse();
-
-        try {
-
-            Objects.requireNonNull(tradeService, "Please set AlipayCore.ClientBuider first and call build().");
-
-            AlipayTradeCancelRequestBuilder builder = new AlipayTradeCancelRequestBuilder();
-            builder.setOutTradeNo(outTradeNo);
-
-            AlipayF2FCancelResult result = tradeService.tradeCancel_II(builder);
-            response.setSuccess(result.isTradeSuccess());
-            switch (result.getTradeStatus()) {
-                case SUCCESS:
-                    BeanUtil.copyProperties(result.getResponse(), response);
-                    response.setDesc("支付宝撤销成功");
-                    response.setCode(result.getResponse().getCode());
-                    response.setMsg(result.getResponse().getMsg());
-                    break;
-                case FAILED:
-                    response.setDesc("支付宝撤销失败");
-                    response.setSubCode(result.getResponse().getSubCode());
-                    response.setSubMsg(result.getResponse().getSubMsg());
-                    response.setCode(result.getResponse().getCode());
-                    response.setMsg(result.getResponse().getMsg());
-                    break;
-                case UNKNOWN:
-                    response.setDesc("系统异常,订单撤销状态未知!");
-                    response.setSubCode(result.getResponse().getSubCode());
-                    response.setSubMsg(result.getResponse().getSubMsg());
-                    response.setCode(result.getResponse().getCode());
-                    response.setMsg(result.getResponse().getMsg());
-                    break;
-                default:
-                    response.setDesc("不支持的交易状态,交易返回异常!");
-                    response.setSubCode(result.getResponse().getSubCode());
-                    response.setSubMsg(result.getResponse().getSubMsg());
-                    response.setCode(result.getResponse().getCode());
-                    response.setMsg(result.getResponse().getMsg());
-                    break;
-            }
-        } catch (Exception e) {
-            log.error(e);
-            throw e;
-        } finally {
-            log.debug("cancel response={}", response.toString());
-        }
-
-        return response;
-
-    }
-
-}

+ 0 - 70
pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayMobileSiteRequest.java

@@ -1,70 +0,0 @@
-package pay.platform.payment.alipay.entity.request;
-
-import com.google.gson.annotations.SerializedName;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-/**
- * 支付宝手机网页支付
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayMobileSiteRequest {
-
-    /**
-     * 业务参数
-     */
-    private BizContent bizContent;
-
-    /**
-     * 同步返回地址
-     */
-    private String returnUrl;
-
-    /**
-     * 异步通知地址
-     */
-    private String notifyUrl;
-
-
-    /**
-     * The type Biz content.
-     */
-    @Data
-    @Builder
-    @NoArgsConstructor
-    @AllArgsConstructor
-    public static class BizContent {
-
-        @SerializedName("out_trade_no")
-        private String outTradeNo;
-
-        @SerializedName("total_amount")
-        private String totalAmount;
-        private String subject;
-        @SerializedName("seller_id")
-        private String sellerId;
-
-        /***
-         * 手机网站支付应该是固定 'QUICK_WAP_WAY'
-         * @see <a href="https://docs.open.alipay.com/api_1/alipay.trade.wap.pay">https://docs.open.alipay.com/api_1/alipay.trade.wap.pay</a>
-         */
-        @Builder.Default
-        @SerializedName("product_code")
-        private String productCode = "QUICK_WAP_WAY";
-
-    }
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 83
pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayQrcodeRequest.java

@@ -1,83 +0,0 @@
-package pay.platform.payment.alipay.entity.request;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-import pay.platform.payment.alipay.trade.model.GoodsDetail;
-
-import java.io.Serial;
-import java.io.Serializable;
-import java.util.List;
-
-
-/**
- * 支付宝扫码支付,用户打开支付宝APP扫描Qrcode
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayQrcodeRequest implements Serializable {
-
-    @Serial
-    private static final long serialVersionUID = 7943982676695868533L;
-
-    /**
-     * (可选) 服务商ID
-     */
-    private String sysServiceProviderId;
-
-    /**
-     * (必填) 商户网站订单系统中唯一订单号,64个字符以内
-     */
-    private String outTradeNo;
-
-    /**
-     * (必填) 订单标题
-     */
-    private String subject;
-
-    /**
-     * (必填) 订单总金额
-     */
-    private String totalAmount;
-
-    /**
-     * (必填) 商户门店编号
-     */
-    private String storeId;
-
-    /**
-     * (可选) 订单不可打折金额
-     */
-    @Builder.Default
-    private String undiscountableAmount = "0";
-
-    /**
-     * (可选)卖家支付宝账号ID
-     */
-    @Builder.Default
-    private String sellerId = "";
-
-    /**
-     * 订单描述
-     */
-    private String body;
-
-    /**
-     * (可选) 商户操作员编号
-     */
-    private String operatorId;
-
-    private List<GoodsDetail> goodsDetailList;
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 57
pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayRefundRequest.java

@@ -1,57 +0,0 @@
-package pay.platform.payment.alipay.entity.request;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-/**
- * 支付宝退款
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayRefundRequest {
-
-    /**
-     * 支付宝交易号,tradeNo| outTradeNo二选一
-     */
-    private String tradeNo;
-
-    /**
-     * (特殊 tradeNo| outTradeNo二选一) 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线
-     */
-    private String outTradeNo;
-
-    /**
-     * (必填)退款金额
-     */
-    private String refundAmount;
-
-    /**
-     * (选填) 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
-     */
-    private String storeId;
-
-    /**
-     * (选填) 退款理由
-     */
-    private String refundReason;
-
-    /**
-     * 可选,部分退款时 必须
-     */
-    private String outRequestNo;
-
-    private String terminalId;
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 91
pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayTradeRequest.java

@@ -1,91 +0,0 @@
-package pay.platform.payment.alipay.entity.request;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.payment.alipay.trade.model.GoodsDetail;
-import pay.platform.common.utils.JsonUtil;
-
-import java.util.List;
-
-/**
- * 支付宝当面付
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayTradeRequest {
-
-    /**
-     * (可选) 服务商ID
-     */
-    private String sysServiceProviderId;
-
-    /**
-     * (必填) 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线
-     */
-    private String outTradeNo;
-
-    /**
-     * (必填) 订单标题,粗略描述用户的支付目的。如“xxx品牌xxx门店消费”
-     */
-    private String subject;
-
-    /**
-     * (必填) 订单总金额,单位为元,不能超过1亿元
-     */
-    private String totalAmount;
-
-    /**
-     * (必填) 付款条码,用户支付宝钱包手机app点击“付款”产生的付款条码
-     */
-    private String authCode;
-
-    /**
-     * (必填) 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
-     */
-    private String storeId;
-
-
-    /**
-     * (可选) 订单不可打折金额,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
-     * 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
-     */
-    private String undiscountableAmount;
-
-    /**
-     * (可选) 订单不可打折金额,与如上相反,与 undiscountableAmount 二选一
-     */
-    private String discountableAmount;
-
-    /***
-     *  卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
-     *  如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
-     */
-    private String sellerId;
-
-    /**
-     * 商户操作员编号,添加此参数可以为商户操作员做销售统计
-     */
-    private String operatorId;
-
-    /**
-     * 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品3件共20.00元"
-     */
-    private String body;
-
-    /**
-     * 产品明细
-     */
-    private List<GoodsDetail> goodsDetailList;
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 70
pay/src/main/java/pay/platform/payment/alipay/entity/request/AlipayWebSiteRequest.java

@@ -1,70 +0,0 @@
-package pay.platform.payment.alipay.entity.request;
-
-import com.google.gson.annotations.SerializedName;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-
-/**
- * 支付宝网站支付参数对象
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayWebSiteRequest {
-
-    /**
-     * 业务数据填充,json格式
-     */
-    private BizContent bizContent;
-
-    /**
-     * 同步处理地址
-     */
-    private String returnUrl;
-
-    /**
-     * 异步处理地址
-     */
-    private String notifyUrl;
-
-
-    /**
-     * The type Biz content.
-     */
-    @Data
-    @Builder
-    @NoArgsConstructor
-    @AllArgsConstructor
-    public static class BizContent {
-
-        @SerializedName(value = "out_trade_no")
-        private String outTradeNo;
-
-        @SerializedName(value = "total_amount")
-        private String totalAmount;
-        private String subject;
-        private String body;
-
-        /***
-         * 电脑网站支付应该是常量值'FAST_INSTANT_TRADE_PAY'
-         * @see <a href="https://docs.open.alipay.com/api_1/alipay.trade.page.pay">https://docs.open.alipay.com/api_1/alipay.trade.page.pay</a>
-         */
-        @Builder.Default
-        @SerializedName(value = "product_code")
-        private String productCode = "FAST_INSTANT_TRADE_PAY";
-
-    }
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 32
pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayCancelResponse.java

@@ -1,32 +0,0 @@
-package pay.platform.payment.alipay.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-/**
- * @author HanleyTang
- * date2017/3/8
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayCancelResponse {
-
-    private boolean isSuccess;
-    private String desc;
-
-    private String subCode;
-    private String subMsg;
-    private String code;
-    private String msg;
-
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 44
pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayNotifyResponse.java

@@ -1,44 +0,0 @@
-package pay.platform.payment.alipay.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * 支付异步通知,核心返回参数
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayNotifyResponse {
-
-
-    /**
-     * 验证是否成功 true 成功,false 失败
-     */
-    private boolean verifyFlg;
-
-    /**
-     * 商户订单号
-     */
-    private String outTradeNo;
-
-    /**
-     * 支付宝交易号
-     */
-    private String tradeNo;
-
-    /***
-     * WAIT_BUYER_PAY	交易创建,等待买家付款
-     * TRADE_CLOSED	    未付款交易超时关闭,或支付完成后全额退款
-     * TRADESUCCESS	    交易支付成功
-     * TRADEFINISHED	交易结束,不可退款
-     */
-    private String tradeStatus;
-
-}

+ 0 - 37
pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayQrcodeResponse.java

@@ -1,37 +0,0 @@
-package pay.platform.payment.alipay.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-import java.io.Serializable;
-
-/**
- * 支付宝扫码支付Response Bean,用户打开支付宝APP扫描Qrcode
- *
- * @author Hanley Tang
- * @version 1.0
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayQrcodeResponse implements Serializable {
-
-    private String outTradeNo;
-    private String qrCode;
-    private boolean isSuccess;
-    private String desc;
-    private String subCode;
-    private String subMsg;
-    private String code;
-    private String msg;
-
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 34
pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayQueryResponse.java

@@ -1,34 +0,0 @@
-package pay.platform.payment.alipay.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-/**
- * 支付宝订单查询
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayQueryResponse {
-
-    private boolean isSuccess;
-    private String desc;
-
-    private String subCode;
-    private String subMsg;
-    private String code;
-    private String msg;
-
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 33
pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayRefundResponse.java

@@ -1,33 +0,0 @@
-package pay.platform.payment.alipay.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-/**
- * 支付宝退款
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayRefundResponse {
-
-    private boolean isSuccess;
-    private String desc;
-
-    private String subCode;
-    private String subMsg;
-    private String code;
-    private String msg;
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 35
pay/src/main/java/pay/platform/payment/alipay/entity/response/AlipayTradeResponse.java

@@ -1,35 +0,0 @@
-package pay.platform.payment.alipay.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import pay.platform.common.utils.JsonUtil;
-
-
-/**
- * 支付宝付款结果
- *
- * @author hanley @thlws.com
- * 2018 /11/16
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AlipayTradeResponse {
-
-    private boolean isSuccess;
-    private String desc;
-
-    private String code;
-    private String msg;
-    private String subCode;
-    private String subMsg;
-
-
-    @Override
-    public String toString() {
-        return JsonUtil.format(this);
-    }
-}

+ 0 - 66
pay/src/main/java/pay/platform/payment/alipay/trade/config/Constants.java

@@ -1,66 +0,0 @@
-package pay.platform.payment.alipay.trade.config;
-
-/**
- * Created by liuyangkly on 15/7/29.
- * Modified by Hanley on 17/3/7
- */
-public class Constants {
-
-    private Constants() {
-        // No Constructor.
-    }
-
-    /**
-     * 成功
-     */
-    public static final String SUCCESS = "10000";
-    /**
-     * 用户支付中.
-     */
-    public static final String PAYING = "10003";
-    /**
-     * 失败.
-     */
-    public static final String FAILED = "40004";
-    /**
-     * 系统异常
-     */
-    public static final String ERROR = "20000";
-
-    /**
-     * 交易保障线程第一次调度延迟和调度间隔(秒)
-     */
-    public static final int heartbeat_delay = 5;
-    /**
-     * The constant heartbeat_duration.
-     */
-    public static final int heartbeat_duration = 900;
-
-    /**
-     * 当面付最大撤销次数和撤销间隔(毫秒)
-     */
-    public static final int cancel_duration = 2000;
-    /**
-     * The constant max_cancel_retry.
-     */
-    public static final int max_cancel_retry = 3;
-
-    /**
-     * 当面付最大查询次数和查询间隔(毫秒)
-     */
-    public static final int max_query_retry = 5;
-    /**
-     * The constant query_duration.
-     */
-    public static final int query_duration = 5000;
-
-
-    /**
-     * The constant open_api_domain.
-     */
-    public static final String open_api_domain = "https://openapi.alipay.com/gateway.do";
-    /**
-     * The constant mcloud_api_domain.
-     */
-    public static final String mcloud_api_domain = "http://mcloudmonitor.com/gateway.do";
-}

+ 0 - 42
pay/src/main/java/pay/platform/payment/alipay/trade/model/ExtendParams.java

@@ -1,42 +0,0 @@
-package pay.platform.payment.alipay.trade.model;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * @author liuyangkly
- * date15/6/26
- * 扩展信息
- */
-public class ExtendParams {
-
-    @SerializedName("sys_service_provider_id")
-    private String sysServiceProviderId;
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("ExtendParams{");
-        sb.append("sysServiceProviderId='").append(sysServiceProviderId).append('\'');
-        sb.append('}');
-        return sb.toString();
-    }
-
-    /**
-     * Gets sys service provider id.
-     *
-     * @return the sys service provider id
-     */
-    public String getSysServiceProviderId() {
-        return sysServiceProviderId;
-    }
-
-    /**
-     * Sets sys service provider id.
-     *
-     * @param sysServiceProviderId the sys service provider id
-     * @return the sys service provider id
-     */
-    public ExtendParams setSysServiceProviderId(String sysServiceProviderId) {
-        this.sysServiceProviderId = sysServiceProviderId;
-        return this;
-    }
-}

+ 0 - 222
pay/src/main/java/pay/platform/payment/alipay/trade/model/GoodsDetail.java

@@ -1,222 +0,0 @@
-package pay.platform.payment.alipay.trade.model;
-
-
-import com.google.gson.annotations.SerializedName;
-import pay.platform.payment.alipay.trade.utils.Utils;
-
-/**
- * @author liuyangkly
- * date15/6/26
- * 商品明细
- */
-public class GoodsDetail {
-
-    /**
-     * 商品编号(国标)
-     */
-    @SerializedName("goods_id")
-    private String goodsId;
-
-    @SerializedName("alipay_goods_id")
-    private String alipayGoodsId;
-
-    /**
-     * 商品名称
-     */
-    @SerializedName("goods_name")
-    private String goodsName;
-
-    /**
-     * 商品数量
-     */
-    private int quantity;
-
-    /**
-     * 商品价格,此处单位为元,精确到小数点后2位
-     */
-    private String price;
-
-    /**
-     * 商品类别
-     */
-    @SerializedName("goods_category")
-    private String goodsCategory;
-
-    /**
-     * 商品详情
-     */
-    private String body;
-
-    /**
-     * New instance goods detail.
-     *
-     * @param goodsId   the goods id
-     * @param goodsName the goods name
-     * @param price     the price
-     * @param quantity  the quantity
-     * @return the goods detail
-     */
-// 创建一个商品信息,参数含义分别为商品id(使用国标)、商品名称、商品价格(单位为分)、商品数量
-    public static GoodsDetail newInstance(String goodsId, String goodsName, long price, int quantity) {
-        GoodsDetail info = new GoodsDetail();
-        info.setGoodsId(goodsId);
-        info.setGoodsName(goodsName);
-        info.setPrice(price);
-        info.setQuantity(quantity);
-        return info;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("GoodsDetail{");
-        sb.append("goodsId='").append(goodsId).append('\'');
-        sb.append(", alipayGoodsId='").append(alipayGoodsId).append('\'');
-        sb.append(", goodsName='").append(goodsName).append('\'');
-        sb.append(", quantity=").append(quantity);
-        sb.append(", price='").append(price).append('\'');
-        sb.append(", goodsCategory='").append(goodsCategory).append('\'');
-        sb.append(", body='").append(body).append('\'');
-        sb.append('}');
-        return sb.toString();
-    }
-
-    /**
-     * Gets goods id.
-     *
-     * @return the goods id
-     */
-    public String getGoodsId() {
-        return goodsId;
-    }
-
-    /**
-     * Sets goods id.
-     *
-     * @param goodsId the goods id
-     * @return the goods id
-     */
-    public GoodsDetail setGoodsId(String goodsId) {
-        this.goodsId = goodsId;
-        return this;
-    }
-
-    /**
-     * Gets alipay goods id.
-     *
-     * @return the alipay goods id
-     */
-    public String getAlipayGoodsId() {
-        return alipayGoodsId;
-    }
-
-    /**
-     * Sets alipay goods id.
-     *
-     * @param alipayGoodsId the alipay goods id
-     * @return the alipay goods id
-     */
-    public GoodsDetail setAlipayGoodsId(String alipayGoodsId) {
-        this.alipayGoodsId = alipayGoodsId;
-        return this;
-    }
-
-    /**
-     * Gets goods name.
-     *
-     * @return the goods name
-     */
-    public String getGoodsName() {
-        return goodsName;
-    }
-
-    /**
-     * Sets goods name.
-     *
-     * @param goodsName the goods name
-     * @return the goods name
-     */
-    public GoodsDetail setGoodsName(String goodsName) {
-        this.goodsName = goodsName;
-        return this;
-    }
-
-    /**
-     * Gets quantity.
-     *
-     * @return the quantity
-     */
-    public int getQuantity() {
-        return quantity;
-    }
-
-    /**
-     * Sets quantity.
-     *
-     * @param quantity the quantity
-     * @return the quantity
-     */
-    public GoodsDetail setQuantity(int quantity) {
-        this.quantity = quantity;
-        return this;
-    }
-
-    /**
-     * Gets price.
-     *
-     * @return the price
-     */
-    public String getPrice() {
-        return price;
-    }
-
-    /**
-     * Sets price.
-     *
-     * @param price the price
-     * @return the price
-     */
-    public GoodsDetail setPrice(long price) {
-        this.price = Utils.toAmount(price);
-        return this;
-    }
-
-    /**
-     * Gets goods category.
-     *
-     * @return the goods category
-     */
-    public String getGoodsCategory() {
-        return goodsCategory;
-    }
-
-    /**
-     * Sets goods category.
-     *
-     * @param goodsCategory the goods category
-     * @return the goods category
-     */
-    public GoodsDetail setGoodsCategory(String goodsCategory) {
-        this.goodsCategory = goodsCategory;
-        return this;
-    }
-
-    /**
-     * Gets body.
-     *
-     * @return the body
-     */
-    public String getBody() {
-        return body;
-    }
-
-    /**
-     * Sets body.
-     *
-     * @param body the body
-     * @return the body
-     */
-    public GoodsDetail setBody(String body) {
-        this.body = body;
-        return this;
-    }
-}

+ 0 - 20
pay/src/main/java/pay/platform/payment/alipay/trade/model/TradeStatus.java

@@ -1,20 +0,0 @@
-package pay.platform.payment.alipay.trade.model;
-
-/**
- * @author liuyangkly
- * date15/8/29
- */
-public enum TradeStatus {
-    /**
-     * 业务交易明确成功,比如支付成功、退货成功
-     */
-    SUCCESS,
-    /**
-     * 业务交易明确失败,比如支付明确失败、退货明确失败
-     */
-    FAILED,
-    /**
-     * 业务交易状态未知,此时不清楚该业务是否成功或者失败,需要商户自行确认
-     */
-    UNKNOWN
-}

+ 0 - 564
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayHeartbeatSynRequestBuilder.java

@@ -1,564 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import com.alipay.api.internal.util.StringUtils;
-import com.google.gson.annotations.SerializedName;
-import pay.platform.payment.alipay.trade.model.hb.*;
-import pay.platform.payment.alipay.trade.utils.Utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author liuyangkly
- * date16/3/2
- */
-public class AlipayHeartbeatSynRequestBuilder extends RequestBuilder {
-
-    private BizContent bizContent = new BizContent();
-
-    @Override
-    public BizContent getBizContent() {
-        return bizContent;
-    }
-
-    @Override
-    public boolean validate() {
-        if (bizContent.product == null) {
-            throw new NullPointerException("product should not be NULL!");
-        }
-        if (bizContent.type == null) {
-            throw new NullPointerException("type should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.equipmentId)) {
-            throw new NullPointerException("equipment_id should not be NULL!");
-        }
-        if (bizContent.equipmentStatus == null) {
-            throw new NullPointerException("equipment_status should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.time)) {
-            throw new NullPointerException("time should not be NULL!");
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("AlipayHeartbeatSynRequestBuilder{");
-        sb.append("bizContent=").append(bizContent);
-        sb.append(", super=").append(super.toString());
-        sb.append('}');
-        return sb.toString();
-    }
-
-    @Override
-    public AlipayHeartbeatSynRequestBuilder setAppAuthToken(String appAuthToken) {
-        return (AlipayHeartbeatSynRequestBuilder) super.setAppAuthToken(appAuthToken);
-    }
-
-    @Override
-    public AlipayHeartbeatSynRequestBuilder setNotifyUrl(String notifyUrl) {
-        return (AlipayHeartbeatSynRequestBuilder) super.setNotifyUrl(notifyUrl);
-    }
-
-    /**
-     * Gets mac.
-     *
-     * @return the mac
-     */
-    public String getMac() {
-        return bizContent.mac;
-    }
-
-    /**
-     * Sets mac.
-     *
-     * @param mac the mac
-     * @return the mac
-     */
-    public AlipayHeartbeatSynRequestBuilder setMac(String mac) {
-        bizContent.mac = mac;
-        return this;
-    }
-
-    /**
-     * Gets network type.
-     *
-     * @return the network type
-     */
-    public String getNetworkType() {
-        return bizContent.networkType;
-    }
-
-    /**
-     * Sets network type.
-     *
-     * @param networkType the network type
-     * @return the network type
-     */
-    public AlipayHeartbeatSynRequestBuilder setNetworkType(String networkType) {
-        bizContent.networkType = networkType;
-        return this;
-    }
-
-    /**
-     * Gets battery.
-     *
-     * @return the battery
-     */
-    public String getBattery() {
-        return bizContent.battery;
-    }
-
-    /**
-     * Sets battery.
-     *
-     * @param battery the battery
-     * @return the battery
-     */
-    public AlipayHeartbeatSynRequestBuilder setBattery(String battery) {
-        bizContent.battery = battery;
-        return this;
-    }
-
-    /**
-     * Gets wifi mac.
-     *
-     * @return the wifi mac
-     */
-    public String getWifiMac() {
-        return bizContent.wifiMac;
-    }
-
-    /**
-     * Sets wifi mac.
-     *
-     * @param wifiMac the wifi mac
-     * @return the wifi mac
-     */
-    public AlipayHeartbeatSynRequestBuilder setWifiMac(String wifiMac) {
-        bizContent.wifiMac = wifiMac;
-        return this;
-    }
-
-    /**
-     * Gets wifi name.
-     *
-     * @return the wifi name
-     */
-    public String getWifiName() {
-        return bizContent.wifiName;
-    }
-
-    /**
-     * Sets wifi name.
-     *
-     * @param wifiName the wifi name
-     * @return the wifi name
-     */
-    public AlipayHeartbeatSynRequestBuilder setWifiName(String wifiName) {
-        bizContent.wifiName = wifiName;
-        return this;
-    }
-
-    /**
-     * Gets network status.
-     *
-     * @return the network status
-     */
-    public String getNetworkStatus() {
-        return bizContent.networkStatus;
-    }
-
-    /**
-     * Sets network status.
-     *
-     * @param networkStatus the network status
-     * @return the network status
-     */
-    public AlipayHeartbeatSynRequestBuilder setNetworkStatus(String networkStatus) {
-        bizContent.networkStatus = networkStatus;
-        return this;
-    }
-
-    /**
-     * Gets bbs position.
-     *
-     * @return the bbs position
-     */
-    public String getBbsPosition() {
-        return bizContent.bbsPosition;
-    }
-
-    /**
-     * Sets bbs position.
-     *
-     * @param bbsPosition the bbs position
-     * @return the bbs position
-     */
-    public AlipayHeartbeatSynRequestBuilder setBbsPosition(String bbsPosition) {
-        bizContent.bbsPosition = bbsPosition;
-        return this;
-    }
-
-    /**
-     * Gets manufacturer pid.
-     *
-     * @return the manufacturer pid
-     */
-    public String getManufacturerPid() {
-        return bizContent.manufacturerPid;
-    }
-
-    /**
-     * Sets manufacturer pid.
-     *
-     * @param manufacturerPid the manufacturer pid
-     * @return the manufacturer pid
-     */
-    public AlipayHeartbeatSynRequestBuilder setManufacturerPid(String manufacturerPid) {
-        bizContent.manufacturerPid = manufacturerPid;
-        return this;
-    }
-
-    /**
-     * Gets provider id.
-     *
-     * @return the provider id
-     */
-    public String getProviderId() {
-        return bizContent.providerId;
-    }
-
-    /**
-     * Sets provider id.
-     *
-     * @param providerId the provider id
-     * @return the provider id
-     */
-    public AlipayHeartbeatSynRequestBuilder setProviderId(String providerId) {
-        bizContent.providerId = providerId;
-        return this;
-    }
-
-    /**
-     * Gets equipment id.
-     *
-     * @return the equipment id
-     */
-    public String getEquipmentId() {
-        return bizContent.equipmentId;
-    }
-
-    /**
-     * Sets equipment id.
-     *
-     * @param equipmentId the equipment id
-     * @return the equipment id
-     */
-    public AlipayHeartbeatSynRequestBuilder setEquipmentId(String equipmentId) {
-        bizContent.equipmentId = equipmentId;
-        return this;
-    }
-
-    /**
-     * Gets equipment position.
-     *
-     * @return the equipment position
-     */
-    public String getEquipmentPosition() {
-        return bizContent.equipmentPosition;
-    }
-
-    /**
-     * Sets equipment position.
-     *
-     * @param equipmentPosition the equipment position
-     * @return the equipment position
-     */
-    public AlipayHeartbeatSynRequestBuilder setEquipmentPosition(String equipmentPosition) {
-        bizContent.equipmentPosition = equipmentPosition;
-        return this;
-    }
-
-    /**
-     * Gets equipment status.
-     *
-     * @return the equipment status
-     */
-    public EquipStatus getEquipmentStatus() {
-        return bizContent.equipmentStatus;
-    }
-
-    /**
-     * Sets equipment status.
-     *
-     * @param equipmentStatus the equipment status
-     * @return the equipment status
-     */
-    public AlipayHeartbeatSynRequestBuilder setEquipmentStatus(EquipStatus equipmentStatus) {
-        bizContent.equipmentStatus = equipmentStatus;
-        return this;
-    }
-
-    /**
-     * Gets exception info list.
-     *
-     * @return the exception info list
-     */
-    public List<ExceptionInfo> getExceptionInfoList() {
-        return bizContent.exceptionInfoList;
-    }
-
-    /**
-     * Sets exception info list.
-     *
-     * @param exceptionInfoList the exception info list
-     * @return the exception info list
-     */
-    public AlipayHeartbeatSynRequestBuilder setExceptionInfoList(List<ExceptionInfo> exceptionInfoList) {
-        bizContent.exceptionInfoList = exceptionInfoList;
-        return this;
-    }
-
-    /**
-     * Gets extend info.
-     *
-     * @return the extend info
-     */
-    public Map<String, Object> getExtendInfo() {
-        return bizContent.extendInfo;
-    }
-
-    /**
-     * Sets extend info.
-     *
-     * @param extendInfo the extend info
-     * @return the extend info
-     */
-    public AlipayHeartbeatSynRequestBuilder setExtendInfo(Map<String, Object> extendInfo) {
-        bizContent.extendInfo = extendInfo;
-        return this;
-    }
-
-    /**
-     * Gets ip.
-     *
-     * @return the ip
-     */
-    public String getIp() {
-        return bizContent.ip;
-    }
-
-    /**
-     * Sets ip.
-     *
-     * @param ip the ip
-     * @return the ip
-     */
-    public AlipayHeartbeatSynRequestBuilder setIp(String ip) {
-        bizContent.ip = ip;
-        return this;
-    }
-
-    /**
-     * Gets product.
-     *
-     * @return the product
-     */
-    public Product getProduct() {
-        return bizContent.product;
-    }
-
-    /**
-     * Sets product.
-     *
-     * @param product the product
-     * @return the product
-     */
-    public AlipayHeartbeatSynRequestBuilder setProduct(Product product) {
-        bizContent.product = product;
-        return this;
-    }
-
-    /**
-     * Gets store id.
-     *
-     * @return the store id
-     */
-    public String getStoreId() {
-        return bizContent.storeId;
-    }
-
-    /**
-     * Sets store id.
-     *
-     * @param storeId the store id
-     * @return the store id
-     */
-    public AlipayHeartbeatSynRequestBuilder setStoreId(String storeId) {
-        bizContent.storeId = storeId;
-        return this;
-    }
-
-    /**
-     * Gets time.
-     *
-     * @return the time
-     */
-    public String getTime() {
-        return bizContent.time;
-    }
-
-    /**
-     * Sets time.
-     *
-     * @param time the time
-     * @return the time
-     */
-    public AlipayHeartbeatSynRequestBuilder setTime(String time) {
-        bizContent.time = time;
-        return this;
-    }
-
-    /**
-     * Gets trade info list.
-     *
-     * @return the trade info list
-     */
-    public List<TradeInfo> getTradeInfoList() {
-        return bizContent.tradeInfoList;
-    }
-
-    /**
-     * Sets sys trade info list.
-     *
-     * @param sysTradeInfoList the sys trade info list
-     * @return the sys trade info list
-     */
-    public AlipayHeartbeatSynRequestBuilder setSysTradeInfoList(List<SysTradeInfo> sysTradeInfoList) {
-        if (Utils.isListNotEmpty(sysTradeInfoList)) {
-            bizContent.tradeInfoList = new ArrayList<TradeInfo>(sysTradeInfoList);
-        }
-        return this;
-    }
-
-    /**
-     * Sets pos trade info list.
-     *
-     * @param posTradeInfoList the pos trade info list
-     * @return the pos trade info list
-     */
-    public AlipayHeartbeatSynRequestBuilder setPosTradeInfoList(List<PosTradeInfo> posTradeInfoList) {
-        if (Utils.isListNotEmpty(posTradeInfoList)) {
-            bizContent.tradeInfoList = new ArrayList<TradeInfo>(posTradeInfoList);
-        }
-        return this;
-    }
-
-    /**
-     * Gets type.
-     *
-     * @return the type
-     */
-    public Type getType() {
-        return bizContent.type;
-    }
-
-    /**
-     * Sets type.
-     *
-     * @param type the type
-     * @return the type
-     */
-    public AlipayHeartbeatSynRequestBuilder setType(Type type) {
-        bizContent.type = type;
-        return this;
-    }
-
-    /**
-     * The type Biz content.
-     */
-    public static class BizContent {
-        private Product product;
-
-        private Type type;
-
-        @SerializedName("equipment_id")
-        private String equipmentId;
-
-        @SerializedName("equipment_status")
-        private EquipStatus equipmentStatus;
-
-        private String time;
-
-        @SerializedName("manufacturer_app_id")
-        private String manufacturerPid;
-
-        @SerializedName("sys_service_provider_id")
-        private String providerId;
-
-        @SerializedName("store_id")
-        private String storeId;
-
-        @SerializedName("equipment_position")
-        private String equipmentPosition;
-
-        @SerializedName("bbs_position")
-        private String bbsPosition;
-
-        @SerializedName("network_status")
-        private String networkStatus;
-
-        @SerializedName("network_type")
-        private String networkType;
-
-        private String battery;
-
-        @SerializedName("wifi_mac")
-        private String wifiMac;
-
-        @SerializedName("wifi_name")
-        private String wifiName;
-
-        private String ip;
-
-        private String mac;
-
-        @SerializedName("trade_info")
-        private List<TradeInfo> tradeInfoList;
-
-        @SerializedName("exception_info")
-        private List<ExceptionInfo> exceptionInfoList;
-
-        @SerializedName("extend_info")
-        private Map<String, Object> extendInfo;
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder("BizContent{");
-            sb.append("product=").append(product);
-            sb.append(", type=").append(type);
-            sb.append(", equipmentId='").append(equipmentId).append('\'');
-            sb.append(", equipmentStatus=").append(equipmentStatus);
-            sb.append(", time='").append(time).append('\'');
-            sb.append(", manufacturerPid='").append(manufacturerPid).append('\'');
-            sb.append(", providerId='").append(providerId).append('\'');
-            sb.append(", storeId='").append(storeId).append('\'');
-            sb.append(", equipmentPosition='").append(equipmentPosition).append('\'');
-            sb.append(", bbsPosition='").append(bbsPosition).append('\'');
-            sb.append(", networkStatus='").append(networkStatus).append('\'');
-            sb.append(", networkType='").append(networkType).append('\'');
-            sb.append(", battery='").append(battery).append('\'');
-            sb.append(", wifiMac='").append(wifiMac).append('\'');
-            sb.append(", wifiName='").append(wifiName).append('\'');
-            sb.append(", ip='").append(ip).append('\'');
-            sb.append(", mac='").append(mac).append('\'');
-            sb.append(", tradeInfoList=").append(tradeInfoList);
-            sb.append(", exceptionInfoList=").append(exceptionInfoList);
-            sb.append(", extendInfo=").append(extendInfo);
-            sb.append('}');
-            return sb.toString();
-        }
-    }
-}

+ 0 - 82
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradeCancelRequestBuilder.java

@@ -1,82 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import com.google.gson.annotations.SerializedName;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * @author liuyangkly
- * date16/3/3
- */
-public class AlipayTradeCancelRequestBuilder extends RequestBuilder {
-
-    private BizContent bizContent = new BizContent();
-
-    @Override
-    public BizContent getBizContent() {
-        return bizContent;
-    }
-
-    @Override
-    public boolean validate() {
-        if (StringUtils.isEmpty(bizContent.outTradeNo)) {
-            throw new NullPointerException("out_trade_no should not be NULL!");
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("AlipayTradeCancelRequestBuilder{");
-        sb.append("bizContent=").append(bizContent);
-        sb.append(", super=").append(super.toString());
-        sb.append('}');
-        return sb.toString();
-    }
-
-    @Override
-    public AlipayTradeCancelRequestBuilder setAppAuthToken(String appAuthToken) {
-        return (AlipayTradeCancelRequestBuilder) super.setAppAuthToken(appAuthToken);
-    }
-
-    @Override
-    public AlipayTradeCancelRequestBuilder setNotifyUrl(String notifyUrl) {
-        return (AlipayTradeCancelRequestBuilder) super.setNotifyUrl(notifyUrl);
-    }
-
-    /**
-     * Gets out trade no.
-     *
-     * @return the out trade no
-     */
-    public String getOutTradeNo() {
-        return bizContent.outTradeNo;
-    }
-
-    /**
-     * Sets out trade no.
-     *
-     * @param outTradeNo the out trade no
-     * @return the out trade no
-     */
-    public AlipayTradeCancelRequestBuilder setOutTradeNo(String outTradeNo) {
-        bizContent.outTradeNo = outTradeNo;
-        return this;
-    }
-
-    /**
-     * The type Biz content.
-     */
-    public static class BizContent {
-        // 商户订单号,通过此商户订单号撤销当面付的交易状态
-        @SerializedName("out_trade_no")
-        private String outTradeNo;
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder("BizContent{");
-            sb.append("outTradeNo='").append(outTradeNo).append('\'');
-            sb.append('}');
-            return sb.toString();
-        }
-    }
-}

+ 0 - 518
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradePayRequestBuilder.java

@@ -1,518 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import com.google.gson.annotations.SerializedName;
-import org.apache.commons.lang3.StringUtils;
-import pay.platform.payment.alipay.trade.model.ExtendParams;
-import pay.platform.payment.alipay.trade.model.GoodsDetail;
-
-import java.util.List;
-import java.util.regex.Pattern;
-
-/**
- * @author liuyangkly
- * date16/3/3
- */
-public class AlipayTradePayRequestBuilder extends RequestBuilder {
-
-    private BizContent bizContent = new BizContent();
-
-    @Override
-    public BizContent getBizContent() {
-        return bizContent;
-    }
-
-    @Override
-    public boolean validate() {
-        if (StringUtils.isEmpty(bizContent.scene)) {
-            throw new NullPointerException("scene should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.authCode)) {
-            throw new NullPointerException("auth_code should not be NULL!");
-        }
-        if (!Pattern.matches("^\\d{10,}$", bizContent.authCode)) {
-            throw new IllegalStateException("invalid auth_code!");
-        }
-        if (StringUtils.isEmpty(bizContent.outTradeNo)) {
-            throw new NullPointerException("out_trade_no should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.totalAmount)) {
-            throw new NullPointerException("total_amount should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.subject)) {
-            throw new NullPointerException("subject should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.storeId)) {
-            throw new NullPointerException("store_id should not be NULL!");
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("AlipayTradePayRequestBuilder{");
-        sb.append("bizContent=").append(bizContent);
-        sb.append(", super=").append(super.toString());
-        sb.append('}');
-        return sb.toString();
-    }
-
-    /**
-     * Instantiates a new Alipay trade pay request builder.
-     */
-    public AlipayTradePayRequestBuilder() {
-        // 条码支付,场景为bar_code
-        bizContent.scene = "bar_code";
-    }
-
-    @Override
-    public AlipayTradePayRequestBuilder setAppAuthToken(String appAuthToken) {
-        return (AlipayTradePayRequestBuilder) super.setAppAuthToken(appAuthToken);
-    }
-
-    @Override
-    public AlipayTradePayRequestBuilder setNotifyUrl(String notifyUrl) {
-        return (AlipayTradePayRequestBuilder) super.setNotifyUrl(notifyUrl);
-    }
-
-    /**
-     * Gets scene.
-     *
-     * @return the scene
-     */
-    public String getScene() {
-        return bizContent.scene;
-    }
-
-    /**
-     * Sets scene.
-     *
-     * @param scene the scene
-     * @return the scene
-     */
-    public AlipayTradePayRequestBuilder setScene(String scene) {
-        bizContent.scene = scene;
-        return this;
-    }
-
-    /**
-     * Gets auth code.
-     *
-     * @return the auth code
-     */
-    public String getAuthCode() {
-        return bizContent.authCode;
-    }
-
-    /**
-     * Sets auth code.
-     *
-     * @param authCode the auth code
-     * @return the auth code
-     */
-    public AlipayTradePayRequestBuilder setAuthCode(String authCode) {
-        bizContent.authCode = authCode;
-        return this;
-    }
-
-    /**
-     * Gets out trade no.
-     *
-     * @return the out trade no
-     */
-    public String getOutTradeNo() {
-        return bizContent.outTradeNo;
-    }
-
-    /**
-     * Sets out trade no.
-     *
-     * @param outTradeNo the out trade no
-     * @return the out trade no
-     */
-    public AlipayTradePayRequestBuilder setOutTradeNo(String outTradeNo) {
-        bizContent.outTradeNo = outTradeNo;
-        return this;
-    }
-
-    /**
-     * Gets seller id.
-     *
-     * @return the seller id
-     */
-    public String getSellerId() {
-        return bizContent.sellerId;
-    }
-
-    /**
-     * Sets seller id.
-     *
-     * @param sellerId the seller id
-     * @return the seller id
-     */
-    public AlipayTradePayRequestBuilder setSellerId(String sellerId) {
-        bizContent.sellerId = sellerId;
-        return this;
-    }
-
-    /**
-     * Gets total amount.
-     *
-     * @return the total amount
-     */
-    public String getTotalAmount() {
-        return bizContent.totalAmount;
-    }
-
-    /**
-     * Sets total amount.
-     *
-     * @param totalAmount the total amount
-     * @return the total amount
-     */
-    public AlipayTradePayRequestBuilder setTotalAmount(String totalAmount) {
-        bizContent.totalAmount = totalAmount;
-        return this;
-    }
-
-    /**
-     * Gets discountable amount.
-     *
-     * @return the discountable amount
-     */
-    public String getDiscountableAmount() {
-        return bizContent.discountableAmount;
-    }
-
-    /**
-     * Sets discountable amount.
-     *
-     * @param discountableAmount the discountable amount
-     * @return the discountable amount
-     */
-    public AlipayTradePayRequestBuilder setDiscountableAmount(String discountableAmount) {
-        bizContent.discountableAmount = discountableAmount;
-        return this;
-    }
-
-    /**
-     * Gets undiscountable amount.
-     *
-     * @return the undiscountable amount
-     */
-    public String getUndiscountableAmount() {
-        return bizContent.undiscountableAmount;
-    }
-
-    /**
-     * Sets undiscountable amount.
-     *
-     * @param undiscountableAmount the undiscountable amount
-     * @return the undiscountable amount
-     */
-    public AlipayTradePayRequestBuilder setUndiscountableAmount(String undiscountableAmount) {
-        bizContent.undiscountableAmount = undiscountableAmount;
-        return this;
-    }
-
-    /**
-     * Gets subject.
-     *
-     * @return the subject
-     */
-    public String getSubject() {
-        return bizContent.subject;
-    }
-
-    /**
-     * Sets subject.
-     *
-     * @param subject the subject
-     * @return the subject
-     */
-    public AlipayTradePayRequestBuilder setSubject(String subject) {
-        bizContent.subject = subject;
-        return this;
-    }
-
-    /**
-     * Gets body.
-     *
-     * @return the body
-     */
-    public String getBody() {
-        return bizContent.body;
-    }
-
-    /**
-     * Sets body.
-     *
-     * @param body the body
-     * @return the body
-     */
-    public AlipayTradePayRequestBuilder setBody(String body) {
-        bizContent.body = body;
-        return this;
-    }
-
-    /**
-     * Gets goods detail list.
-     *
-     * @return the goods detail list
-     */
-    public List<GoodsDetail> getGoodsDetailList() {
-        return bizContent.goodsDetailList;
-    }
-
-    /**
-     * Sets goods detail list.
-     *
-     * @param goodsDetailList the goods detail list
-     * @return the goods detail list
-     */
-    public AlipayTradePayRequestBuilder setGoodsDetailList(List<GoodsDetail> goodsDetailList) {
-        bizContent.goodsDetailList = goodsDetailList;
-        return this;
-    }
-
-    /**
-     * Gets operator id.
-     *
-     * @return the operator id
-     */
-    public String getOperatorId() {
-        return bizContent.operatorId;
-    }
-
-    /**
-     * Sets operator id.
-     *
-     * @param operatorId the operator id
-     * @return the operator id
-     */
-    public AlipayTradePayRequestBuilder setOperatorId(String operatorId) {
-        bizContent.operatorId = operatorId;
-        return this;
-    }
-
-    /**
-     * Gets store id.
-     *
-     * @return the store id
-     */
-    public String getStoreId() {
-        return bizContent.storeId;
-    }
-
-    /**
-     * Sets store id.
-     *
-     * @param storeId the store id
-     * @return the store id
-     */
-    public AlipayTradePayRequestBuilder setStoreId(String storeId) {
-        bizContent.storeId = storeId;
-        return this;
-    }
-
-    /**
-     * Gets alipay store id.
-     *
-     * @return the alipay store id
-     */
-    public String getAlipayStoreId() {
-        return bizContent.alipayStoreId;
-    }
-
-    /**
-     * Sets alipay store id.
-     *
-     * @param alipayStoreId the alipay store id
-     * @return the alipay store id
-     */
-    public AlipayTradePayRequestBuilder setAlipayStoreId(String alipayStoreId) {
-        bizContent.alipayStoreId = alipayStoreId;
-        return this;
-    }
-
-    /**
-     * Gets terminal id.
-     *
-     * @return the terminal id
-     */
-    public String getTerminalId() {
-        return bizContent.terminalId;
-    }
-
-    /**
-     * Sets terminal id.
-     *
-     * @param terminalId the terminal id
-     * @return the terminal id
-     */
-    public AlipayTradePayRequestBuilder setTerminalId(String terminalId) {
-        bizContent.terminalId = terminalId;
-        return this;
-    }
-
-    /**
-     * Gets extend params.
-     *
-     * @return the extend params
-     */
-    public ExtendParams getExtendParams() {
-        return bizContent.extendParams;
-    }
-
-    /**
-     * Sets extend params.
-     *
-     * @param extendParams the extend params
-     * @return the extend params
-     */
-    public AlipayTradePayRequestBuilder setExtendParams(ExtendParams extendParams) {
-        bizContent.extendParams = extendParams;
-        return this;
-    }
-
-    /**
-     * Gets time expire.
-     *
-     * @return the time expire
-     */
-    public String getTimeExpire() {
-        return bizContent.timeExpire;
-    }
-
-    /**
-     * Sets time expire.
-     *
-     * @param timeExpire the time expire
-     * @return the time expire
-     */
-    public AlipayTradePayRequestBuilder setTimeExpire(String timeExpire) {
-        bizContent.timeExpire = timeExpire;
-        return this;
-    }
-
-    /**
-     * Gets time express.
-     *
-     * @return the time express
-     */
-    public String getTimeExpress() {
-        return bizContent.timeExpress;
-    }
-
-    /**
-     * Sets time express.
-     *
-     * @param timeExpress the time express
-     * @return the time express
-     */
-    public AlipayTradePayRequestBuilder setTimeExpress(String timeExpress) {
-        bizContent.timeExpress = timeExpress;
-        return this;
-    }
-
-    /**
-     * The type Biz content.
-     */
-    public static class BizContent {
-        // 支付场景,条码支付场景为bar_code
-        private String scene;
-
-        // 付款条码,用户支付宝钱包手机app点击“付款”产生的付款条码
-        @SerializedName("auth_code")
-        private String authCode;
-
-        // 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
-        // 需保证商户系统端不能重复,建议通过数据库sequence生成,
-        @SerializedName("out_trade_no")
-        private String outTradeNo;
-
-        // 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
-        // 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
-        @SerializedName("seller_id")
-        private String sellerId;
-
-        // 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
-        // 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
-        @SerializedName("total_amount")
-        private String totalAmount;
-
-        // 订单可打折金额,此处单位为元,精确到小数点后2位
-        // 可以配合商家平台配置折扣活动,如果订单部分商品参与打折,可以将部分商品总价填写至此字段,默认全部商品可打折
-        // 如果该值未传入,但传入了【订单总金额】,【不可打折金额】 则该值默认为【订单总金额】- 【不可打折金额】
-        @SerializedName("discountable_amount")
-        private String discountableAmount;
-
-        // 订单不可打折金额,此处单位为元,精确到小数点后2位,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
-        // 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
-        @SerializedName("undiscountable_amount")
-        private String undiscountableAmount;
-
-        // 订单标题,粗略描述用户的支付目的。如“喜士多(浦东店)消费”
-        private String subject;
-
-        // 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
-        private String body;
-
-        // 商品明细列表,需填写购买商品详细信息,
-        @SerializedName("goods_detail")
-        private List<GoodsDetail> goodsDetailList;
-
-        // 商户操作员编号,添加此参数可以为商户操作员做销售统计
-        @SerializedName("operator_id")
-        private String operatorId;
-
-        // 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
-        @SerializedName("store_id")
-        private String storeId;
-
-        // 支付宝商家平台中配置的商户门店号,详询支付宝技术支持
-        @SerializedName("alipay_store_id")
-        private String alipayStoreId;
-
-        // 商户机具终端编号,当以机具方式接入支付宝时必传,详询支付宝技术支持
-        @SerializedName("terminal_id")
-        private String terminalId;
-
-        // 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
-        @SerializedName("extend_params")
-        private ExtendParams extendParams;
-
-        // (不推荐使用,绝对时间不准确) 支付超时时间,该笔订单允许的最晚付款时间,逾期支付宝将主动关闭交易,格式为: yyyy-MM-dd HH:mm:ss
-        // 建议不超过交易发生后30分钟,如果为空则使用支付宝默认的超时时间,时间较长
-        @SerializedName("time_expire")
-        private String timeExpire;
-
-        // (推荐使用,相对时间) 支付超时时间,5m 5分钟
-        @SerializedName("time_express")
-        private String timeExpress;
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder("BizContent{");
-            sb.append("scene='").append(scene).append('\'');
-            sb.append(", authCode='").append(authCode).append('\'');
-            sb.append(", outTradeNo='").append(outTradeNo).append('\'');
-            sb.append(", sellerId='").append(sellerId).append('\'');
-            sb.append(", totalAmount='").append(totalAmount).append('\'');
-            sb.append(", discountableAmount='").append(discountableAmount).append('\'');
-            sb.append(", undiscountableAmount='").append(undiscountableAmount).append('\'');
-            sb.append(", subject='").append(subject).append('\'');
-            sb.append(", body='").append(body).append('\'');
-            sb.append(", goodsDetailList=").append(goodsDetailList);
-            sb.append(", operatorId='").append(operatorId).append('\'');
-            sb.append(", storeId='").append(storeId).append('\'');
-            sb.append(", alipayStoreId='").append(alipayStoreId).append('\'');
-            sb.append(", terminalId='").append(terminalId).append('\'');
-            sb.append(", extendParams=").append(extendParams);
-            sb.append(", timeExpire='").append(timeExpire).append('\'');
-            sb.append(", timeExpress='").append(timeExpress).append('\'');
-            sb.append('}');
-            return sb.toString();
-        }
-
-    }
-}

+ 0 - 450
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradePrecreateRequestBuilder.java

@@ -1,450 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import com.google.gson.annotations.SerializedName;
-import org.apache.commons.lang3.StringUtils;
-import pay.platform.payment.alipay.trade.model.ExtendParams;
-import pay.platform.payment.alipay.trade.model.GoodsDetail;
-
-import java.util.List;
-
-/**
- * @author liuyangkly
- * date16/3/3
- */
-public class AlipayTradePrecreateRequestBuilder extends RequestBuilder {
-
-    private BizContent bizContent = new BizContent();
-
-    @Override
-    public BizContent getBizContent() {
-        return bizContent;
-    }
-
-    @Override
-    public boolean validate() {
-        if (StringUtils.isEmpty(bizContent.outTradeNo)) {
-            throw new NullPointerException("out_trade_no should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.totalAmount)) {
-            throw new NullPointerException("total_amount should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.subject)) {
-            throw new NullPointerException("subject should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.storeId)) {
-            throw new NullPointerException("store_id should not be NULL!");
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("AlipayTradePrecreateRequestBuilder{");
-        sb.append("bizContent=").append(bizContent);
-        sb.append(", super=").append(super.toString());
-        sb.append('}');
-        return sb.toString();
-    }
-
-    @Override
-    public AlipayTradePrecreateRequestBuilder setAppAuthToken(String appAuthToken) {
-        return (AlipayTradePrecreateRequestBuilder) super.setAppAuthToken(appAuthToken);
-    }
-
-    @Override
-    public AlipayTradePrecreateRequestBuilder setNotifyUrl(String notifyUrl) {
-        return (AlipayTradePrecreateRequestBuilder) super.setNotifyUrl(notifyUrl);
-    }
-
-    /**
-     * Gets out trade no.
-     *
-     * @return the out trade no
-     */
-    public String getOutTradeNo() {
-        return bizContent.outTradeNo;
-    }
-
-    /**
-     * Sets out trade no.
-     *
-     * @param outTradeNo the out trade no
-     * @return the out trade no
-     */
-    public AlipayTradePrecreateRequestBuilder setOutTradeNo(String outTradeNo) {
-        bizContent.outTradeNo = outTradeNo;
-        return this;
-    }
-
-    /**
-     * Gets seller id.
-     *
-     * @return the seller id
-     */
-    public String getSellerId() {
-        return bizContent.sellerId;
-    }
-
-    /**
-     * Sets seller id.
-     *
-     * @param sellerId the seller id
-     * @return the seller id
-     */
-    public AlipayTradePrecreateRequestBuilder setSellerId(String sellerId) {
-        bizContent.sellerId = sellerId;
-        return this;
-    }
-
-    /**
-     * Gets total amount.
-     *
-     * @return the total amount
-     */
-    public String getTotalAmount() {
-        return bizContent.totalAmount;
-    }
-
-    /**
-     * Sets total amount.
-     *
-     * @param totalAmount the total amount
-     * @return the total amount
-     */
-    public AlipayTradePrecreateRequestBuilder setTotalAmount(String totalAmount) {
-        bizContent.totalAmount = totalAmount;
-        return this;
-    }
-
-    /**
-     * Gets discountable amount.
-     *
-     * @return the discountable amount
-     */
-    public String getDiscountableAmount() {
-        return bizContent.discountableAmount;
-    }
-
-    /**
-     * Sets discountable amount.
-     *
-     * @param discountableAmount the discountable amount
-     * @return the discountable amount
-     */
-    public AlipayTradePrecreateRequestBuilder setDiscountableAmount(String discountableAmount) {
-        bizContent.discountableAmount = discountableAmount;
-        return this;
-    }
-
-    /**
-     * Gets undiscountable amount.
-     *
-     * @return the undiscountable amount
-     */
-    public String getUndiscountableAmount() {
-        return bizContent.undiscountableAmount;
-    }
-
-    /**
-     * Sets undiscountable amount.
-     *
-     * @param undiscountableAmount the undiscountable amount
-     * @return the undiscountable amount
-     */
-    public AlipayTradePrecreateRequestBuilder setUndiscountableAmount(String undiscountableAmount) {
-        bizContent.undiscountableAmount = undiscountableAmount;
-        return this;
-    }
-
-    /**
-     * Gets subject.
-     *
-     * @return the subject
-     */
-    public String getSubject() {
-        return bizContent.subject;
-    }
-
-    /**
-     * Sets subject.
-     *
-     * @param subject the subject
-     * @return the subject
-     */
-    public AlipayTradePrecreateRequestBuilder setSubject(String subject) {
-        bizContent.subject = subject;
-        return this;
-    }
-
-    /**
-     * Gets body.
-     *
-     * @return the body
-     */
-    public String getBody() {
-        return bizContent.body;
-    }
-
-    /**
-     * Sets body.
-     *
-     * @param body the body
-     * @return the body
-     */
-    public AlipayTradePrecreateRequestBuilder setBody(String body) {
-        bizContent.body = body;
-        return this;
-    }
-
-    /**
-     * Gets goods detail list.
-     *
-     * @return the goods detail list
-     */
-    public List<GoodsDetail> getGoodsDetailList() {
-        return bizContent.goodsDetailList;
-    }
-
-    /**
-     * Sets goods detail list.
-     *
-     * @param goodsDetailList the goods detail list
-     * @return the goods detail list
-     */
-    public AlipayTradePrecreateRequestBuilder setGoodsDetailList(List<GoodsDetail> goodsDetailList) {
-        bizContent.goodsDetailList = goodsDetailList;
-        return this;
-    }
-
-    /**
-     * Gets operator id.
-     *
-     * @return the operator id
-     */
-    public String getOperatorId() {
-        return bizContent.operatorId;
-    }
-
-    /**
-     * Sets operator id.
-     *
-     * @param operatorId the operator id
-     * @return the operator id
-     */
-    public AlipayTradePrecreateRequestBuilder setOperatorId(String operatorId) {
-        bizContent.operatorId = operatorId;
-        return this;
-    }
-
-    /**
-     * Gets store id.
-     *
-     * @return the store id
-     */
-    public String getStoreId() {
-        return bizContent.storeId;
-    }
-
-    /**
-     * Sets store id.
-     *
-     * @param storeId the store id
-     * @return the store id
-     */
-    public AlipayTradePrecreateRequestBuilder setStoreId(String storeId) {
-        bizContent.storeId = storeId;
-        return this;
-    }
-
-    /**
-     * Gets alipay store id.
-     *
-     * @return the alipay store id
-     */
-    public String getAlipayStoreId() {
-        return bizContent.alipayStoreId;
-    }
-
-    /**
-     * Sets alipay store id.
-     *
-     * @param alipayStoreId the alipay store id
-     * @return the alipay store id
-     */
-    public AlipayTradePrecreateRequestBuilder setAlipayStoreId(String alipayStoreId) {
-        bizContent.alipayStoreId = alipayStoreId;
-        return this;
-    }
-
-    /**
-     * Gets terminal id.
-     *
-     * @return the terminal id
-     */
-    public String getTerminalId() {
-        return bizContent.terminalId;
-    }
-
-    /**
-     * Sets terminal id.
-     *
-     * @param terminalId the terminal id
-     * @return the terminal id
-     */
-    public AlipayTradePrecreateRequestBuilder setTerminalId(String terminalId) {
-        bizContent.terminalId = terminalId;
-        return this;
-    }
-
-    /**
-     * Gets extend params.
-     *
-     * @return the extend params
-     */
-    public ExtendParams getExtendParams() {
-        return bizContent.extendParams;
-    }
-
-    /**
-     * Sets extend params.
-     *
-     * @param extendParams the extend params
-     * @return the extend params
-     */
-    public AlipayTradePrecreateRequestBuilder setExtendParams(ExtendParams extendParams) {
-        bizContent.extendParams = extendParams;
-        return this;
-    }
-
-    /**
-     * Gets time expire.
-     *
-     * @return the time expire
-     */
-    public String getTimeExpire() {
-        return bizContent.timeExpire;
-    }
-
-    /**
-     * Sets time expire.
-     *
-     * @param timeExpire the time expire
-     * @return the time expire
-     */
-    public AlipayTradePrecreateRequestBuilder setTimeExpire(String timeExpire) {
-        bizContent.timeExpire = timeExpire;
-        return this;
-    }
-
-    /**
-     * Gets time express.
-     *
-     * @return the time express
-     */
-    public String getTimeExpress() {
-        return bizContent.timeExpress;
-    }
-
-    /**
-     * Sets time express.
-     *
-     * @param timeExpress the time express
-     * @return the time express
-     */
-    public AlipayTradePrecreateRequestBuilder setTimeExpress(String timeExpress) {
-        bizContent.timeExpress = timeExpress;
-        return this;
-    }
-
-    /**
-     * The type Biz content.
-     */
-    public static class BizContent {
-        // 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
-        // 需保证商户系统端不能重复,建议通过数据库sequence生成,
-        @SerializedName("out_trade_no")
-        private String outTradeNo;
-
-        // 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
-        // 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
-        @SerializedName("seller_id")
-        private String sellerId;
-
-        // 订单总金额,整形,此处单位为元,精确到小数点后2位,不能超过1亿元
-        // 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
-        @SerializedName("total_amount")
-        private String totalAmount;
-
-        // 订单可打折金额,此处单位为元,精确到小数点后2位
-        // 可以配合商家平台配置折扣活动,如果订单部分商品参与打折,可以将部分商品总价填写至此字段,默认全部商品可打折
-        // 如果该值未传入,但传入了【订单总金额】,【不可打折金额】 则该值默认为【订单总金额】- 【不可打折金额】
-        @SerializedName("discountable_amount")
-        private String discountableAmount;
-
-        // 订单不可打折金额,此处单位为元,精确到小数点后2位,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
-        // 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
-        @SerializedName("undiscountable_amount")
-        private String undiscountableAmount;
-
-        // 订单标题,粗略描述用户的支付目的。如“喜士多(浦东店)消费”
-        private String subject;
-
-        // 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
-        private String body;
-
-        // 商品明细列表,需填写购买商品详细信息,
-        @SerializedName("goods_detail")
-        private List<GoodsDetail> goodsDetailList;
-
-        // 商户操作员编号,添加此参数可以为商户操作员做销售统计
-        @SerializedName("operator_id")
-        private String operatorId;
-
-        // 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
-        @SerializedName("store_id")
-        private String storeId;
-
-        // 支付宝商家平台中配置的商户门店号,详询支付宝技术支持
-        @SerializedName("alipay_store_id")
-        private String alipayStoreId;
-
-        // 商户机具终端编号,当以机具方式接入支付宝时必传,详询支付宝技术支持
-        @SerializedName("terminal_id")
-        private String terminalId;
-
-        // 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
-        @SerializedName("extend_params")
-        private ExtendParams extendParams;
-
-        // (不推荐使用,绝对时间不准确) 支付超时时间,该笔订单允许的最晚付款时间,逾期支付宝将主动关闭交易,格式为: yyyy-MM-dd HH:mm:ss
-        // 建议不超过交易发生后30分钟,如果为空则使用支付宝默认的超时时间,时间较长
-        @SerializedName("time_expire")
-        private String timeExpire;
-
-        // (推荐使用,相对时间) 支付超时时间,5m 5分钟
-        @SerializedName("time_express")
-        private String timeExpress;
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder("BizContent{");
-            sb.append("outTradeNo='").append(outTradeNo).append('\'');
-            sb.append(", sellerId='").append(sellerId).append('\'');
-            sb.append(", totalAmount='").append(totalAmount).append('\'');
-            sb.append(", discountableAmount='").append(discountableAmount).append('\'');
-            sb.append(", undiscountableAmount='").append(undiscountableAmount).append('\'');
-            sb.append(", subject='").append(subject).append('\'');
-            sb.append(", body='").append(body).append('\'');
-            sb.append(", goodsDetailList=").append(goodsDetailList);
-            sb.append(", operatorId='").append(operatorId).append('\'');
-            sb.append(", storeId='").append(storeId).append('\'');
-            sb.append(", alipayStoreId='").append(alipayStoreId).append('\'');
-            sb.append(", terminalId='").append(terminalId).append('\'');
-            sb.append(", extendParams=").append(extendParams);
-            sb.append(", timeExpire='").append(timeExpire).append('\'');
-            sb.append(", timeExpress='").append(timeExpress).append('\'');
-            sb.append('}');
-            return sb.toString();
-        }
-    }
-}

+ 0 - 108
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradeQueryRequestBuilder.java

@@ -1,108 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import com.google.gson.annotations.SerializedName;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * @author liuyangkly
- * date16/3/3
- */
-public class AlipayTradeQueryRequestBuilder extends RequestBuilder {
-
-    private BizContent bizContent = new BizContent();
-
-    @Override
-    public BizContent getBizContent() {
-        return bizContent;
-    }
-
-    @Override
-    public boolean validate() {
-        if (StringUtils.isEmpty(bizContent.tradeNo) &&
-                StringUtils.isEmpty(bizContent.outTradeNo)) {
-            throw new IllegalStateException("tradeNo and outTradeNo can not both be NULL!");
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("AlipayTradeQueryRequestBuilder{");
-        sb.append("bizContent=").append(bizContent);
-        sb.append(", super=").append(super.toString());
-        sb.append('}');
-        return sb.toString();
-    }
-
-    @Override
-    public AlipayTradeQueryRequestBuilder setAppAuthToken(String appAuthToken) {
-        return (AlipayTradeQueryRequestBuilder) super.setAppAuthToken(appAuthToken);
-    }
-
-    @Override
-    public AlipayTradeQueryRequestBuilder setNotifyUrl(String notifyUrl) {
-        return (AlipayTradeQueryRequestBuilder) super.setNotifyUrl(notifyUrl);
-    }
-
-    /**
-     * Gets trade no.
-     *
-     * @return the trade no
-     */
-    public String getTradeNo() {
-        return bizContent.tradeNo;
-    }
-
-    /**
-     * Sets trade no.
-     *
-     * @param tradeNo the trade no
-     * @return the trade no
-     */
-    public AlipayTradeQueryRequestBuilder setTradeNo(String tradeNo) {
-        bizContent.tradeNo = tradeNo;
-        return this;
-    }
-
-    /**
-     * Gets out trade no.
-     *
-     * @return the out trade no
-     */
-    public String getOutTradeNo() {
-        return bizContent.outTradeNo;
-    }
-
-    /**
-     * Sets out trade no.
-     *
-     * @param outTradeNo the out trade no
-     * @return the out trade no
-     */
-    public AlipayTradeQueryRequestBuilder setOutTradeNo(String outTradeNo) {
-        bizContent.outTradeNo = outTradeNo;
-        return this;
-    }
-
-    /**
-     * The type Biz content.
-     */
-    public static class BizContent {
-        // 支付宝交易号,和商户订单号不能同时为空, 如果同时存在则通过tradeNo查询支付宝交易
-        @SerializedName("trade_no")
-        private String tradeNo;
-
-        // 商户订单号,通过此商户订单号查询当面付的交易状态
-        @SerializedName("out_trade_no")
-        private String outTradeNo;
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder("BizContent{");
-            sb.append("tradeNo='").append(tradeNo).append('\'');
-            sb.append(", outTradeNo='").append(outTradeNo).append('\'');
-            sb.append('}');
-            return sb.toString();
-        }
-    }
-}

+ 0 - 264
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/AlipayTradeRefundRequestBuilder.java

@@ -1,264 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import com.google.gson.annotations.SerializedName;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * @author liuyangkly
- * date16/3/3
- */
-public class AlipayTradeRefundRequestBuilder extends RequestBuilder {
-    private BizContent bizContent = new BizContent();
-
-    @Override
-    public BizContent getBizContent() {
-        return bizContent;
-    }
-
-    @Override
-    public boolean validate() {
-        if (StringUtils.isEmpty(bizContent.outTradeNo) &&
-                StringUtils.isEmpty(bizContent.tradeNo)) {
-            throw new NullPointerException("out_trade_no and trade_no should not both be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.refundAmount)) {
-            throw new NullPointerException("refund_amount should not be NULL!");
-        }
-        if (StringUtils.isEmpty(bizContent.refundReason)) {
-            throw new NullPointerException("refund_reson should not be NULL!");
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("AlipayTradeRefundRequestBuilder{");
-        sb.append("bizContent=").append(bizContent);
-        sb.append(", super=").append(super.toString());
-        sb.append('}');
-        return sb.toString();
-    }
-
-    @Override
-    public AlipayTradeRefundRequestBuilder setAppAuthToken(String appAuthToken) {
-        return (AlipayTradeRefundRequestBuilder) super.setAppAuthToken(appAuthToken);
-    }
-
-    @Override
-    public AlipayTradeRefundRequestBuilder setNotifyUrl(String notifyUrl) {
-        return (AlipayTradeRefundRequestBuilder) super.setNotifyUrl(notifyUrl);
-    }
-
-    /**
-     * Gets out trade no.
-     *
-     * @return the out trade no
-     */
-    public String getOutTradeNo() {
-        return bizContent.outTradeNo;
-    }
-
-    /**
-     * Sets out trade no.
-     *
-     * @param outTradeNo the out trade no
-     * @return the out trade no
-     */
-    public AlipayTradeRefundRequestBuilder setOutTradeNo(String outTradeNo) {
-        bizContent.outTradeNo = outTradeNo;
-        return this;
-    }
-
-    /**
-     * Sets trade no.
-     *
-     * @param tradeNo the trade no
-     * @return the trade no
-     */
-    public AlipayTradeRefundRequestBuilder setTradeNo(String tradeNo) {
-        bizContent.tradeNo = tradeNo;
-        return this;
-    }
-
-    /**
-     * Sets refund amount.
-     *
-     * @param refundAmount the refund amount
-     * @return the refund amount
-     */
-    public AlipayTradeRefundRequestBuilder setRefundAmount(String refundAmount) {
-        bizContent.refundAmount = refundAmount;
-        return this;
-    }
-
-    /**
-     * Sets out request no.
-     *
-     * @param outRequestNo the out request no
-     * @return the out request no
-     */
-    public AlipayTradeRefundRequestBuilder setOutRequestNo(String outRequestNo) {
-        bizContent.outRequestNo = outRequestNo;
-        return this;
-    }
-
-    /**
-     * Sets refund reason.
-     *
-     * @param refundReason the refund reason
-     * @return the refund reason
-     */
-    public AlipayTradeRefundRequestBuilder setRefundReason(String refundReason) {
-        bizContent.refundReason = refundReason;
-        return this;
-    }
-
-    /**
-     * Sets store id.
-     *
-     * @param storeId the store id
-     * @return the store id
-     */
-    public AlipayTradeRefundRequestBuilder setStoreId(String storeId) {
-        bizContent.storeId = storeId;
-        return this;
-    }
-
-    /**
-     * Sets alipay store id.
-     *
-     * @param alipayStoreId the alipay store id
-     * @return the alipay store id
-     */
-    public AlipayTradeRefundRequestBuilder setAlipayStoreId(String alipayStoreId) {
-        bizContent.alipayStoreId = alipayStoreId;
-        return this;
-    }
-
-    /**
-     * Sets terminal id.
-     *
-     * @param terminalId the terminal id
-     * @return the terminal id
-     */
-    public AlipayTradeRefundRequestBuilder setTerminalId(String terminalId) {
-        bizContent.terminalId = terminalId;
-        return this;
-    }
-
-    /**
-     * Gets trade no.
-     *
-     * @return the trade no
-     */
-    public String getTradeNo() {
-        return bizContent.tradeNo;
-    }
-
-    /**
-     * Gets refund amount.
-     *
-     * @return the refund amount
-     */
-    public String getRefundAmount() {
-        return bizContent.refundAmount;
-    }
-
-    /**
-     * Gets out request no.
-     *
-     * @return the out request no
-     */
-    public String getOutRequestNo() {
-        return bizContent.outRequestNo;
-    }
-
-    /**
-     * Gets refund reason.
-     *
-     * @return the refund reason
-     */
-    public String getRefundReason() {
-        return bizContent.refundReason;
-    }
-
-    /**
-     * Gets store id.
-     *
-     * @return the store id
-     */
-    public String getStoreId() {
-        return bizContent.storeId;
-    }
-
-    /**
-     * Gets alipay store id.
-     *
-     * @return the alipay store id
-     */
-    public String getAlipayStoreId() {
-        return bizContent.alipayStoreId;
-    }
-
-    /**
-     * Gets terminal id.
-     *
-     * @return the terminal id
-     */
-    public String getTerminalId() {
-        return bizContent.terminalId;
-    }
-
-    /**
-     * The type Biz content.
-     */
-    public static class BizContent {
-        // 支付宝交易号,当面付支付成功后支付宝会返回给商户系统。通过此支付宝交易号进行交易退款
-        @SerializedName("trade_no")
-        private String tradeNo;
-
-        // (推荐) 外部订单号,可通过外部订单号申请退款,推荐使用
-        @SerializedName("out_trade_no")
-        private String outTradeNo;
-
-        // 退款金额,该金额必须小于等于订单的支付金额,此处单位为元,精确到小数点后2位
-        @SerializedName("refund_amount")
-        private String refundAmount;
-
-        // (可选,需要支持重复退货时必填) 商户退款请求号,相同支付宝交易号下的不同退款请求号对应同一笔交易的不同退款申请,
-        // 对于相同支付宝交易号下多笔相同商户退款请求号的退款交易,支付宝只会进行一次退款
-        @SerializedName("out_request_no")
-        private String outRequestNo;
-
-        // (必填) 退款原因,可以说明用户退款原因,方便为商家后台提供统计
-        @SerializedName("refund_reason")
-        private String refundReason;
-
-        // (必填) 商户门店编号,退款情况下可以为商家后台提供退款权限判定和统计等作用,详询支付宝技术支持
-        @SerializedName("store_id")
-        private String storeId;
-
-        // 支付宝商家平台中配置的商户门店号,详询支付宝技术支持
-        @SerializedName("alipay_store_id")
-        private String alipayStoreId;
-
-        // 商户机具终端编号,当以机具方式接入支付宝时必传,详询支付宝技术支持
-        @SerializedName("terminal_id")
-        private String terminalId;
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder("BizContent{");
-            sb.append("tradeNo='").append(tradeNo).append('\'');
-            sb.append(", outTradeNo='").append(outTradeNo).append('\'');
-            sb.append(", refundAmount='").append(refundAmount).append('\'');
-            sb.append(", outRequestNo='").append(outRequestNo).append('\'');
-            sb.append(", refundReason='").append(refundReason).append('\'');
-            sb.append(", storeId='").append(storeId).append('\'');
-            sb.append(", alipayStoreId='").append(alipayStoreId).append('\'');
-            sb.append(", terminalId='").append(terminalId).append('\'');
-            sb.append('}');
-            return sb.toString();
-        }
-    }
-}

+ 0 - 84
pay/src/main/java/pay/platform/payment/alipay/trade/model/builder/RequestBuilder.java

@@ -1,84 +0,0 @@
-package pay.platform.payment.alipay.trade.model.builder;
-
-import pay.platform.payment.alipay.trade.utils.GsonFactory;
-
-/**
- * Created by liuyangkly on 15/7/31.
- */
-public abstract class RequestBuilder {
-
-    private String appAuthToken;
-    private String notifyUrl;
-
-    /**
-     * 验证请求对象
-     *
-     * @return the boolean
-     */
-    public abstract boolean validate();
-
-    /**
-     * 获取bizContent对象,用于下一步转换为json字符串
-     *
-     * @return the biz content
-     */
-    public abstract Object getBizContent();
-
-    /**
-     * 将bizContent对象转换为json字符串
-     *
-     * @return the string
-     */
-    public String toJsonString() {
-        return GsonFactory.getGson().toJson(this.getBizContent());
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("RequestBuilder{");
-        sb.append("appAuthToken='").append(appAuthToken).append('\'');
-        sb.append(", notifyUrl='").append(notifyUrl).append('\'');
-        sb.append('}');
-        return sb.toString();
-    }
-
-    /**
-     * Gets app auth token.
-     *
-     * @return the app auth token
-     */
-    public String getAppAuthToken() {
-        return appAuthToken;
-    }
-
-    /**
-     * Sets app auth token.
-     *
-     * @param appAuthToken the app auth token
-     * @return the app auth token
-     */
-    public RequestBuilder setAppAuthToken(String appAuthToken) {
-        this.appAuthToken = appAuthToken;
-        return this;
-    }
-
-    /**
-     * Gets notify url.
-     *
-     * @return the notify url
-     */
-    public String getNotifyUrl() {
-        return notifyUrl;
-    }
-
-    /**
-     * Sets notify url.
-     *
-     * @param notifyUrl the notify url
-     * @return the notify url
-     */
-    public RequestBuilder setNotifyUrl(String notifyUrl) {
-        this.notifyUrl = notifyUrl;
-        return this;
-    }
-}

+ 0 - 42
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/EquipStatus.java

@@ -1,42 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * Created by liuyangkly on 15/8/27.
- */
-public enum EquipStatus {
-    /**
-     * 开机
-     */
-    ON("10"),
-    /**
-     * 关机
-     */
-    OFF("20"),
-    /**
-     * 正常
-     */
-    NORMAL("30"),
-    /**
-     * 进入休眠
-     */
-    SLEEP("40"),
-    /**
-     * 唤醒
-     */
-    AWAKE("41");
-
-    private String value;
-
-    EquipStatus(String value) {
-        this.value = value;
-    }
-
-    /**
-     * Gets value.
-     *
-     * @return the value
-     */
-    public String getValue() {
-        return value;
-    }
-}

+ 0 - 19
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/EquipStatusAdapter.java

@@ -1,19 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-
-import java.lang.reflect.Type;
-
-/**
- * Created by liuyangkly on 15/8/27.
- */
-public class EquipStatusAdapter implements JsonSerializer<EquipStatus> {
-
-    @Override
-    public JsonElement serialize(EquipStatus equipStatus, Type type, JsonSerializationContext jsonSerializationContext) {
-        return new JsonPrimitive(equipStatus.getValue());
-    }
-}

+ 0 - 20
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/ExceptionInfo.java

@@ -1,20 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public enum ExceptionInfo {
-    /**
-     * 打印机异常
-     */
-    HE_PRINTER,
-    /**
-     * 扫描枪异常.
-     */
-    HE_SCANER,
-    /**
-     * 其他硬件异常
-     */
-    HE_OTHER
-}

+ 0 - 27
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/ExceptionInfoAdapter.java

@@ -1,27 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import org.apache.commons.lang3.StringUtils;
-import pay.platform.payment.alipay.trade.utils.Utils;
-
-import java.lang.reflect.Type;
-import java.util.List;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public class ExceptionInfoAdapter implements JsonSerializer<List<ExceptionInfo>> {
-
-    @Override
-    public JsonElement serialize(List<ExceptionInfo> exceptionInfos, Type type, JsonSerializationContext jsonSerializationContext) {
-        if (Utils.isListEmpty(exceptionInfos)) {
-            return null;
-        }
-
-        return new JsonPrimitive(StringUtils.join(exceptionInfos, "|"));
-    }
-}

+ 0 - 40
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/HbStatus.java

@@ -1,40 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public enum HbStatus {
-    /**
-     * 交易成功(包括支付宝返回“处理中”)
-     */
-    S,
-    /**
-     * 支付宝返回处理中
-     */
-    I,
-    /**
-     * 支付宝返回失败
-     */
-    F,
-    /**
-     * POSP返回失败,或商户系统失败
-     */
-    P,
-    /**
-     * 建立连接异常
-     */
-    X,
-    /**
-     * 报文上送异常
-     */
-    Y,
-    /**
-     * 报文接收异常
-     */
-    Z,
-    /**
-     * 收银员取消
-     */
-    C
-}

+ 0 - 88
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/PosTradeInfo.java

@@ -1,88 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * @author liuyangkly
- * date15/9/28
- */
-public class PosTradeInfo implements TradeInfo {
-    private HbStatus status;
-    private String time;
-    private int timeConsume;
-
-    private PosTradeInfo() {
-        // no public constructor.
-    }
-
-    /**
-     * New instance pos trade info.
-     *
-     * @param status      the status
-     * @param time        the time
-     * @param timeConsume the time consume
-     * @return the pos trade info
-     */
-    public static PosTradeInfo newInstance(HbStatus status, String time, int timeConsume) {
-        PosTradeInfo info = new PosTradeInfo();
-        if (timeConsume > 99 || timeConsume < 0) {
-            timeConsume = 99;
-        }
-        info.setTimeConsume(timeConsume);
-        info.setStatus(status);
-        info.setTime(time);
-        return info;
-    }
-
-    @Override
-    public String toString() {
-        return new StringBuilder(status.name())
-                .append(time)
-                .append(String.format("%02d", timeConsume))
-                .toString();
-    }
-
-    @Override
-    public HbStatus getStatus() {
-        return status;
-    }
-
-    /**
-     * Sets status.
-     *
-     * @param status the status
-     */
-    public void setStatus(HbStatus status) {
-        this.status = status;
-    }
-
-    /**
-     * Gets time.
-     *
-     * @return the time
-     */
-    public String getTime() {
-        return time;
-    }
-
-    /**
-     * Sets time.
-     *
-     * @param time the time
-     */
-    public void setTime(String time) {
-        this.time = time;
-    }
-
-    @Override
-    public double getTimeConsume() {
-        return (double) timeConsume;
-    }
-
-    /**
-     * Sets time consume.
-     *
-     * @param timeConsume the time consume
-     */
-    public void setTimeConsume(int timeConsume) {
-        this.timeConsume = timeConsume;
-    }
-}

+ 0 - 15
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/Product.java

@@ -1,15 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * Created by liuyangkly on 15/8/27.
- */
-public enum Product {
-    /**
-     * 当面付产品
-     */
-    FP,
-    /**
-     * 医疗产品
-     */
-    MP
-}

+ 0 - 88
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/SysTradeInfo.java

@@ -1,88 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public class SysTradeInfo implements TradeInfo {
-
-    @SerializedName("OTN")
-    private String outTradeNo;
-
-    @SerializedName("TC")
-    private double timeConsume;
-
-    @SerializedName("STAT")
-    private HbStatus status;
-
-    private SysTradeInfo() {
-        // no public constructor.
-    }
-
-    /**
-     * New instance sys trade info.
-     *
-     * @param outTradeNo  the out trade no
-     * @param timeConsume the time consume
-     * @param status      the status
-     * @return the sys trade info
-     */
-    public static SysTradeInfo newInstance(String outTradeNo, double timeConsume, HbStatus status) {
-        SysTradeInfo info = new SysTradeInfo();
-        info.setOutTradeNo(outTradeNo);
-        if (timeConsume > 99 || timeConsume < 0) {
-            timeConsume = 99;
-        }
-        info.setTimeConsume(timeConsume);
-        info.setStatus(status);
-        return info;
-    }
-
-    /**
-     * Gets out trade no.
-     *
-     * @return the out trade no
-     */
-    public String getOutTradeNo() {
-        return outTradeNo;
-    }
-
-    /**
-     * Sets out trade no.
-     *
-     * @param outTradeNo the out trade no
-     */
-    public void setOutTradeNo(String outTradeNo) {
-        this.outTradeNo = outTradeNo;
-    }
-
-    @Override
-    public HbStatus getStatus() {
-        return status;
-    }
-
-    /**
-     * Sets status.
-     *
-     * @param status the status
-     */
-    public void setStatus(HbStatus status) {
-        this.status = status;
-    }
-
-    @Override
-    public double getTimeConsume() {
-        return timeConsume;
-    }
-
-    /**
-     * Sets time consume.
-     *
-     * @param timeConsume the time consume
-     */
-    public void setTimeConsume(double timeConsume) {
-        this.timeConsume = timeConsume;
-    }
-}

+ 0 - 20
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/TradeInfo.java

@@ -1,20 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * Created by liuyangkly on 15/9/28.
- */
-public interface TradeInfo {
-    /**
-     * 获取交易状态
-     *
-     * @return the status
-     */
-    HbStatus getStatus();
-
-    /**
-     * 获取交易时间
-     *
-     * @return the time consume
-     */
-    double getTimeConsume();
-}

+ 0 - 32
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/TradeInfoAdapter.java

@@ -1,32 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import org.apache.commons.lang3.StringUtils;
-import pay.platform.payment.alipay.trade.utils.Utils;
-
-import java.lang.reflect.Type;
-import java.util.List;
-
-/**
- * @author liuyangkly
- * date15/9/28
- */
-public class TradeInfoAdapter implements JsonSerializer<List<TradeInfo>> {
-
-    @Override
-    public JsonElement serialize(List<TradeInfo> tradeInfoList, Type type, JsonSerializationContext jsonSerializationContext) {
-        if (Utils.isListEmpty(tradeInfoList)) {
-            return null;
-        }
-
-        TradeInfo tradeInfo = tradeInfoList.get(0);
-        if (tradeInfo instanceof PosTradeInfo) {
-            return new JsonPrimitive(StringUtils.join(tradeInfoList, ""));
-        }
-
-        return jsonSerializationContext.serialize(tradeInfoList);
-    }
-}

+ 0 - 35
pay/src/main/java/pay/platform/payment/alipay/trade/model/hb/Type.java

@@ -1,35 +0,0 @@
-package pay.platform.payment.alipay.trade.model.hb;
-
-/**
- * Created by liuyangkly on 15/8/27.
- */
-public enum Type {
-    /**
-     * 收银机
-     */
-    CR,
-    /**
-     * 门店
-     */
-    STORE,
-    /**
-     * 售卖机
-     */
-    VM,
-    /**
-     * 医疗设备
-     */
-    MD,
-    /**
-     * 软POS
-     */
-    SOFT_POS,
-    /**
-     * POS终端
-     */
-    POS,
-    /**
-     * 支付宝POS
-     */
-    ALI_POS
-}

+ 0 - 66
pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FCancelResult.java

@@ -1,66 +0,0 @@
-package pay.platform.payment.alipay.trade.model.result;
-
-import com.alipay.api.response.AlipayTradeCancelResponse;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-
-/**
- * @author HanleyTang
- * date2017/3/7
- */
-public class AlipayF2FCancelResult implements Result {
-
-    private TradeStatus tradeStatus;
-    private AlipayTradeCancelResponse response;
-
-    /**
-     * Instantiates a new Alipay f 2 f cancel result.
-     *
-     * @param response the response
-     */
-    public AlipayF2FCancelResult(AlipayTradeCancelResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Gets trade status.
-     *
-     * @return the trade status
-     */
-    public TradeStatus getTradeStatus() {
-        return tradeStatus;
-    }
-
-    /**
-     * Sets trade status.
-     *
-     * @param tradeStatus the trade status
-     */
-    public void setTradeStatus(TradeStatus tradeStatus) {
-        this.tradeStatus = tradeStatus;
-    }
-
-    /**
-     * Gets response.
-     *
-     * @return the response
-     */
-    public AlipayTradeCancelResponse getResponse() {
-        return response;
-    }
-
-    /**
-     * Sets response.
-     *
-     * @param response the response
-     */
-    public void setResponse(AlipayTradeCancelResponse response) {
-        this.response = response;
-    }
-
-
-    @Override
-    public boolean isTradeSuccess() {
-        return response != null &&
-                TradeStatus.SUCCESS.equals(tradeStatus);
-    }
-}

+ 0 - 65
pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FPayResult.java

@@ -1,65 +0,0 @@
-package pay.platform.payment.alipay.trade.model.result;
-
-import com.alipay.api.response.AlipayTradePayResponse;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-
-/**
- * @author liuyangkly
- * date15/8/26
- */
-public class AlipayF2FPayResult implements Result {
-
-    private TradeStatus tradeStatus;
-    private AlipayTradePayResponse response;
-
-    /**
-     * Instantiates a new Alipay f 2 f pay result.
-     *
-     * @param response the response
-     */
-    public AlipayF2FPayResult(AlipayTradePayResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Sets trade status.
-     *
-     * @param tradeStatus the trade status
-     */
-    public void setTradeStatus(TradeStatus tradeStatus) {
-        this.tradeStatus = tradeStatus;
-    }
-
-    /**
-     * Sets response.
-     *
-     * @param response the response
-     */
-    public void setResponse(AlipayTradePayResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Gets trade status.
-     *
-     * @return the trade status
-     */
-    public TradeStatus getTradeStatus() {
-        return tradeStatus;
-    }
-
-    /**
-     * Gets response.
-     *
-     * @return the response
-     */
-    public AlipayTradePayResponse getResponse() {
-        return response;
-    }
-
-    @Override
-    public boolean isTradeSuccess() {
-        return response != null &&
-                TradeStatus.SUCCESS.equals(tradeStatus);
-    }
-}

+ 0 - 65
pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FPrecreateResult.java

@@ -1,65 +0,0 @@
-package pay.platform.payment.alipay.trade.model.result;
-
-import com.alipay.api.response.AlipayTradePrecreateResponse;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public class AlipayF2FPrecreateResult implements Result {
-
-    private TradeStatus tradeStatus;
-    private AlipayTradePrecreateResponse response;
-
-    /**
-     * Instantiates a new Alipay f 2 f precreate result.
-     *
-     * @param response the response
-     */
-    public AlipayF2FPrecreateResult(AlipayTradePrecreateResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Sets trade status.
-     *
-     * @param tradeStatus the trade status
-     */
-    public void setTradeStatus(TradeStatus tradeStatus) {
-        this.tradeStatus = tradeStatus;
-    }
-
-    /**
-     * Sets response.
-     *
-     * @param response the response
-     */
-    public void setResponse(AlipayTradePrecreateResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Gets trade status.
-     *
-     * @return the trade status
-     */
-    public TradeStatus getTradeStatus() {
-        return tradeStatus;
-    }
-
-    /**
-     * Gets response.
-     *
-     * @return the response
-     */
-    public AlipayTradePrecreateResponse getResponse() {
-        return response;
-    }
-
-    @Override
-    public boolean isTradeSuccess() {
-        return response != null &&
-                TradeStatus.SUCCESS.equals(tradeStatus);
-    }
-}

+ 0 - 65
pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FQueryResult.java

@@ -1,65 +0,0 @@
-package pay.platform.payment.alipay.trade.model.result;
-
-import com.alipay.api.response.AlipayTradeQueryResponse;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public class AlipayF2FQueryResult implements Result {
-
-    private TradeStatus tradeStatus;
-    private AlipayTradeQueryResponse response;
-
-    /**
-     * Instantiates a new Alipay f 2 f query result.
-     *
-     * @param response the response
-     */
-    public AlipayF2FQueryResult(AlipayTradeQueryResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Sets trade status.
-     *
-     * @param tradeStatus the trade status
-     */
-    public void setTradeStatus(TradeStatus tradeStatus) {
-        this.tradeStatus = tradeStatus;
-    }
-
-    /**
-     * Sets response.
-     *
-     * @param response the response
-     */
-    public void setResponse(AlipayTradeQueryResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Gets trade status.
-     *
-     * @return the trade status
-     */
-    public TradeStatus getTradeStatus() {
-        return tradeStatus;
-    }
-
-    /**
-     * Gets response.
-     *
-     * @return the response
-     */
-    public AlipayTradeQueryResponse getResponse() {
-        return response;
-    }
-
-    @Override
-    public boolean isTradeSuccess() {
-        return response != null &&
-                TradeStatus.SUCCESS.equals(tradeStatus);
-    }
-}

+ 0 - 65
pay/src/main/java/pay/platform/payment/alipay/trade/model/result/AlipayF2FRefundResult.java

@@ -1,65 +0,0 @@
-package pay.platform.payment.alipay.trade.model.result;
-
-import com.alipay.api.response.AlipayTradeRefundResponse;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public class AlipayF2FRefundResult implements Result {
-
-    private TradeStatus tradeStatus;
-    private AlipayTradeRefundResponse response;
-
-    /**
-     * Instantiates a new Alipay f 2 f refund result.
-     *
-     * @param response the response
-     */
-    public AlipayF2FRefundResult(AlipayTradeRefundResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Sets trade status.
-     *
-     * @param tradeStatus the trade status
-     */
-    public void setTradeStatus(TradeStatus tradeStatus) {
-        this.tradeStatus = tradeStatus;
-    }
-
-    /**
-     * Sets response.
-     *
-     * @param response the response
-     */
-    public void setResponse(AlipayTradeRefundResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * Gets trade status.
-     *
-     * @return the trade status
-     */
-    public TradeStatus getTradeStatus() {
-        return tradeStatus;
-    }
-
-    /**
-     * Gets response.
-     *
-     * @return the response
-     */
-    public AlipayTradeRefundResponse getResponse() {
-        return response;
-    }
-
-    @Override
-    public boolean isTradeSuccess() {
-        return response != null &&
-                TradeStatus.SUCCESS.equals(tradeStatus);
-    }
-}

+ 0 - 15
pay/src/main/java/pay/platform/payment/alipay/trade/model/result/Result.java

@@ -1,15 +0,0 @@
-package pay.platform.payment.alipay.trade.model.result;
-
-/**
- * @author liuyangkly
- * date15/8/27
- */
-public interface Result {
-
-    /**
-     * 判断交易是否在业务上成功, 返回true说明一定成功,但是返回false并不代表业务不成功!因为还有unknown的状态可能业务已经成功了
-     *
-     * @return the boolean
-     */
-    boolean isTradeSuccess();
-}

+ 0 - 21
pay/src/main/java/pay/platform/payment/alipay/trade/service/AlipayMonitorService.java

@@ -1,21 +0,0 @@
-package pay.platform.payment.alipay.trade.service;
-
-import com.alipay.api.response.MonitorHeartbeatSynResponse;
-import pay.platform.payment.alipay.trade.model.builder.AlipayHeartbeatSynRequestBuilder;
-
-/**
- * @author liuyangkly
- * date15/10/22
- */
-public interface AlipayMonitorService {
-
-    // 交易保障接口 https://openhome.alipay.com/platform/document.htm#mobileApp-barcodePay-API-heartBeat
-
-    /**
-     * 可以提供给系统商/pos厂商使用
-     *
-     * @param builder the builder
-     * @return the monitor heartbeat syn response
-     */
-    MonitorHeartbeatSynResponse heartbeatSyn(AlipayHeartbeatSynRequestBuilder builder);
-}

+ 0 - 53
pay/src/main/java/pay/platform/payment/alipay/trade/service/AlipayTradeService.java

@@ -1,53 +0,0 @@
-package pay.platform.payment.alipay.trade.service;
-
-import pay.platform.payment.alipay.trade.model.builder.*;
-import pay.platform.payment.alipay.trade.model.result.*;
-import pay.platform.payment.alipay.trade.model.builder.*;
-import pay.platform.payment.alipay.trade.model.result.*;
-
-/**
- * @author liuyangkly
- * date15/7/29
- */
-public interface AlipayTradeService {
-
-    /**
-     * 当面付2.0流程支付
-     *
-     * @param builder the builder
-     * @return the alipay f 2 f pay result
-     */
-    AlipayF2FPayResult tradePay(AlipayTradePayRequestBuilder builder);
-
-    /**
-     * 当面付2.0消费查询
-     *
-     * @param builder the builder
-     * @return the alipay f 2 f query result
-     */
-    AlipayF2FQueryResult queryTradeResult(AlipayTradeQueryRequestBuilder builder);
-
-    /**
-     * 当面付2.0消费退款
-     *
-     * @param builder the builder
-     * @return the alipay f 2 f refund result
-     */
-    AlipayF2FRefundResult tradeRefund(AlipayTradeRefundRequestBuilder builder);
-
-    /**
-     * 当面付2.0预下单(生成二维码)
-     *
-     * @param builder the builder
-     * @return the alipay f 2 f precreate result
-     */
-    AlipayF2FPrecreateResult tradePrecreate(AlipayTradePrecreateRequestBuilder builder);
-
-    /**
-     * 当面付2.0 撤销订单
-     *
-     * @param builder the builder
-     * @return the alipay f 2 f cancel result
-     */
-    AlipayF2FCancelResult tradeCancel_II(AlipayTradeCancelRequestBuilder builder);
-}

+ 0 - 58
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AbsAlipayService.java

@@ -1,58 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl;
-
-import com.alipay.api.AlipayApiException;
-import com.alipay.api.AlipayClient;
-import com.alipay.api.AlipayRequest;
-import com.alipay.api.AlipayResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import pay.platform.payment.alipay.trade.model.builder.RequestBuilder;
-
-/**
- * Created by liuyangkly on 15/10/22.
- */
-abstract class AbsAlipayService {
-    /**
-     * The Log.
-     */
-    protected Log log = LogFactory.getLog(getClass());
-
-    /**
-     * Validate builder.
-     *
-     * @param builder the builder
-     */
-// 验证bizContent对象
-    protected void validateBuilder(RequestBuilder builder) {
-        if (builder == null) {
-            throw new NullPointerException("builder should not be NULL!");
-        }
-
-        if (!builder.validate()) {
-            throw new IllegalStateException("builder validate failed! " + builder.toString());
-        }
-    }
-
-    /**
-     * Gets response.
-     *
-     * @param client  the client
-     * @param request the request
-     * @return the response
-     */
-// 调用AlipayClient的execute方法,进行远程调用
-    @SuppressWarnings({"rawtypes", "unchecked"})
-    protected AlipayResponse getResponse(AlipayClient client, AlipayRequest request) {
-        try {
-            AlipayResponse response = client.execute(request);
-            if (response != null) {
-                log.debug(response.getBody());
-            }
-            return response;
-
-        } catch (AlipayApiException e) {
-            e.printStackTrace();
-            return null;
-        }
-    }
-}

+ 0 - 420
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AbsAlipayTradeService.java

@@ -1,420 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl;
-
-import com.alipay.api.AlipayClient;
-import com.alipay.api.AlipayResponse;
-import com.alipay.api.request.*;
-import com.alipay.api.response.*;
-import pay.platform.payment.alipay.trade.config.Constants;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-import pay.platform.payment.alipay.trade.model.builder.*;
-import pay.platform.payment.alipay.trade.model.result.*;
-import pay.platform.payment.alipay.trade.model.builder.*;
-import pay.platform.payment.alipay.trade.model.result.*;
-import pay.platform.payment.alipay.trade.service.AlipayTradeService;
-import pay.platform.payment.alipay.trade.utils.Utils;
-import pay.platform.common.utils.JsonUtil;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Created by liuyangkly on 15/10/28.
- */
-abstract class AbsAlipayTradeService extends AbsAlipayService implements AlipayTradeService {
-    /**
-     * The constant executorService.
-     */
-    protected static ExecutorService executorService = Executors.newCachedThreadPool();
-    /**
-     * The Client.
-     */
-    protected AlipayClient client;
-
-    @Override
-    public AlipayF2FQueryResult queryTradeResult(AlipayTradeQueryRequestBuilder builder) {
-        AlipayTradeQueryResponse response = tradeQuery(builder);
-
-        AlipayF2FQueryResult result = new AlipayF2FQueryResult(response);
-        if (querySuccess(response)) {
-            // 查询返回该订单交易支付成功
-            result.setTradeStatus(TradeStatus.SUCCESS);
-
-        } else if (tradeError(response)) {
-            // 查询发生异常,交易状态未知
-            result.setTradeStatus(TradeStatus.UNKNOWN);
-
-        } else {
-            // 其他情况均表明该订单号交易失败
-            result.setTradeStatus(TradeStatus.FAILED);
-        }
-        return result;
-    }
-
-    /**
-     * Trade query alipay trade query response.
-     *
-     * @param builder the builder
-     * @return the alipay trade query response
-     */
-    protected AlipayTradeQueryResponse tradeQuery(AlipayTradeQueryRequestBuilder builder) {
-        validateBuilder(builder);
-
-        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
-        request.putOtherTextParam("app_auth_token", builder.getAppAuthToken());
-        request.setBizContent(builder.toJsonString());
-        log.debug("trade.query bizContent:" + request.getBizContent());
-
-        return (AlipayTradeQueryResponse) getResponse(client, request);
-    }
-
-    @Override
-    public AlipayF2FRefundResult tradeRefund(AlipayTradeRefundRequestBuilder builder) {
-        validateBuilder(builder);
-
-        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
-        request.putOtherTextParam("app_auth_token", builder.getAppAuthToken());
-        request.setBizContent(builder.toJsonString());
-        log.debug("trade.refund bizContent:" + request.getBizContent());
-
-        AlipayTradeRefundResponse response = (AlipayTradeRefundResponse) getResponse(client, request);
-
-        AlipayF2FRefundResult result = new AlipayF2FRefundResult(response);
-        if (response != null && Constants.SUCCESS.equals(response.getCode())) {
-            // 退货交易成功
-            result.setTradeStatus(TradeStatus.SUCCESS);
-
-        } else if (tradeError(response)) {
-            // 退货发生异常,退货状态未知
-            result.setTradeStatus(TradeStatus.UNKNOWN);
-
-        } else {
-            // 其他情况表明该订单退货明确失败
-            result.setTradeStatus(TradeStatus.FAILED);
-        }
-        return result;
-    }
-
-    @Override
-    public AlipayF2FPrecreateResult tradePrecreate(AlipayTradePrecreateRequestBuilder builder) {
-        validateBuilder(builder);
-
-        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
-        request.putOtherTextParam("app_auth_token", builder.getAppAuthToken());
-        request.setBizContent(builder.toJsonString());
-        log.debug("trade.precreate bizContent:" + request.getBizContent());
-
-        AlipayTradePrecreateResponse response = (AlipayTradePrecreateResponse) getResponse(client, request);
-
-        AlipayF2FPrecreateResult result = new AlipayF2FPrecreateResult(response);
-        if (response != null && Constants.SUCCESS.equals(response.getCode())) {
-            // 预下单交易成功
-            result.setTradeStatus(TradeStatus.SUCCESS);
-
-        } else if (tradeError(response)) {
-            // 预下单发生异常,状态未知
-            result.setTradeStatus(TradeStatus.UNKNOWN);
-
-        } else {
-            // 其他情况表明该预下单明确失败
-            result.setTradeStatus(TradeStatus.FAILED);
-        }
-        return result;
-    }
-
-    // 商户可以直接使用的pay方法
-    @Override
-    public AlipayF2FPayResult tradePay(AlipayTradePayRequestBuilder builder) {
-        validateBuilder(builder);
-
-        final String outTradeNo = builder.getOutTradeNo();
-
-        AlipayTradePayRequest request = new AlipayTradePayRequest();
-        // 设置平台参数
-        request.setNotifyUrl(builder.getNotifyUrl());
-        String appAuthToken = builder.getAppAuthToken();
-        // todo 等支付宝sdk升级公共参数后使用如下方法
-        // request.setAppAuthToken(appAuthToken);
-        request.putOtherTextParam("app_auth_token", builder.getAppAuthToken());
-
-        // 设置业务参数
-        request.setBizContent(builder.toJsonString());
-        log.debug("trade.pay bizContent:" + request.getBizContent());
-
-        // 首先调用支付api
-        AlipayTradePayResponse response = (AlipayTradePayResponse) getResponse(client, request);
-
-        AlipayF2FPayResult result = new AlipayF2FPayResult(response);
-        if (response != null && Constants.SUCCESS.equals(response.getCode())) {
-            // 支付交易明确成功
-            result.setTradeStatus(TradeStatus.SUCCESS);
-
-        } else if (response != null && Constants.PAYING.equals(response.getCode())) {
-            // 返回用户处理中,则轮询查询交易是否成功,如果查询超时,则调用撤销
-            AlipayTradeQueryRequestBuilder queryBuiler = new AlipayTradeQueryRequestBuilder()
-                    .setAppAuthToken(appAuthToken)
-                    .setOutTradeNo(outTradeNo);
-            AlipayTradeQueryResponse loopQueryResponse = loopQueryResult(queryBuiler);
-            return checkQueryAndCancel(outTradeNo, appAuthToken, result, loopQueryResponse);
-
-        } else if (tradeError(response)) {
-            // 系统错误,则查询一次交易,如果交易没有支付成功,则调用撤销
-            AlipayTradeQueryRequestBuilder queryBuiler = new AlipayTradeQueryRequestBuilder()
-                    .setAppAuthToken(appAuthToken)
-                    .setOutTradeNo(outTradeNo);
-            AlipayTradeQueryResponse queryResponse = tradeQuery(queryBuiler);
-            return checkQueryAndCancel(outTradeNo, appAuthToken, result, queryResponse);
-
-        } else {
-            // 其他情况表明该订单支付明确失败
-            result.setTradeStatus(TradeStatus.FAILED);
-        }
-
-        return result;
-    }
-
-
-    /**
-     * Check query and cancel alipay f 2 f pay result.
-     *
-     * @param outTradeNo    the out trade no
-     * @param appAuthToken  the app auth token
-     * @param result        the result
-     * @param queryResponse the query response
-     * @return the alipay f 2 f pay result
-     */
-// 根据查询结果queryResponse判断交易是否支付成功,如果支付成功则更新result并返回,如果不成功则调用撤销
-    protected AlipayF2FPayResult checkQueryAndCancel(String outTradeNo, String appAuthToken, AlipayF2FPayResult result,
-                                                     AlipayTradeQueryResponse queryResponse) {
-        if (querySuccess(queryResponse)) {
-            // 如果查询返回支付成功,则返回相应结果
-            result.setTradeStatus(TradeStatus.SUCCESS);
-            result.setResponse(toPayResponse(queryResponse));
-            return result;
-        }
-
-        // 如果查询结果不为成功,则调用撤销
-        AlipayTradeCancelRequestBuilder builder = new AlipayTradeCancelRequestBuilder().setOutTradeNo(outTradeNo);
-        builder.setAppAuthToken(appAuthToken);
-        AlipayTradeCancelResponse cancelResponse = cancelPayResult(builder);
-        if (tradeError(cancelResponse)) {
-            // 如果第一次同步撤销返回异常,则标记支付交易为未知状态
-            result.setTradeStatus(TradeStatus.UNKNOWN);
-        } else {
-            // 标记支付为失败,如果撤销未能成功,产生的单边帐由人工处理
-            result.setTradeStatus(TradeStatus.FAILED);
-        }
-        return result;
-    }
-
-
-    /**
-     * Trade cancel alipay trade cancel response.
-     *
-     * @param builder the builder
-     * @return the alipay trade cancel response
-     */
-// 根据外部订单号outTradeNo撤销订单
-    protected AlipayTradeCancelResponse tradeCancel(AlipayTradeCancelRequestBuilder builder) {
-        validateBuilder(builder);
-
-        AlipayTradeCancelRequest request = new AlipayTradeCancelRequest();
-        request.putOtherTextParam("app_auth_token", builder.getAppAuthToken());
-        request.setBizContent(builder.toJsonString());
-        log.debug("trade.cancel bizContent:" + request.getBizContent());
-
-        return (AlipayTradeCancelResponse) getResponse(client, request);
-    }
-
-    @Override
-    public AlipayF2FCancelResult tradeCancel_II(AlipayTradeCancelRequestBuilder builder) {
-        //TODO FIXME XXX  撤销订单;
-        validateBuilder(builder);
-        //final String outTradeNo = builder.getOutTradeNo();
-
-        AlipayTradeCancelRequest request = new AlipayTradeCancelRequest();
-        request.setBizContent(JsonUtil.format(builder.getBizContent()));
-        AlipayTradeCancelResponse response = (AlipayTradeCancelResponse) getResponse(client, request);
-        AlipayF2FCancelResult result = new AlipayF2FCancelResult(response);
-        if (response != null && Constants.SUCCESS.equals(response.getCode())) {
-            result.setTradeStatus(TradeStatus.SUCCESS);
-        } else if (tradeError(response)) {
-            result.setTradeStatus(TradeStatus.FAILED);
-        } else {
-            result.setTradeStatus(TradeStatus.UNKNOWN);
-        }
-        return result;
-    }
-
-    /**
-     * Loop query result alipay trade query response.
-     *
-     * @param builder the builder
-     * @return the alipay trade query response
-     */
-// 轮询查询订单支付结果
-    protected AlipayTradeQueryResponse loopQueryResult(AlipayTradeQueryRequestBuilder builder) {
-        AlipayTradeQueryResponse queryResult = null;
-        for (int i = 0; i < Constants.max_query_retry; i++) {
-            Utils.sleep(Constants.query_duration);
-
-            AlipayTradeQueryResponse response = tradeQuery(builder);
-            if (response != null) {
-                if (stopQuery(response)) {
-                    return response;
-                }
-                queryResult = response;
-            }
-        }
-        return queryResult;
-    }
-
-    /**
-     * Stop query boolean.
-     *
-     * @param response the response
-     * @return the boolean
-     */
-// 判断是否停止查询
-    protected boolean stopQuery(AlipayTradeQueryResponse response) {
-        if (Constants.SUCCESS.equals(response.getCode())) {
-            if ("TRADE_FINISHED".equals(response.getTradeStatus()) ||
-                    "TRADE_SUCCESS".equals(response.getTradeStatus()) ||
-                    "TRADE_CLOSED".equals(response.getTradeStatus())) {
-                // 如果查询到交易成功、交易结束、交易关闭,则返回对应结果
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Cancel pay result alipay trade cancel response.
-     *
-     * @param builder the builder
-     * @return the alipay trade cancel response
-     */
-// 根据外部订单号outTradeNo撤销订单
-    protected AlipayTradeCancelResponse cancelPayResult(AlipayTradeCancelRequestBuilder builder) {
-        AlipayTradeCancelResponse response = tradeCancel(builder);
-        if (cancelSuccess(response)) {
-            // 如果撤销成功,则返回撤销结果
-            return response;
-        }
-
-        // 撤销失败
-        if (needRetry(response)) {
-            // 如果需要重试,首先记录日志,然后调用异步撤销
-            log.warn("begin async cancel request:" + builder);
-            asyncCancel(builder);
-        }
-        return response;
-    }
-
-    /**
-     * Async cancel.
-     *
-     * @param builder the builder
-     */
-// 异步撤销
-    protected void asyncCancel(final AlipayTradeCancelRequestBuilder builder) {
-        executorService.submit(new Runnable() {
-            @Override
-            public void run() {
-                for (int i = 0; i < Constants.max_cancel_retry; i++) {
-                    Utils.sleep(Constants.cancel_duration);
-
-                    AlipayTradeCancelResponse response = tradeCancel(builder);
-                    if (cancelSuccess(response) ||
-                            !needRetry(response)) {
-                        // 如果撤销成功或者应答告知不需要重试撤销,则返回撤销结果(无论撤销是成功失败,失败人工处理)
-                        return;
-                    }
-                }
-            }
-        });
-    }
-
-    /**
-     * To pay response alipay trade pay response.
-     *
-     * @param response the response
-     * @return the alipay trade pay response
-     */
-// 将查询应答转换为支付应答
-    protected AlipayTradePayResponse toPayResponse(AlipayTradeQueryResponse response) {
-        AlipayTradePayResponse payResponse = new AlipayTradePayResponse();
-        // 只有查询明确返回成功才能将返回码设置为10000,否则均为失败
-        payResponse.setCode(querySuccess(response) ? Constants.SUCCESS : Constants.FAILED);
-        // 补充交易状态信息
-        StringBuilder msg = new StringBuilder(response.getMsg())
-                .append(" tradeStatus:")
-                .append(response.getTradeStatus());
-        payResponse.setMsg(msg.toString());
-        payResponse.setSubCode(response.getSubCode());
-        payResponse.setSubMsg(response.getSubMsg());
-        payResponse.setBody(response.getBody());
-        payResponse.setParams(response.getParams());
-
-        // payResponse应该是交易支付时间,但是response里是本次交易打款给卖家的时间,是否有问题
-        // payResponse.setGmtPayment(response.getSendPayDate());
-        payResponse.setBuyerLogonId(response.getBuyerLogonId());
-        payResponse.setFundBillList(response.getFundBillList());
-        payResponse.setOpenId(response.getOpenId());
-        payResponse.setOutTradeNo(response.getOutTradeNo());
-        payResponse.setReceiptAmount(response.getReceiptAmount());
-        payResponse.setTotalAmount(response.getTotalAmount());
-        payResponse.setTradeNo(response.getTradeNo());
-        return payResponse;
-    }
-
-    /**
-     * Need retry boolean.
-     *
-     * @param response the response
-     * @return the boolean
-     */
-// 撤销需要重试
-    protected boolean needRetry(AlipayTradeCancelResponse response) {
-        return response == null ||
-                "Y".equals(response.getRetryFlag());
-    }
-
-    /***
-     * 查询返回“支付成功”
-     * Modified by Hanley 新增查询成功状态 TRADE_CLOSED-[line 310 已注释]
-     * @param response the response
-     * @return boolean boolean
-     */
-    protected boolean querySuccess(AlipayTradeQueryResponse response) {
-        return response != null &&
-                Constants.SUCCESS.equals(response.getCode()) &&
-                ("TRADE_SUCCESS".equals(response.getTradeStatus()) ||
-                        "TRADE_FINISHED".equals(response.getTradeStatus())
-//                        || "TRADE_CLOSED".equals(response.getTradeStatus())
-                );
-    }
-
-    /**
-     * Cancel success boolean.
-     *
-     * @param response the response
-     * @return the boolean
-     */
-// 撤销返回“撤销成功”
-    protected boolean cancelSuccess(AlipayTradeCancelResponse response) {
-        return response != null &&
-                Constants.SUCCESS.equals(response.getCode());
-    }
-
-    /**
-     * Trade error boolean.
-     *
-     * @param response the response
-     * @return the boolean
-     */
-// 交易异常,或发生系统错误
-    protected boolean tradeError(AlipayResponse response) {
-        return response == null ||
-                Constants.ERROR.equals(response.getCode());
-    }
-}

+ 0 - 192
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AlipayMonitorServiceImpl.java

@@ -1,192 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl;
-
-import com.alipay.api.AlipayClient;
-import com.alipay.api.DefaultAlipayClient;
-import com.alipay.api.request.MonitorHeartbeatSynRequest;
-import com.alipay.api.response.MonitorHeartbeatSynResponse;
-import org.apache.commons.lang3.StringUtils;
-import pay.platform.payment.alipay.trade.config.Constants;
-import pay.platform.payment.alipay.trade.model.builder.AlipayHeartbeatSynRequestBuilder;
-import pay.platform.payment.alipay.trade.service.AlipayMonitorService;
-
-
-/**
- * Created by liuyangkly on 15/10/22.
- */
-public class AlipayMonitorServiceImpl extends AbsAlipayService implements AlipayMonitorService {
-    private AlipayClient client;
-
-    /**
-     * The type Client builder.
-     */
-    public static class ClientBuilder {
-        private String gatewayUrl;
-        private String appid;
-        private String privateKey;
-        private String format;
-        private String charset;
-
-        /**
-         * Build alipay monitor service.
-         *
-         * @return the alipay monitor service
-         */
-        public AlipayMonitorServiceImpl build() {
-            if (StringUtils.isEmpty(gatewayUrl)) {
-                gatewayUrl = Constants.mcloud_api_domain; // 与openapi网关地址不同
-            }
-            if (StringUtils.isEmpty(appid)) {
-                throw new NullPointerException("appid can not be Null.");
-            }
-            if (StringUtils.isEmpty(privateKey)) {
-                throw new NullPointerException("privateKey can not be Null.");
-            }
-            if (StringUtils.isEmpty(format)) {
-                format = "json";
-            }
-            if (StringUtils.isEmpty(charset)) {
-                charset = "utf-8";
-            }
-            return new AlipayMonitorServiceImpl(this);
-        }
-
-        /**
-         * Sets appid.
-         *
-         * @param appid the appid
-         * @return the appid
-         */
-        public ClientBuilder setAppid(String appid) {
-            this.appid = appid;
-            return this;
-        }
-
-        /**
-         * Sets charset.
-         *
-         * @param charset the charset
-         * @return the charset
-         */
-        public ClientBuilder setCharset(String charset) {
-            this.charset = charset;
-            return this;
-        }
-
-        /**
-         * Sets format.
-         *
-         * @param format the format
-         * @return the format
-         */
-        public ClientBuilder setFormat(String format) {
-            this.format = format;
-            return this;
-        }
-
-        /**
-         * Sets gateway url.
-         *
-         * @param gatewayUrl the gateway url
-         * @return the gateway url
-         */
-        public ClientBuilder setGatewayUrl(String gatewayUrl) {
-            this.gatewayUrl = gatewayUrl;
-            return this;
-        }
-
-        /**
-         * Sets private key.
-         *
-         * @param privateKey the private key
-         * @return the private key
-         */
-        public ClientBuilder setPrivateKey(String privateKey) {
-            this.privateKey = privateKey;
-            return this;
-        }
-
-        /**
-         * Gets appid.
-         *
-         * @return the appid
-         */
-        public String getAppid() {
-            return appid;
-        }
-
-        /**
-         * Gets charset.
-         *
-         * @return the charset
-         */
-        public String getCharset() {
-            return charset;
-        }
-
-        /**
-         * Gets format.
-         *
-         * @return the format
-         */
-        public String getFormat() {
-            return format;
-        }
-
-        /**
-         * Gets gateway url.
-         *
-         * @return the gateway url
-         */
-        public String getGatewayUrl() {
-            return gatewayUrl;
-        }
-
-        /**
-         * Gets private key.
-         *
-         * @return the private key
-         */
-        public String getPrivateKey() {
-            return privateKey;
-        }
-    }
-
-    /**
-     * Instantiates a new Alipay monitor service.
-     *
-     * @param builder the builder
-     */
-    public AlipayMonitorServiceImpl(ClientBuilder builder) {
-        if (StringUtils.isEmpty(builder.getGatewayUrl())) {
-            throw new NullPointerException("gatewayUrl should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getAppid())) {
-            throw new NullPointerException("appid should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getPrivateKey())) {
-            throw new NullPointerException("privateKey should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getFormat())) {
-            throw new NullPointerException("format should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getCharset())) {
-            throw new NullPointerException("charset should not be NULL!");
-        }
-
-        // 此处不需要使用alipay public key,因为金融云不产生签名
-        client = new DefaultAlipayClient(builder.getGatewayUrl(), builder.getAppid(), builder.getPrivateKey(),
-                builder.getFormat(), builder.getCharset());
-    }
-
-    @Override
-    public MonitorHeartbeatSynResponse heartbeatSyn(AlipayHeartbeatSynRequestBuilder builder) {
-        validateBuilder(builder);
-
-        MonitorHeartbeatSynRequest request = new MonitorHeartbeatSynRequest();
-        request.putOtherTextParam("app_auth_token", builder.getAppAuthToken());
-        request.setBizContent(builder.toJsonString());
-        log.debug("heartbeat.sync bizContent:" + request.getBizContent());
-
-        return (MonitorHeartbeatSynResponse) getResponse(client, request);
-    }
-}

+ 0 - 232
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AlipayTradeServiceImpl.java

@@ -1,232 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl;
-
-import com.alipay.api.AlipayConstants;
-import com.alipay.api.DefaultAlipayClient;
-import org.apache.commons.lang3.StringUtils;
-
-
-/**
- * Created by liuyangkly on 15/7/29.
- * Modified By Hanley on 17/3/7
- * 支付宝核心接口,使用API前需先行初始化.
- */
-public class AlipayTradeServiceImpl extends AbsAlipayTradeService {
-
-    /**
-     * The type Client builder.
-     */
-    public static class ClientBuilder {
-        private String gatewayUrl;
-        private String appid;
-        private String privateKey;
-        private String format;
-        private String charset;
-        private String alipayPublicKey;
-        private String signType;
-
-        /***
-         * Modified By Hanley
-         * 移除properties中读取支付宝参数
-         * @return alipay trade service
-         */
-        public AlipayTradeServiceImpl build() {
-            if (StringUtils.isEmpty(gatewayUrl)) {
-                throw new NullPointerException("gatewayUrl should not be NULL!"); // 与mcloudmonitor网关地址不同
-            }
-            if (StringUtils.isEmpty(appid)) {
-                throw new NullPointerException("appid should not be NULL!");
-            }
-            if (StringUtils.isEmpty(privateKey)) {
-                throw new NullPointerException("privateKey should not be NULL!");
-            }
-            if (StringUtils.isEmpty(format)) {
-                format = "json";
-            }
-            if (StringUtils.isEmpty(charset)) {
-                charset = "utf-8";
-            }
-//            if (StringUtils.isEmpty(alipayPublicKey)) {
-//                throw new NullPointerException("alipayPublicKey should not be NULL!");
-//            }
-            if (StringUtils.isEmpty(signType)) {
-                throw new NullPointerException("signType should not be NULL!");
-            } else {
-                if (signType.equalsIgnoreCase(AlipayConstants.SIGN_TYPE_RSA2) && StringUtils.isEmpty(alipayPublicKey)) {
-                    throw new NullPointerException("please set alipay_public_key first,when the sign_type is RSA2!");
-                }
-            }
-
-
-            return new AlipayTradeServiceImpl(this);
-        }
-
-        /**
-         * Sets alipay public key.
-         *
-         * @param alipayPublicKey the alipay public key
-         * @return the alipay public key
-         */
-        public ClientBuilder setAlipayPublicKey(String alipayPublicKey) {
-            this.alipayPublicKey = alipayPublicKey;
-            return this;
-        }
-
-        /**
-         * Sets appid.
-         *
-         * @param appid the appid
-         * @return the appid
-         */
-        public ClientBuilder setAppid(String appid) {
-            this.appid = appid;
-            return this;
-        }
-
-        /**
-         * Sets charset.
-         *
-         * @param charset the charset
-         * @return the charset
-         */
-        public ClientBuilder setCharset(String charset) {
-            this.charset = charset;
-            return this;
-        }
-
-        /**
-         * Sets format.
-         *
-         * @param format the format
-         * @return the format
-         */
-        public ClientBuilder setFormat(String format) {
-            this.format = format;
-            return this;
-        }
-
-        /**
-         * Sets gateway url.
-         *
-         * @param gatewayUrl the gateway url
-         * @return the gateway url
-         */
-        public ClientBuilder setGatewayUrl(String gatewayUrl) {
-            this.gatewayUrl = gatewayUrl;
-            return this;
-        }
-
-        /**
-         * Sets private key.
-         *
-         * @param privateKey the private key
-         * @return the private key
-         */
-        public ClientBuilder setPrivateKey(String privateKey) {
-            this.privateKey = privateKey;
-            return this;
-        }
-
-        /**
-         * Gets alipay public key.
-         *
-         * @return the alipay public key
-         */
-        public String getAlipayPublicKey() {
-            return alipayPublicKey;
-        }
-
-        /**
-         * Gets appid.
-         *
-         * @return the appid
-         */
-        public String getAppid() {
-            return appid;
-        }
-
-        /**
-         * Gets charset.
-         *
-         * @return the charset
-         */
-        public String getCharset() {
-            return charset;
-        }
-
-        /**
-         * Gets format.
-         *
-         * @return the format
-         */
-        public String getFormat() {
-            return format;
-        }
-
-        /**
-         * Gets gateway url.
-         *
-         * @return the gateway url
-         */
-        public String getGatewayUrl() {
-            return gatewayUrl;
-        }
-
-        /**
-         * Gets private key.
-         *
-         * @return the private key
-         */
-        public String getPrivateKey() {
-            return privateKey;
-        }
-
-        /**
-         * Gets sign type.
-         *
-         * @return the sign type
-         */
-        public String getSignType() {
-            return signType;
-        }
-
-        /**
-         * Sets sign type.
-         *
-         * @param signType the sign type
-         */
-        public void setSignType(String signType) {
-            this.signType = signType;
-        }
-    }
-
-    /**
-     * Instantiates a new Alipay trade service.
-     *
-     * @param builder the builder
-     */
-    public AlipayTradeServiceImpl(ClientBuilder builder) {
-        if (StringUtils.isEmpty(builder.getGatewayUrl())) {
-            throw new NullPointerException("gatewayUrl should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getAppid())) {
-            throw new NullPointerException("appid should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getPrivateKey())) {
-            throw new NullPointerException("privateKey should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getFormat())) {
-            throw new NullPointerException("format should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getCharset())) {
-            throw new NullPointerException("charset should not be NULL!");
-        }
-//        if (StringUtils.isEmpty(builder.getAlipayPublicKey())) {
-//            throw new NullPointerException("alipayPublicKey should not be NULL!");
-//        }
-
-        client = new DefaultAlipayClient(builder.getGatewayUrl(), builder.getAppid(), builder.getPrivateKey(),
-                builder.getFormat(), builder.getCharset(), builder.getAlipayPublicKey(), builder.getSignType());
-    }
-
-
-}

+ 0 - 377
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/AlipayTradeWithHBServiceImpl.java

@@ -1,377 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl;
-
-import com.alipay.api.AlipayApiException;
-import com.alipay.api.AlipayClient;
-import com.alipay.api.DefaultAlipayClient;
-import com.alipay.api.request.AlipayTradePayRequest;
-import com.alipay.api.response.AlipayTradePayResponse;
-import com.alipay.api.response.AlipayTradeQueryResponse;
-import org.apache.commons.lang3.StringUtils;
-import pay.platform.payment.alipay.trade.config.Constants;
-import pay.platform.payment.alipay.trade.model.TradeStatus;
-import pay.platform.payment.alipay.trade.model.builder.AlipayTradePayRequestBuilder;
-import pay.platform.payment.alipay.trade.model.builder.AlipayTradeQueryRequestBuilder;
-import pay.platform.payment.alipay.trade.model.result.AlipayF2FPayResult;
-import pay.platform.payment.alipay.trade.service.impl.hb.HbListener;
-import pay.platform.payment.alipay.trade.service.impl.hb.TradeListener;
-
-import java.net.ConnectException;
-import java.net.NoRouteToHostException;
-import java.net.SocketException;
-import java.net.SocketTimeoutException;
-
-
-/**
- * @author liuyangkly
- * date15/7/29
- * <p>
- * 一定要在创建AlipayTradeService之前调用Configs.init("alipayrisk10");设置参数
- */
-public class AlipayTradeWithHBServiceImpl extends AbsAlipayTradeService {
-
-    private TradeListener listener;
-
-    /**
-     * The type Client builder.
-     */
-    public static class ClientBuilder {
-        private String gatewayUrl;
-        private String appid;
-        private String privateKey;
-        private String format;
-        private String charset;
-        private String alipayPublicKey;
-        private TradeListener listener;
-
-        /**
-         * Build alipay trade with hb service.
-         *
-         * @return the alipay trade with hb service
-         */
-        public AlipayTradeWithHBServiceImpl build() {
-            if (StringUtils.isEmpty(gatewayUrl)) {
-                gatewayUrl = Constants.open_api_domain; // 与mcloudmonitor网关地址不同
-            }
-            if (StringUtils.isEmpty(appid)) {
-                throw new NullPointerException("appid can not be Null.");
-            }
-            if (StringUtils.isEmpty(privateKey)) {
-                throw new NullPointerException("privateKey can not be Null.");
-            }
-            if (StringUtils.isEmpty(format)) {
-                format = "json";
-            }
-            if (StringUtils.isEmpty(charset)) {
-                charset = "utf-8";
-            }
-            if (StringUtils.isEmpty(alipayPublicKey)) {
-                throw new NullPointerException("alipayPublicKey can not be Null.");
-            }
-            if (listener == null) {
-                listener = new HbListener();  // 默认监听器
-            }
-
-            return new AlipayTradeWithHBServiceImpl(this);
-        }
-
-        /**
-         * Gets listener.
-         *
-         * @return the listener
-         */
-        public TradeListener getListener() {
-            return listener;
-        }
-
-        /**
-         * Sets listener.
-         *
-         * @param listener the listener
-         * @return the listener
-         */
-        public ClientBuilder setListener(TradeListener listener) {
-            this.listener = listener;
-            return this;
-        }
-
-        /**
-         * Sets alipay public key.
-         *
-         * @param alipayPublicKey the alipay public key
-         * @return the alipay public key
-         */
-        public ClientBuilder setAlipayPublicKey(String alipayPublicKey) {
-            this.alipayPublicKey = alipayPublicKey;
-            return this;
-        }
-
-        /**
-         * Sets appid.
-         *
-         * @param appid the appid
-         * @return the appid
-         */
-        public ClientBuilder setAppid(String appid) {
-            this.appid = appid;
-            return this;
-        }
-
-        /**
-         * Sets charset.
-         *
-         * @param charset the charset
-         * @return the charset
-         */
-        public ClientBuilder setCharset(String charset) {
-            this.charset = charset;
-            return this;
-        }
-
-        /**
-         * Sets format.
-         *
-         * @param format the format
-         * @return the format
-         */
-        public ClientBuilder setFormat(String format) {
-            this.format = format;
-            return this;
-        }
-
-        /**
-         * Sets gateway url.
-         *
-         * @param gatewayUrl the gateway url
-         * @return the gateway url
-         */
-        public ClientBuilder setGatewayUrl(String gatewayUrl) {
-            this.gatewayUrl = gatewayUrl;
-            return this;
-        }
-
-        /**
-         * Sets private key.
-         *
-         * @param privateKey the private key
-         * @return the private key
-         */
-        public ClientBuilder setPrivateKey(String privateKey) {
-            this.privateKey = privateKey;
-            return this;
-        }
-
-        /**
-         * Gets alipay public key.
-         *
-         * @return the alipay public key
-         */
-        public String getAlipayPublicKey() {
-            return alipayPublicKey;
-        }
-
-        /**
-         * Gets appid.
-         *
-         * @return the appid
-         */
-        public String getAppid() {
-            return appid;
-        }
-
-        /**
-         * Gets charset.
-         *
-         * @return the charset
-         */
-        public String getCharset() {
-            return charset;
-        }
-
-        /**
-         * Gets format.
-         *
-         * @return the format
-         */
-        public String getFormat() {
-            return format;
-        }
-
-        /**
-         * Gets gateway url.
-         *
-         * @return the gateway url
-         */
-        public String getGatewayUrl() {
-            return gatewayUrl;
-        }
-
-        /**
-         * Gets private key.
-         *
-         * @return the private key
-         */
-        public String getPrivateKey() {
-            return privateKey;
-        }
-    }
-
-    /**
-     * Instantiates a new Alipay trade with hb service.
-     *
-     * @param builder the builder
-     */
-    public AlipayTradeWithHBServiceImpl(ClientBuilder builder) {
-        if (StringUtils.isEmpty(builder.getGatewayUrl())) {
-            throw new NullPointerException("gatewayUrl should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getAppid())) {
-            throw new NullPointerException("appid should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getPrivateKey())) {
-            throw new NullPointerException("privateKey should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getFormat())) {
-            throw new NullPointerException("format should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getCharset())) {
-            throw new NullPointerException("charset should not be NULL!");
-        }
-        if (StringUtils.isEmpty(builder.getAlipayPublicKey())) {
-            throw new NullPointerException("alipayPublicKey should not be NULL!");
-        }
-        if (builder.getListener() == null) {
-            throw new NullPointerException("listener should not be NULL!");
-        }
-
-        listener = builder.getListener();
-        client = new DefaultAlipayClient(builder.getGatewayUrl(), builder.getAppid(), builder.getPrivateKey(),
-                builder.getFormat(), builder.getCharset(), builder.getAlipayPublicKey());
-    }
-
-    private AlipayTradePayResponse getResponse(AlipayClient client, AlipayTradePayRequest request,
-                                               final String outTradeNo, final long beforeCall) {
-        try {
-            AlipayTradePayResponse response = client.execute(request);
-            if (response != null) {
-                log.debug(response.getBody());
-            }
-            return response;
-
-        } catch (AlipayApiException e) {
-            // 获取异常真实原因
-            Throwable cause = e.getCause();
-
-            if (cause instanceof ConnectException ||
-                    cause instanceof NoRouteToHostException) {
-                // 建立连接异常
-                executorService.submit(new Runnable() {
-                    @Override
-                    public void run() {
-                        listener.onConnectException(outTradeNo, beforeCall);
-                    }
-                });
-
-            } else if (cause instanceof SocketException) {
-                // 报文上送异常
-                executorService.submit(new Runnable() {
-                    @Override
-                    public void run() {
-                        listener.onSendException(outTradeNo, beforeCall);
-                    }
-                });
-
-            } else if (cause instanceof SocketTimeoutException) {
-                // 报文接收异常
-                executorService.submit(new Runnable() {
-                    @Override
-                    public void run() {
-                        listener.onReceiveException(outTradeNo, beforeCall);
-                    }
-                });
-            }
-
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    // 商户可以直接使用的pay方法,并且集成了监控代码
-    @Override
-    public AlipayF2FPayResult tradePay(AlipayTradePayRequestBuilder builder) {
-        validateBuilder(builder);
-
-        final String outTradeNo = builder.getOutTradeNo();
-
-        AlipayTradePayRequest request = new AlipayTradePayRequest();
-        // 设置平台参数
-        String appAuthToken = builder.getAppAuthToken();
-        request.setNotifyUrl(builder.getNotifyUrl());
-        request.putOtherTextParam("app_auth_token", appAuthToken);
-
-        // 设置业务参数
-        request.setBizContent(builder.toJsonString());
-        log.debug("trade.pay bizContent:" + request.getBizContent());
-
-        // 首先调用支付api
-        final long beforeCall = System.currentTimeMillis();
-        AlipayTradePayResponse response = getResponse(client, request, outTradeNo, beforeCall);
-
-        AlipayF2FPayResult result = new AlipayF2FPayResult(response);
-        if (response != null && Constants.SUCCESS.equals(response.getCode())) {
-            // 支付交易明确成功
-            result.setTradeStatus(TradeStatus.SUCCESS);
-
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    listener.onPayTradeSuccess(outTradeNo, beforeCall);
-                }
-            });
-
-        } else if (response != null && Constants.PAYING.equals(response.getCode())) {
-            // 返回支付中,同步交易耗时
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    listener.onPayInProgress(outTradeNo, beforeCall);
-                }
-            });
-
-            // 返回用户处理中,则轮询查询交易是否成功,如果查询超时,则调用撤销
-            AlipayTradeQueryRequestBuilder queryBuiler = new AlipayTradeQueryRequestBuilder()
-                    .setAppAuthToken(appAuthToken)
-                    .setOutTradeNo(outTradeNo);
-            AlipayTradeQueryResponse loopQueryResponse = loopQueryResult(queryBuiler);
-            return checkQueryAndCancel(outTradeNo, appAuthToken, result, loopQueryResponse);
-
-        } else if (tradeError(response)) {
-            // 系统错误,同步交易耗时
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    listener.onPayFailed(outTradeNo, beforeCall);
-                }
-            });
-
-            // 系统错误,则查询一次交易,如果交易没有支付成功,则调用撤销
-            AlipayTradeQueryRequestBuilder queryBuiler = new AlipayTradeQueryRequestBuilder()
-                    .setAppAuthToken(appAuthToken)
-                    .setOutTradeNo(outTradeNo);
-            AlipayTradeQueryResponse queryResponse = tradeQuery(queryBuiler);
-            return checkQueryAndCancel(outTradeNo, appAuthToken, result, queryResponse);
-
-        } else {
-            // 其他情况表明该订单支付明确失败
-            result.setTradeStatus(TradeStatus.FAILED);
-
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    listener.onPayFailed(outTradeNo, beforeCall);
-                }
-            });
-        }
-
-        return result;
-    }
-}

+ 0 - 129
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/AbsHbRunner.java

@@ -1,129 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl.hb;
-
-import com.alipay.api.response.MonitorHeartbeatSynResponse;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import pay.platform.payment.alipay.trade.config.Constants;
-import pay.platform.payment.alipay.trade.model.builder.AlipayHeartbeatSynRequestBuilder;
-import pay.platform.payment.alipay.trade.service.AlipayMonitorService;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Created by liuyangkly on 15/10/23.
- */
-public abstract class AbsHbRunner implements Runnable {
-    /**
-     * The Log.
-     */
-    protected Log log = LogFactory.getLog(getClass());
-
-    /**
-     * Gets builder.
-     *
-     * @return the builder
-     */
-// 获取交易保障所需的信息
-    public abstract AlipayHeartbeatSynRequestBuilder getBuilder();
-
-    /**
-     * Gets app auth token.
-     *
-     * @return the app auth token
-     */
-// 获取商户授权令牌,系统商通过此令牌帮助商户发起请求,完成业务
-    public abstract String getAppAuthToken();
-
-    private ScheduledExecutorService scheduledService = Executors.newSingleThreadScheduledExecutor();
-    private AlipayMonitorService monitorService;
-
-    private long delay = 0;
-    private long duration = 0;
-
-    /**
-     * Instantiates a new Abs hb runner.
-     *
-     * @param monitorService the monitor service
-     */
-    public AbsHbRunner(AlipayMonitorService monitorService) {
-        this.monitorService = monitorService;
-    }
-
-    @Override
-    public void run() {
-        AlipayHeartbeatSynRequestBuilder builder = getBuilder();
-        builder.setAppAuthToken(getAppAuthToken());
-
-        MonitorHeartbeatSynResponse response = monitorService.heartbeatSyn(builder);
-
-        StringBuilder sb = new StringBuilder(response.getCode())
-                .append(":")
-                .append(response.getMsg());
-        if (StringUtils.isNotEmpty(response.getSubCode())) {
-            sb.append(", ")
-                    .append(response.getSubCode())
-                    .append(":")
-                    .append(response.getSubMsg());
-        }
-        log.debug(sb.toString());
-    }
-
-    /**
-     * Schedule.
-     */
-    public void schedule() {
-        if (delay == 0) {
-            delay = Constants.heartbeat_delay;
-        }
-        if (duration == 0) {
-            duration = Constants.cancel_duration;
-        }
-        scheduledService.scheduleAtFixedRate(this, delay, duration, TimeUnit.SECONDS);
-    }
-
-    /**
-     * Shutdown.
-     */
-    public void shutdown() {
-        scheduledService.shutdown();
-    }
-
-    /**
-     * Gets delay.
-     *
-     * @return the delay
-     */
-    public long getDelay() {
-        return delay;
-    }
-
-    /**
-     * Sets delay.
-     *
-     * @param delay the delay
-     */
-    public void setDelay(long delay) {
-        this.delay = delay;
-    }
-
-    /**
-     * Gets duration.
-     *
-     * @return the duration
-     */
-    public long getDuration() {
-        return duration;
-    }
-
-    /**
-     * Sets duration.
-     *
-     * @param duration the duration
-     */
-    public void setDuration(long duration) {
-        this.duration = duration;
-    }
-}

+ 0 - 56
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/HbListener.java

@@ -1,56 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl.hb;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import pay.platform.payment.alipay.trade.model.hb.HbStatus;
-import pay.platform.payment.alipay.trade.model.hb.SysTradeInfo;
-
-/**
- * Created by liuyangkly on 15/10/28.
- */
-public class HbListener implements TradeListener {
-    private static Log log = LogFactory.getLog(HbListener.class);
-
-    private void offerTradeInfo(String outTradeNo, long beforeCall, HbStatus status) {
-        // 获取当前毫秒数
-        long afterCall = System.currentTimeMillis();
-
-        // 通过交易请求发生时毫秒数计算得到交易耗时
-        double timeConsume = ((double) (afterCall - beforeCall)) / 1000.0;
-
-        log.debug(outTradeNo + " offer " + status + ": " + timeConsume);
-
-        // 创建系统商trade_info结构,添加进队列
-        HbQueue.offer(SysTradeInfo.newInstance(outTradeNo, timeConsume, status));
-    }
-
-    @Override
-    public void onPayTradeSuccess(String outTradeNo, long beforeCall) {
-        offerTradeInfo(outTradeNo, beforeCall, HbStatus.S);
-    }
-
-    @Override
-    public void onPayInProgress(String outTradeNo, long beforeCall) {
-        offerTradeInfo(outTradeNo, beforeCall, HbStatus.I);
-    }
-
-    @Override
-    public void onPayFailed(String outTradeNo, long beforeCall) {
-        offerTradeInfo(outTradeNo, beforeCall, HbStatus.F);
-    }
-
-    @Override
-    public void onConnectException(String outTradeNo, long beforeCall) {
-        offerTradeInfo(outTradeNo, beforeCall, HbStatus.X);
-    }
-
-    @Override
-    public void onSendException(String outTradeNo, long beforeCall) {
-        offerTradeInfo(outTradeNo, beforeCall, HbStatus.Y);
-    }
-
-    @Override
-    public void onReceiveException(String outTradeNo, long beforeCall) {
-        offerTradeInfo(outTradeNo, beforeCall, HbStatus.Z);
-    }
-}

+ 0 - 65
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/HbQueue.java

@@ -1,65 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl.hb;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import pay.platform.payment.alipay.trade.model.hb.SysTradeInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-
-/**
- * Created by liuyangkly on 15/10/23.
- */
-public class HbQueue {
-    private static Log log = LogFactory.getLog(HbQueue.class);
-
-    /**
-     * The constant QUEUE_SIZE.
-     */
-    public static final int QUEUE_SIZE = 300;   // 最多同时保存300条交易记录
-    private static final BlockingQueue<SysTradeInfo> queue = new ArrayBlockingQueue<SysTradeInfo>(QUEUE_SIZE);
-
-    /**
-     * Offer.
-     *
-     * @param info the info
-     */
-    public synchronized static void offer(SysTradeInfo info) {
-        // blockingQueue不需要考虑队列满的情况,生产者会被阻塞直到队列被消耗
-        if (info != null) {
-            try {
-                // 使用阻塞put
-                queue.put(info);
-            } catch (InterruptedException e) {
-                log.warn("interrupted for tradeInfo:" + info);
-                e.printStackTrace();
-            }
-        }
-    }
-
-    /**
-     * Poll list.
-     *
-     * @return the list
-     */
-    public synchronized static List<SysTradeInfo> poll() {
-        if (queue.isEmpty()) {
-            // 如果队列为空,则直接返回
-            return null;
-        }
-
-        int size = 30;
-        List<SysTradeInfo> tradeInfoList = new ArrayList<SysTradeInfo>(size);
-        for (int i = 0; i < size; i++) {
-            // 使用非阻塞poll
-            SysTradeInfo info = queue.poll();
-            if (info == null) {
-                break;
-            }
-            tradeInfoList.add(info);
-        }
-        return tradeInfoList;
-    }
-}

+ 0 - 61
pay/src/main/java/pay/platform/payment/alipay/trade/service/impl/hb/TradeListener.java

@@ -1,61 +0,0 @@
-package pay.platform.payment.alipay.trade.service.impl.hb;
-
-/**
- * Created by liuyangkly on 15/10/27.
- */
-public interface TradeListener {
-
-    /**
-     * On pay trade success.
-     *
-     * @param outTradeNo the out trade no
-     * @param beforeCall the before call
-     */
-// 支付成功
-    public void onPayTradeSuccess(String outTradeNo, long beforeCall);
-
-    /**
-     * On pay in progress.
-     *
-     * @param outTradeNo the out trade no
-     * @param beforeCall the before call
-     */
-// 支付处理中
-    public void onPayInProgress(String outTradeNo, long beforeCall);
-
-    /**
-     * On pay failed.
-     *
-     * @param outTradeNo the out trade no
-     * @param beforeCall the before call
-     */
-// 支付失败
-    public void onPayFailed(String outTradeNo, long beforeCall);
-
-    /**
-     * On connect exception.
-     *
-     * @param outTradeNo the out trade no
-     * @param beforeCall the before call
-     */
-// 建立连接异常
-    public void onConnectException(String outTradeNo, long beforeCall);
-
-    /**
-     * On send exception.
-     *
-     * @param outTradeNo the out trade no
-     * @param beforeCall the before call
-     */
-// 报文上送异常
-    public void onSendException(String outTradeNo, long beforeCall);
-
-    /**
-     * On receive exception.
-     *
-     * @param outTradeNo the out trade no
-     * @param beforeCall the before call
-     */
-// 报文接收异常
-    public void onReceiveException(String outTradeNo, long beforeCall);
-}

+ 0 - 40
pay/src/main/java/pay/platform/payment/alipay/trade/utils/GsonFactory.java

@@ -1,40 +0,0 @@
-package pay.platform.payment.alipay.trade.utils;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-import pay.platform.payment.alipay.trade.model.hb.*;
-import pay.platform.payment.alipay.trade.model.hb.*;
-
-import java.lang.reflect.Type;
-import java.util.List;
-
-/**
- * @author liuyangkly
- * date15/6/26
- * 使用google gson作为json序列化反序列化工具
- */
-public class GsonFactory {
-
-    private static class GsonHolder {
-        private static Type exceptionListType = new TypeToken<List<ExceptionInfo>>() {
-        }.getType();
-        private static Type tradeInfoListType = new TypeToken<List<TradeInfo>>() {
-        }.getType();
-
-        private static Gson gson = new GsonBuilder()
-                .registerTypeAdapter(exceptionListType, new ExceptionInfoAdapter())
-                .registerTypeAdapter(tradeInfoListType, new TradeInfoAdapter())
-                .registerTypeAdapter(EquipStatus.class, new EquipStatusAdapter())
-                .create();
-    }
-
-    /**
-     * Gets gson.
-     *
-     * @return the gson
-     */
-    public static Gson getGson() {
-        return GsonHolder.gson;
-    }
-}

+ 0 - 98
pay/src/main/java/pay/platform/payment/alipay/trade/utils/Utils.java

@@ -1,98 +0,0 @@
-package pay.platform.payment.alipay.trade.utils;
-
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Created by liuyangkly on 15/6/27.
- * 杂物工具类
- */
-public class Utils {
-
-    private Utils() {
-        // No instances.
-    }
-
-    /**
-     * To amount string.
-     *
-     * @param amount the amount
-     * @return the string
-     */
-    public static String toAmount(long amount) {
-        return new BigDecimal(amount).divide(new BigDecimal(100)).toString();
-    }
-
-    /**
-     * To date string.
-     *
-     * @param date the date
-     * @return the string
-     */
-    public static String toDate(Date date) {
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
-    }
-
-    /**
-     * Is empty boolean.
-     *
-     * @param object the object
-     * @return the boolean
-     */
-    public static boolean isEmpty(Object object) {
-        if (object instanceof String) {
-            return StringUtils.isEmpty((String) object);
-        }
-        return object == null;
-    }
-
-    /**
-     * Is not empty boolean.
-     *
-     * @param object the object
-     * @return the boolean
-     */
-    public static boolean isNotEmpty(Object object) {
-        return !isEmpty(object);
-    }
-
-    /**
-     * Is list not empty boolean.
-     *
-     * @param <T>  the type parameter
-     * @param list the list
-     * @return the boolean
-     */
-    public static <T> boolean isListNotEmpty(List<T> list) {
-        return list != null && list.size() > 0;
-    }
-
-    /**
-     * Is list empty boolean.
-     *
-     * @param <T>  the type parameter
-     * @param list the list
-     * @return the boolean
-     */
-    public static <T> boolean isListEmpty(List<T> list) {
-        return !isListNotEmpty(list);
-    }
-
-    /**
-     * Sleep.
-     *
-     * @param time the time
-     */
-    public static void sleep(long time) {
-        try {
-            Thread.sleep(time);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 0 - 98
pay/src/main/java/pay/platform/payment/alipay/trade/utils/ZxingUtils.java

@@ -1,98 +0,0 @@
-package pay.platform.payment.alipay.trade.utils;//package pay.platform.payment.alipay.trade.utils;
-//
-//import com.google.zxing.BarcodeFormat;
-//import com.google.zxing.EncodeHintType;
-//import com.google.zxing.MultiFormatWriter;
-//import com.google.zxing.common.BitMatrix;
-//import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//
-//import javax.imageio.ImageIO;
-//import java.awt.image.BufferedImage;
-//import java.io.File;
-//import java.io.IOException;
-//import java.util.Hashtable;
-//import java.util.Map;
-//
-///**
-// *
-// * @author liuyangkly
-// * date15/6/27
-// * 使用了google zxing作为二维码生成工具
-// */
-//public class ZxingUtils {
-//
-//	private static Log log = LogFactory.getLog(ZxingUtils.class);
-//
-//    private static final int BLACK = 0xFF000000;
-//    private static final int WHITE = 0xFFFFFFFF;
-//
-//    private static BufferedImage toBufferedImage(BitMatrix matrix) {
-//        int width = matrix.getWidth();
-//        int height = matrix.getHeight();
-//        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-//        for (int x = 0; x < width; x++) {
-//            for (int y = 0; y < height; y++) {
-//                image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
-//            }
-//        }
-//        return image;
-//    }
-//
-//    private static void writeToFile(BitMatrix matrix, String format, File file) throws IOException {
-//        BufferedImage image = toBufferedImage(matrix);
-//        if (!ImageIO.write(image, format, file)) {
-//            throw new IOException("Could not write an image of format " + format + " to " + file);
-//        }
-//    }
-//
-//    /**
-//     * 将内容contents生成长宽均为width的图片,图片路径由imgPath指定
-//     *
-//     * @param contents the contents
-//     * @param width    the width
-//     * @param imgPath  the img path
-//     * @return the qr code imge
-//     */
-//    public static File getQRCodeImge(String contents, int width, String imgPath) {
-//        return getQRCodeImge(contents, width, width, imgPath);
-//    }
-//
-//    /**
-//     * 将内容contents生成长为width,宽为width的图片,图片路径由imgPath指定
-//     *
-//     * @param contents the contents
-//     * @param width    the width
-//     * @param height   the height
-//     * @param imgPath  the img path
-//     * @return the qr code imge
-//     */
-//    public static File getQRCodeImge(String contents, int width, int height, String imgPath) {
-//		try {
-//            Map<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
-//            hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
-//            hints.put(EncodeHintType.CHARACTER_SET, "UTF8");
-//
-//			BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE, width, height, hints);
-//
-//            File imageFile = new File(imgPath);
-//			writeToFile(bitMatrix, "png", imageFile);
-//
-//            return imageFile;
-//
-//		} catch (Exception e) {
-//			log.error("create QR code error!", e);
-//            return null;
-//		}
-//	}
-//
-//    /**
-//     * The entry point of application.
-//     *
-//     * @param args the input arguments
-//     */
-//    public static void main(String[] args) {
-//        getQRCodeImge("hanley",250,250,"/zone/hanley.png");
-//    }
-//}

+ 0 - 168
pay/src/main/java/pay/platform/payment/alipay/utils/AlipayUtil.java

@@ -1,168 +0,0 @@
-package pay.platform.payment.alipay.utils;
-
-import jakarta.servlet.http.HttpServletRequest;
-import pay.platform.common.sign.RSA;
-import pay.platform.payment.alipay.entity.response.AlipayNotifyResponse;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/***
- * 支付宝通知处理类,处理支付宝各接口通知返回
- * @author HanleyTang
- */
-public class AlipayUtil {
-
-    /**
-     * 支付宝消息验证地址
-     */
-    private static final String HTTPS_VERIFY_URL = "https://mapi.alipay.com/gateway.do?service=notify_verify&";
-
-    /**
-     * Verify alipay notify response.
-     *
-     * @param alipayRequest   the alipay request
-     * @param partner         the partner
-     * @param alipayPublicKey the alipay public key
-     * @return the alipay notify response
-     */
-    public AlipayNotifyResponse verify(HttpServletRequest alipayRequest, String partner, String alipayPublicKey) {
-        AlipayNotifyResponse output = new AlipayNotifyResponse();
-        try {
-            //获取支付宝POST过来反馈信息
-            Map<String, String> params = new HashMap<String, String>();
-            Map requestParams = alipayRequest.getParameterMap();
-            for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext(); ) {
-                String name = (String) iter.next();
-                String[] values = (String[]) requestParams.get(name);
-                String valueStr = "";
-                for (int i = 0; i < values.length; i++) {
-                    valueStr = (i == values.length - 1) ? valueStr + values[i]
-                            : valueStr + values[i] + ",";
-                }
-                //乱码解决,这段代码在出现乱码时使用。如果mysign和sign不相等也可以使用这段代码转化 'valueStr = new String(valueStr.getBytes("ISO-8859-1"), "gbk")'
-                params.put(name, valueStr);
-            }
-            String outTradeNo = new String(alipayRequest.getParameter("out_trade_no").getBytes("ISO-8859-1"), "UTF-8");
-            String tradeNo = new String(alipayRequest.getParameter("trade_no").getBytes("ISO-8859-1"), "UTF-8");
-            String tradeStatus = new String(alipayRequest.getParameter("trade_status").getBytes("ISO-8859-1"), "UTF-8");
-            boolean verifyFlg = verify(params, partner, alipayPublicKey);
-            output.setVerifyFlg(verifyFlg);
-            output.setOutTradeNo(outTradeNo);
-            output.setTradeNo(tradeNo);
-            output.setTradeStatus(tradeStatus);
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        return output;
-
-    }
-
-
-    /**
-     * 验证消息是否是支付宝发出的合法消息
-     *
-     * @param params 通知返回来的参数数组
-     * @return 验证结果
-     */
-    private static boolean verify(Map<String, String> params, String partner, String alipayPublicKey) {
-
-        //判断responsetTxt是否为true,isSign是否为true
-        //responsetTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关
-        //isSign不是true,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关
-        String responseTxt = "false";
-        if (params.get("notify_id") != null) {
-            String notifyId = params.get("notify_id");
-            responseTxt = verifyResponse(notifyId, partner);
-        }
-        String sign = "";
-        if (params.get("sign") != null) {
-            sign = params.get("sign");
-        }
-        boolean isSign = getSignVeryfy(params, sign, alipayPublicKey);
-
-        //写日志记录(若要调试,请取消下面两行注释)
-        //String sWord = "responseTxt=" + responseTxt + "\n isSign=" + isSign + "\n 返回回来的参数:" + AlipayCore.createLinkString(params);
-        //AlipayCore.logResult(sWord);
-
-        if (isSign && responseTxt.equals("true")) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * 根据反馈回来的信息,生成签名结果
-     *
-     * @param params 通知返回来的参数数组
-     * @param sign   比对的签名结果
-     * @return 生成的签名结果
-     */
-    private static boolean getSignVeryfy(Map<String, String> params, String sign, String alipayPublicKey) {
-        //过滤空值、sign与sign_type参数
-        Map<String, String> sParaNew = VerifyUtil.paraFilter(params);
-        //获取待签名字符串
-        String preSignStr = VerifyUtil.createLinkString(sParaNew);
-        //获得签名验证结果
-        boolean isSign = false;
-        //if(AlipayConfig.sign_type.equals("RSA")){
-        //这里判断是否需要RSA验证签名 TODO
-        isSign = RSA.verify(preSignStr, sign, alipayPublicKey, "utf-8");
-        //}
-        return isSign;
-    }
-
-    /**
-     * 获取远程服务器ATN结果,验证返回URL
-     *
-     * @param notifyId 通知校验ID
-     * @param partner  合作者ID
-     * @return 服务器ATN结果
-     * 验证结果集:
-     * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空
-     * true 返回正确信息
-     * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟
-     */
-    private static String verifyResponse(String notifyId, String partner) {
-        //获取远程服务器ATN结果,验证是否是支付宝服务器发来的请求
-
-        String veryfyUrl = HTTPS_VERIFY_URL + "partner=" + partner + "&notify_id=" + notifyId;
-
-        return checkUrl(veryfyUrl);
-    }
-
-    /**
-     * 获取远程服务器ATN结果
-     *
-     * @param urlValue 指定URL路径地址
-     * @return 服务器ATN结果
-     * 验证结果集:
-     * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空
-     * true 返回正确信息
-     * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟
-     */
-    private static String checkUrl(String urlValue) {
-        String inputLine;
-
-        try {
-            URL url = new URL(urlValue);
-            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
-            BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection
-                    .getInputStream()));
-            inputLine = in.readLine().toString();
-        } catch (Exception e) {
-            e.printStackTrace();
-            inputLine = "";
-        }
-
-        return inputLine;
-    }
-}

+ 0 - 67
pay/src/main/java/pay/platform/payment/alipay/utils/VerifyUtil.java

@@ -1,67 +0,0 @@
-package pay.platform.payment.alipay.utils;
-
-import java.util.*;
-
-/**
- * 支付宝验证Util Class
- *
- * @author HanleyTang
- * date2017/3/9
- */
-public class VerifyUtil {
-
-
-    /**
-     * 除去数组中的空值和签名参数
-     *
-     * @param sArray 签名参数组
-     * @return 去掉空值与签名参数后的新签名参数组
-     */
-    public static Map<String, String> paraFilter(Map<String, String> sArray) {
-
-        Map<String, String> result = new HashMap<String, String>();
-
-        if (sArray == null || sArray.size() <= 0) {
-            return result;
-        }
-
-        for (String key : sArray.keySet()) {
-            String value = sArray.get(key);
-            if (value == null || value.equals("") || key.equalsIgnoreCase("sign")
-                    || key.equalsIgnoreCase("sign_type")) {
-                continue;
-            }
-            result.put(key, value);
-        }
-
-        return result;
-    }
-
-    /**
-     * 把数组所有元素排序,并按照“参数=参数值”的模式
-     *
-     * @param params 需要排序并参与字符拼接的参数组
-     * @return 拼接后字符串
-     */
-    public static String createLinkString(Map<String, String> params) {
-
-
-        List<String> keys = new ArrayList<String>(params.keySet());
-        Collections.sort(keys);
-
-        String prestr = "";
-
-        for (int i = 0; i < keys.size(); i++) {
-            String key = keys.get(i);
-            String value = params.get(key);
-            //拼接时,不包括最后一个&字符
-            if (i == keys.size() - 1) {
-                prestr = prestr + key + "=" + value;
-            } else {
-                prestr = prestr + key + "=" + value + "&";
-            }
-        }
-
-        return prestr;
-    }
-}

+ 47 - 56
pay/src/test/java/pay/platform/AlipayTest.java

@@ -1,34 +1,33 @@
 package pay.platform;
 
-import cn.hutool.log.Log;
-import cn.hutool.log.LogFactory;
-import com.alipay.api.AlipayConstants;
+import cn.hutool.json.JSONUtil;
+import com.alipay.api.AlipayClient;
+import com.alipay.api.domain.AlipayTradePrecreateModel;
+import com.alipay.api.domain.AlipayTradeQueryModel;
+import com.alipay.api.response.AlipayTradePrecreateResponse;
+import com.alipay.api.response.AlipayTradeQueryResponse;
+import lombok.extern.slf4j.Slf4j;
 import org.junit.Before;
 import org.junit.Test;
-import pay.platform.common.utils.JsonUtil;
-import pay.platform.payment.alipay.AlipayClient;
-import pay.platform.payment.alipay.core.AlipayCore;
-import pay.platform.payment.alipay.entity.request.AlipayQrcodeRequest;
-import pay.platform.payment.alipay.entity.response.AlipayQrcodeResponse;
-import pay.platform.payment.alipay.entity.response.AlipayQueryResponse;
+import pay.platform.alipay.enums.AliPayApi;
+import pay.platform.alipay.enums.AliPayApiConfig;
 
 import static org.junit.Assert.assertTrue;
 
+@Slf4j
 public class AlipayTest {
 
-    private static final Log log = LogFactory.get();
-
     // RSA2 秘钥长度为2048
-    private final static String appid = "9021000137605333";
+    private final static String appid = "9021000136699665";
 
-    private final static String private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCHq5RcHLJGljC92IYPeNthE+r7XMIS243r0LxWBumsSh1/OCE9tXntM7yEOPefU2tC3c2P7Ad+tA8TwNfZTfD7vvvjwKj1nh1d6J8BLIMGTfbuPU20dJgDm3poAvrGyf8CWaZBqCR5F27uN1DcNWX6Hf/EumieMvjeMmeg53AFKot8loTV/YP+k7pg4R1Xz8yAhE09f7gX17Vafl+sQBJkQRrTtjlzBpx67dOllPDwMIl2S/0x3dVfYEc/z5qVJwps8bRsEFhESRKn4dlMAhcwnZD/mtj5b6He6AjXIPW/iTGlhoWsi0FC9Ei9MmYzMVJDUkdiEgQJPXWqBVqiKjF/AgMBAAECggEACdQ4b2P01oBTD638KGrNGf9jasqRlOQrKAZ7XpAppb3I3UqnvdzD9Jdm9P1bk0Nr5fBD0EV9VYSeAwRZnviymMqBXUK7+u91mTQdMOyUoYRMe34dfxFjYf+Fort0h6piuzzbeq4/1jYIZ2HCjfGgbbp2qT4IDk4LEa39K/8YcodDc6OQns9tCJnfEs8vjldAl8g8JzpIX9yP/8PkyfjqWkIjETprSfYWUbc1dURwnM2dufRPtSL7Dlw60EgCX5YXTKofzI8LuDRAFFkBN7b0p/pfgDnvljX4Ms5S90n3RzAI9LIo6DfEjbc1J6LigjJWd+RuealINgATmAYQfERtYQKBgQDKROh9pLyBJjhN4BWAMWsl8Fi+uwcgzfaNEv7Chrd3P5vHGfsBxYSc7RlGOhfGE/D6rNAmDV7yb3/z+GgcHWdeSSuqq+iz+mMYd0A2nQCpDfeBzjc/hjB5m5nQPN1MijJbU4OjbJQr4Ua8NVjlTHxTC8xzXb0sFzhu1TanZVkFswKBgQCrta8Xq8B6+MRBw4f7ULqLcNp35K9kfZb5dhbEuq9ouJGhL2goIQhYa6wNEhltODgWrqF+NWN8a+zFVzYtnQjYNBZ1OaOjCPu+ogPlgKCTEoaZg0QfKFNM4oyrd7T3AMC5KmAurzbhUz2tX/LWP4Rvdekf0eC2VvAFUPGcd24XBQKBgFzbAXgclkUbzKFDi9tL1IqYKcV1irIum07sN3QJ8FOYKeVfMfIAQP7hgcbRiHRwVyJdDzlIzhuxwCW6FeFCRl/sa1VwkeV9vtxOcnYf4Vu6g7NdfdN1wO8y1YvZRSaMEs4GKtptUCBMzPI9809gq3pcYkFb+Soyhr+qtepnBlUtAoGAMLeRf+PI7praA9aYJCOZaaqRMWb+pEJFrW1ltFdLISkMmHC82nXUylFyNRsnf6dtsnHFe+tl2I0+VhcSVgqx0bWlkYjS9pS76DBLbrf51wBwk+l8UGK+j5fPVW7XNyVNiLuPIm+v4Gofm6sXWNYYmw8XH2IKoXE1FC0M/9masIkCgYBQKYv0EOWMIY9LXQhYaZwl42IE2Eb36WdPBJX+tmVJ1heXRdJO2huFIUeaFS5qgGROnPICxLDOK0JdwfIm/6i7yc58SxQy1fUoEbIHdx/BUORq27WfUQZES3Z/7pTHQXLVPM5+aXim+oN+J8xK+uo987+Np5uiTx/sXKmCSuZ1vg==";
+    private final static String private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCdhvoCQ9vcM36PB86hikhg3tjarBLt185YmoZGSLbdjzaI8iFpgs0EzRmWQSWRBRxjlhdYQGONr6AN6XNzQwUH91Mk/TqL+M3MNND6nqy/C2aKMNGS3e9/2B7ajmJz5oSBGuX+2yVslZNYArtBCYeK9cQCn74rVNEmBmdVxv7sYnII3mXjM0HIy99VstDz+ODiapPGI4lRqCg4bCNMDoyQp3WvDxcs02ElleNZ5hVyqZEusUYS3FjbE9ehzeUbb40w8wjoVf14qAZNtxV3S7Sg4g1WJeOyp2hSldwDxjhXWsOmjj4CSA+HwQ7UFqFXlO1y5lsFwTzmYY85r50cPMp1AgMBAAECggEAPnYAt9k0WlHIwunzkrYEEPULw1krgEdruFI9H61BZQSeORrZCL8mj9rLZHqcbK48HXir9QBC+TFEI4AHmRJf8lKtEyOdjVawM2JV4qn8ERxyIiVNVBDQID8PrNV8UDx9GbwSqkU2x6FfdSxQF2+x4PWmLOwuOXw+Gfe8DZUEC7I1x7iYEhJ7JzSyVDEaMVLa/ShEnfs9mkKVKPUwLLsMzpJPLiiPNFPT7gOt3XG32j2wKil6ZBjfkaQQXpq5cmA3ik7UH7g0O7FkRH9ZEEJrtOcC/WKFpSKqRlVO6/wc/23PO6VGF3B53KQjFv98zK8JaGWsCVPDqVaH1S2Zh3P1AQKBgQDUdLKFQL1efZ1bllL5clgA7vZ00TicKuiZxElMlv8Iul6vPjQtKi3ZHVWo0exviAoVVjn2RPtRGOyxfdpFd7b+MjPQw5egXia0SB8m4V5Uefz/wUhoqM2asGSoelqrc+PRY48odNnojZt8wrEHxbbVfI4oWULpyqF6kWq1o4+n1QKBgQC90D3tak0/ldFdJArM3NKpN1ZkNcLp8dgXoUCZQTIE9DjCVojblD2xyMWeWtH5LnHoLHaOvVDtLJJuZ3Z4XFw7RbGKjjC9VWafktj0t5W8wybIdbMwIaEQjfYenogNAFxhWiRxidGttuGJ/49fP1p1H41pR8s3I5whi76zXdOIIQKBgFMlGHhtza6dGmgtfGuDBE3ZNzqgZrc3U7BZ0RXYQhb4WPXcMi86wpallFBtV0qOwuN2y1hFxtUGHBuaVUG6iDMTEpQw97YbIqqLTyW4LWKCGzE8Q0oyRcS0I7CLsdBHmnDnta7vjBgm0yMQTpfsGJGUHU5NIJK+alO9dTWAvUfBAoGBAKVuvLqSnpcfnWTfR+Z7Q8Ol7k7SqHm7hco6iZHIx66XqGyAfTFbh1XPFaXJpB3YhACF2CLaD5FW+pzs4c1POjeSq4WGHia2KwZDN4I6C3CEaeXm53C4rqc+A1d2dj9WpC1ZIlAufSg5L2NV8IBkOBPClz4+C3iYObjnEiNEUFvhAoGBAKZjpKinPpJ2FzlLe8iGVo+TI5czfoWXMJBOKyE3UBwHrjU2uEueuRdKlHb+yyDTwO8Ca5jEUea6ANQcTtMdx9u+sp4kYBW8Hk0yeH1Y7WAo3anW5vYElLGt7FnGLQ3H0DN28hfmWmEuOvOHS3UwigZryK4tuRCpf0ofdFF4tk6W";
 
-    private final static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmiju7cMbYfap3OKPVMptB3gpTtqs82hrh996sRQmFKLdHLIik76Dbn0KGLmvj98cuYFAUu/H1yhx/ZZr4ma9q0jWPbWXR0fo6NgYtyPyK9pUEkxPz8eDv+rwVQXGmeDrfnj6fXxx1dRoe1sAOiGVPiHABWWcSlfXmAtPfwNaSc8KFZ1u9a9SkknFKab4U6mhxey2rtWn+JCFy+mBijf9FQTUWAAN84/q7t2tl7gTJmW7vJp5MgYwmAhHYN4quqhnDkaxElRY3hOw+RF/hpnL5JJAuRMIps9bikNemedvn+ujWnzqIKQsTpzw9tSOT0CxJ5IBMHUK/HkxMCbxTIS7rQIDAQAB";
+    private final static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLk3nxvN3tye9Z11/PNYV4IFNXUYzax5UkU/dTz51ObBSdQOGltRLLiQTlaQYEI8ZwJfhj5FQB2UQZJqwXLrwfNR2DczmOJxLBGarH+8Ck96WPinjIG7zMLQ/r4HJ7+85s04bXXTAU3y+zybwCpJzGB7y7kP7hccAzcMOsW42efmjKUOQujOJrtAcYlxZMaix3+mP0zBy3FAynbGCpa9/9uGgwf6F3G+li50bDatSOCEPsbV3MgtyQBKn6XTcqnYu4L82VWVOZ4GzW5aUfqqTyJIZXNm81cyVFGhWednGJPo+i2+z0A41j14/qOCvfoyhmpoMSNWODQn197eIL9W+wIDAQAB";
 
     /**
      * The Alipay core.
      */
-    static AlipayCore alipayCore;
+    static AliPayApiConfig aliPayApiConfig;
 
 
     /**
@@ -36,17 +35,12 @@ public class AlipayTest {
      */
     @Before
     public void init() {
-        AlipayCore.ClientBuilder clientBuilder = new AlipayCore.ClientBuilder();
-        //signType=rsa时,可不传 alipay_public_key
-        //alipayCore = clientBuilder.setAppId(appid).setPrivateKey(private_key).setSignType(AlipayConstants.SIGN_TYPE_RSA).build();
-
-        //signType=rsa2时,必须传 支付宝公钥 alipay_public_key
-        alipayCore = clientBuilder
-                .setAlipayPublicKey(alipay_public_key)
+        // 配置服务商 APPID
+        aliPayApiConfig = AliPayApiConfig.builder()
                 .setAppId(appid)
+                .setAliPayPublicKey(alipay_public_key)
                 .setPrivateKey(private_key)
-                .setSignType(AlipayConstants.SIGN_TYPE_RSA2)
-                .setSandbox(true)
+                .setServiceUrl(AliPayApiConfig.SANDBOX_GATEWAY_URL)
                 .build();
     }
 
@@ -56,23 +50,16 @@ public class AlipayTest {
     @Test
     public void testQuery() {
         try {
-//            {
-//                "outTradeNo": "1716450272073",
-//                    "subject": "购买商品",
-//                    "totalAmount": "0.01",
-//                    "storeId": "0001025104489",
-//                    "undiscountableAmount": "0",
-//                    "sellerId": "",
-//                    "body": "测试下单",
-//                    "operatorId": "990001"
-//            }
             // 商户订单号
-            String outTradeNo = "1716450272073";
-            AlipayQueryResponse response = AlipayClient.query(outTradeNo, alipayCore);
-            log.debug(STR."response=\{JsonUtil.format(response)}");
+            String outTradeNo = "1716767441429";
+
+            AlipayTradeQueryModel model = new AlipayTradeQueryModel();
+            model.setOutTradeNo(outTradeNo);
+            AlipayTradeQueryResponse response = AliPayApi.tradeQueryToResponse(aliPayApiConfig.getAliPayClient(), model, null);
+            log.info(STR."response=\n\{JSONUtil.formatJsonStr(JSONUtil.toJsonStr(response))}");
             assertTrue(response.isSuccess());
         } catch (Exception e) {
-            log.error(e);
+            log.error("异常:", e);
         }
     }
 
@@ -93,32 +80,36 @@ public class AlipayTest {
             String subject = "购买商品";
             // 商品描述
             String body = "测试下单";
-            // 操作员
-            String operatorId = "990001";
-            // 店铺
-            String storeId = "0001025104489";
             // 金额
             String totalAmount = "0.01";
-
-            AlipayQrcodeRequest request = new AlipayQrcodeRequest();
-            request.setSysServiceProviderId(sysServiceProviderId);
-            request.setSubject(subject);
-            request.setOutTradeNo(outTradeNo);
-            request.setBody(body);
-            request.setOperatorId(operatorId);
-            request.setStoreId(storeId);
-            request.setTotalAmount(totalAmount);
-            System.out.println(request);
-            AlipayQrcodeResponse response = AlipayClient.preCreate(request, alipayCore);
-            log.debug(STR."response=\{JsonUtil.format(response)}");
-            log.debug(STR."request=\{JsonUtil.format(request)}");
+            // 商户PID
+            String sellerId = "2088721035632591";
+
+            String url = "http://cpw4s8.natappfree.cc/api/notify/alipay_callback";
+
+            AlipayTradePrecreateModel model = new AlipayTradePrecreateModel();
+            model.setOutTradeNo(outTradeNo);
+            model.setSubject(subject);
+            model.setBody(body);
+            model.setTotalAmount(totalAmount);
+            model.setSellerId(sellerId);
+            model.setTimeoutExpress("30m");
+            model.setTotalAmount("0.01");
+            model.setSellerId(sellerId);
+
+            AlipayClient aliPayClient = aliPayApiConfig.getAliPayClient();
+            AlipayTradePrecreateResponse response = AliPayApi.tradePrecreatePayToResponse(aliPayClient, model, url, null);
+
+            log.info(STR."response=\{JSONUtil.formatJsonStr(JSONUtil.toJsonStr(response))}");
+            log.info(STR."request=\{JSONUtil.formatJsonStr(JSONUtil.toJsonStr(model))}");
             if (response.isSuccess()) {
                 String qrCodeUrl = response.getQrCode();
                 QRCodeUtil.writeQRCodePrint(qrCodeUrl);
             }
+            System.out.println("\n\n\n\n\n\n\n\n\n\n");
             assertTrue(response.isSuccess());
         } catch (Exception e) {
-            log.error(e);
+            log.error("异常:", e);
         }
     }
 }

+ 1 - 1
web/admin-api/pom.xml

@@ -135,7 +135,7 @@
             <plugin>
                 <groupId>com.google.cloud.tools</groupId>
                 <artifactId>jib-maven-plugin</artifactId>
-                <version>3.4.0</version>
+                <version>3.4.2</version>
                 <configuration>
                     <!-- 拉取所需的基础镜像 - 这里的jdk21,是用于运行springboot项目 -->
                     <from>