diff --git a/kernel-d-pay/pay-api/pom.xml b/kernel-d-pay/pay-api/pom.xml index 926d2e61c..159e03c94 100644 --- a/kernel-d-pay/pay-api/pom.xml +++ b/kernel-d-pay/pay-api/pom.xml @@ -11,10 +11,4 @@ pay-api - - 8 - 8 - - - \ No newline at end of file diff --git a/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/PayApi.java b/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/PayApi.java index 3c0604a76..489b39131 100644 --- a/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/PayApi.java +++ b/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/PayApi.java @@ -38,36 +38,34 @@ public interface PayApi { /** * PC网页支付 * - * @param orderName 订单名称 + * @param orderName 订单名称 * @param outTradeNo 商家订单编号 - * @param total 金额 - * @param returnUrl 付款完成后跳转页面 + * @param total 金额 + * @param returnUrl 付款完成后跳转页面 * @return 支付页面 * @author huziyang * @date 2021/04/20 20:43 */ String page(String orderName, String outTradeNo, String total, String returnUrl); - /** * 手机支付 * - * @param orderName 订单名称 + * @param orderName 订单名称 * @param outTradeNo 商家订单编号 - * @param total 金额 - * @param quitUrl 中途退出时返回的页面 - * @param returnUrl 付款完成后跳转页面 + * @param total 金额 + * @param quitUrl 中途退出时返回的页面 + * @param returnUrl 付款完成后跳转页面 * @return 支付页面 * @author huziyang * @date 2021/04/20 20:43 */ String wap(String orderName, String outTradeNo, String total, String quitUrl, String returnUrl); - /** * 退款 * - * @param outTradeNo 商家订单编号 + * @param outTradeNo 商家订单编号 * @param refundAmount 退款金额 * @return 退款结果 * @author huziyang @@ -75,5 +73,4 @@ public interface PayApi { */ TradeRefundResponse refund(String outTradeNo, String refundAmount); - } diff --git a/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/constants/PayConstants.java b/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/constants/PayConstants.java index 5a1384847..da72e7168 100644 --- a/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/constants/PayConstants.java +++ b/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/constants/PayConstants.java @@ -42,7 +42,6 @@ public interface PayConstants { */ String PAY_EXCEPTION_STEP_CODE = "80"; - /** * 退款成功的返回码 */ diff --git a/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/pojo/TradeRefundResponse.java b/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/pojo/TradeRefundResponse.java index 41291a1a4..58a933740 100644 --- a/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/pojo/TradeRefundResponse.java +++ b/kernel-d-pay/pay-api/src/main/java/cn/stylefeng/roses/kernel/pay/api/pojo/TradeRefundResponse.java @@ -25,7 +25,10 @@ package cn.stylefeng.roses.kernel.pay.api.pojo; import cn.stylefeng.roses.kernel.pay.api.constants.PayConstants; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * 退款响应 @@ -37,7 +40,7 @@ import lombok.*; @NoArgsConstructor @AllArgsConstructor @Builder -public class TradeRefundResponse{ +public class TradeRefundResponse { /** * 退款状态码 @@ -88,12 +91,12 @@ public class TradeRefundResponse{ * 初始化一个新创建的 TradeRefundResponse对象 * * @param code 状态码 - * @param msg 描述 + * @param msg 描述 * @param data 对象值 * @author huziyang * @date 2021/04/20 20:43 */ - public TradeRefundResponse(String code, String msg, Object data){ + public TradeRefundResponse(String code, String msg, Object data) { this.code = code; this.msg = msg; this.data = data; @@ -102,17 +105,16 @@ public class TradeRefundResponse{ /** * 返回错误信息 * - * @param msg 描述 + * @param msg 描述 * @param data 对象值 * @return TradeRefundResponse对象 * @author huziyang * @date 2021/04/20 20:43 */ - public static TradeRefundResponse error(String msg, Object data){ - return new TradeRefundResponse(PayConstants.REFUND_ERROR_CODE,msg,data); + public static TradeRefundResponse error(String msg, Object data) { + return new TradeRefundResponse(PayConstants.REFUND_ERROR_CODE, msg, data); } - /** * 返回错误信息 * @@ -121,9 +123,8 @@ public class TradeRefundResponse{ * @author huziyang * @date 2021/04/20 20:43 */ - public static TradeRefundResponse error(String msg){ - return error(msg,null); + public static TradeRefundResponse error(String msg) { + return error(msg, null); } - } diff --git a/kernel-d-pay/pay-sdk-alipay/pom.xml b/kernel-d-pay/pay-sdk-alipay/pom.xml index 3486c066c..dee113d80 100644 --- a/kernel-d-pay/pay-sdk-alipay/pom.xml +++ b/kernel-d-pay/pay-sdk-alipay/pom.xml @@ -11,25 +11,20 @@ pay-sdk-alipay - - 8 - 8 - - cn.stylefeng.roses pay-api - 7.0.4 + ${roses.version} com.alipay.sdk alipay-easysdk - 2.2.0 + ${alipay.version} diff --git a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/config/AlipayConfig.java b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/config/AlipayConfig.java index c79b7f951..bf21f4fe2 100644 --- a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/config/AlipayConfig.java +++ b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/config/AlipayConfig.java @@ -48,7 +48,7 @@ public class AlipayConfig implements ApplicationRunner { /** * 私钥 - */ + */ @Value("${alipay.merchantPrivateKey}") private String merchantPrivateKey; @@ -132,5 +132,4 @@ public class AlipayConfig implements ApplicationRunner { return config; } - } diff --git a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/constants/AlipayConstants.java b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/constants/AlipayConstants.java index 3a257e671..5d84e071b 100644 --- a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/constants/AlipayConstants.java +++ b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/constants/AlipayConstants.java @@ -33,4 +33,5 @@ package cn.stylefeng.roses.kernel.pay.alipay.constants; public interface AlipayConstants { String ALIPAY_REFUND_SUCCESS_CODE = "10000"; + } diff --git a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/AlipayService.java b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/AlipayService.java index 925560096..4824c1790 100644 --- a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/AlipayService.java +++ b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/AlipayService.java @@ -38,36 +38,34 @@ public interface AlipayService { /** * PC网页支付 * - * @param orderName 订单名称 + * @param orderName 订单名称 * @param outTradeNo 商家订单编号 - * @param total 金额 - * @param returnUrl 付款完成后跳转页面 + * @param total 金额 + * @param returnUrl 付款完成后跳转页面 * @return 支付页面 * @author huziyang * @date 2021/04/20 20:43 */ String page(String orderName, String outTradeNo, String total, String returnUrl); - /** * 手机支付 * - * @param orderName 订单名称 + * @param orderName 订单名称 * @param outTradeNo 商家订单编号 - * @param total 金额 - * @param quitUrl 中途退出时返回的页面 - * @param returnUrl 付款完成后跳转页面 + * @param total 金额 + * @param quitUrl 中途退出时返回的页面 + * @param returnUrl 付款完成后跳转页面 * @return 支付页面 * @author huziyang * @date 2021/04/20 20:43 */ String wap(String orderName, String outTradeNo, String total, String quitUrl, String returnUrl); - /** * 退款 * - * @param outTradeNo 商家订单编号 + * @param outTradeNo 商家订单编号 * @param refundAmount 退款金额 * @return 退款结果 * @author huziyang @@ -75,5 +73,4 @@ public interface AlipayService { */ TradeRefundResponse refund(String outTradeNo, String refundAmount); - } diff --git a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/impl/AlipayServiceImpl.java b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/impl/AlipayServiceImpl.java index 329d653a1..6196212f6 100644 --- a/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/impl/AlipayServiceImpl.java +++ b/kernel-d-pay/pay-sdk-alipay/src/main/java/cn/stylefeng/roses/kernel/pay/alipay/service/impl/AlipayServiceImpl.java @@ -44,7 +44,6 @@ import org.springframework.stereotype.Service; @Slf4j public class AlipayServiceImpl implements AlipayService, PayApi { - @Override public String page(String orderName, String outTradeNo, String total, String returnUrl) { try { @@ -58,7 +57,7 @@ public class AlipayServiceImpl implements AlipayService, PayApi { @Override public String wap(String orderName, String outTradeNo, String total, String quitUrl, String returnUrl) { try { - return Factory.Payment.Wap().pay(orderName, outTradeNo, total, quitUrl, returnUrl).body; + return Factory.Payment.Wap().pay(orderName, outTradeNo, total, quitUrl, returnUrl).body; } catch (Exception e) { log.error(e.getMessage()); return e.getMessage(); @@ -69,7 +68,7 @@ public class AlipayServiceImpl implements AlipayService, PayApi { public TradeRefundResponse refund(String outTradeNo, String refundAmount) { try { AlipayTradeRefundResponse response = Factory.Payment.Common().refund(outTradeNo, refundAmount); - if (AlipayConstants.ALIPAY_REFUND_SUCCESS_CODE.equals(response.getCode())){ + if (AlipayConstants.ALIPAY_REFUND_SUCCESS_CODE.equals(response.getCode())) { return TradeRefundResponse.builder() .code(PayConstants.REFUND_SUCCESS_CODE) .msg(response.getMsg()) @@ -82,10 +81,11 @@ public class AlipayServiceImpl implements AlipayService, PayApi { .data(response) .build(); } - return TradeRefundResponse.error(response.msg,response); + return TradeRefundResponse.error(response.msg, response); } catch (Exception e) { log.error(e.getMessage()); return TradeRefundResponse.error(e.getMessage()); } } + } diff --git a/kernel-d-pay/pay-spring-boot-starter/pom.xml b/kernel-d-pay/pay-spring-boot-starter/pom.xml index f67ccd803..45bc1e829 100644 --- a/kernel-d-pay/pay-spring-boot-starter/pom.xml +++ b/kernel-d-pay/pay-spring-boot-starter/pom.xml @@ -11,18 +11,15 @@ pay-spring-boot-starter - - 8 - 8 - - + cn.stylefeng.roses pay-sdk-alipay - 7.0.4 + ${roses.version} + \ No newline at end of file diff --git a/kernel-d-pay/pay-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/pay/starter/GunsPayAutoConfiguration.java b/kernel-d-pay/pay-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/pay/starter/GunsPayAutoConfiguration.java index b02618de7..bdd972865 100644 --- a/kernel-d-pay/pay-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/pay/starter/GunsPayAutoConfiguration.java +++ b/kernel-d-pay/pay-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/pay/starter/GunsPayAutoConfiguration.java @@ -49,6 +49,5 @@ public class GunsPayAutoConfiguration { return new AlipayServiceImpl(); } - } diff --git a/kernel-d-pay/pom.xml b/kernel-d-pay/pom.xml index a4f793ab3..f17ad2c74 100644 --- a/kernel-d-pay/pom.xml +++ b/kernel-d-pay/pom.xml @@ -20,6 +20,7 @@ 8 8 + 2.2.0 @@ -28,7 +29,7 @@ cn.stylefeng.roses kernel-a-rule - 7.0.4 + ${roses.version}