mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 02:34:34 +00:00
style 部分类名称变更,readme编写
This commit is contained in:
82
README.md
82
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
<p>
|
||||
<img src='https://gitee.com/bootx/bootx-platform/badge/star.svg?theme=dark' alt='star'/>
|
||||
<img src="https://img.shields.io/badge/Boot%20Platform-1.3.5-success.svg" alt="Build Status"/>
|
||||
<img src="https://img.shields.io/badge/Boot%20Platform-1.3.6-success.svg" alt="Build Status"/>
|
||||
<img src='https://gitee.com/bootx/dax-pay/badge/star.svg?theme=dark' alt='star'/>
|
||||
<img src="https://img.shields.io/badge/Dax%20Pay-2.0.0-success.svg" alt="Build Status"/>
|
||||
<img src="https://img.shields.io/badge/Author-Bootx-orange.svg" alt="Build Status"/>
|
||||
@@ -10,32 +10,88 @@
|
||||
<img src="https://img.shields.io/badge/license-Apache%20License%202.0-green.svg"/>
|
||||
</p>
|
||||
|
||||
## 🙏🙏🙏 求star呀,走过路过留个star吧,非常非常感谢。🙏🙏🙏
|
||||
|
||||
## 🍈项目介绍
|
||||
[**查看开发进度**](https://gitee.com/bootx/dax-pay/issues/I8TQ9Q)
|
||||
|
||||
单商户模式模式重构中, 敬请期待!!!
|
||||
> DaxPay是一套基于Bootx-Platform脚手架构建的一套开源支付网关系统,已经对接支付宝、微信支付相关的接口,以及扩展了钱包支付、储值卡支付、现金支付等新的支付方式。
|
||||
|
||||
|
||||
## 🍒文档
|
||||
## 🧭 特色功能
|
||||
- 已对接`微信支付`相关的接口,目前已经支持`V2`版本的接口,后续版本将支持`V3`版本的接口
|
||||
- 已对接`支付宝`相关的接口,目前已经支持`V2`版本的接口,后续版本将支持`V3`版本的接口
|
||||
- 支持组合支付,满足用户系统需要多种方式同时进行支付的场景。
|
||||
- 提供`HTTP`方式接口调用能力,和`Java`版本的`SDK`,方便业务系统进行对接
|
||||
- 接口请求和响应数据支持启用签名机制,可根据实际需要进行开关,保证交易安全可靠
|
||||
- 提供管理平台,方便运营人员进行管理和操作,不需要懂IT技术也可以轻松使用
|
||||
|
||||
## 🍒文档和演示地址
|
||||
### 文档地址
|
||||
|
||||
在 [Bootx开源文档站](https://bootx.gitee.io/) 下的`支付网关(DaxPay)`模块下可以进行差异相关文档,具体链接地址如下
|
||||
[快速指南](https://bootx.gitee.io/daxpay/guides/overview/项目介绍.html)、
|
||||
[支付对接](https://bootx.gitee.io/daxpay/gateway/overview/接口清单.html)、
|
||||
[平台配置](https://bootx.gitee.io/daxpay/admin/config/平台配置.html)
|
||||
|
||||
|
||||
### 管理平台:
|
||||
> 注:演示账号部分功能修改删除权限未开放。
|
||||
|
||||
地址:https://daxpay.demo.bootx.cn
|
||||
|
||||
账号:daxpay
|
||||
|
||||
密码:123456
|
||||
|
||||
### 网关接口
|
||||
> 注:接口平台只开放支付网关相关的接口,不开放系统其他接口。
|
||||
|
||||
地址: https://daxpay.server.demo.bootx.cn:9000/doc.html
|
||||
|
||||
账号: daxpay
|
||||
|
||||
密码: 123456
|
||||
|
||||
## 🥞 核心技术栈
|
||||
| 名称 | 描述 | 版本要求 |
|
||||
|-------------|----------|----------------------------|
|
||||
| Jdk | Java环境 | 1.8+,11版本可以正常使用,但17+版本暂不支持 |
|
||||
| Spring Boot | 开发框架 | 2.7.x |
|
||||
| Redis | 分布式缓存 | 5.x版本及以上 |
|
||||
| MySQL | 数据库 | 基于5.7.X版本开发,基本支持8.x版本 |
|
||||
| Vue | 前端框架 | 3.x |
|
||||
| IJpay | 支付SDK开发包 | 项目自动管理,不需要额外处理 |
|
||||
|
||||
|
||||
## 💾 系统截图
|
||||
|
||||
## 🍎 路线图
|
||||
[**查看开发进度**](https://gitee.com/bootx/dax-pay/issues/I8TQ9Q)
|
||||
|
||||
### 2.0.X版本:
|
||||
|
||||
## 🥂 Quick Start
|
||||
- [ ] 钱包功能完善
|
||||
- [ ] 储值卡功能完善
|
||||
- [ ] 现金支付功能完善
|
||||
- [ ] 微信增加V3版本接口支持
|
||||
- [ ] 支付宝增加V3版本接口支持
|
||||
- [ ] 支付宝进行关闭时,支持通过撤销模式进行订单关闭
|
||||
- [ ] 对账功能剩余比对功能实现
|
||||
- [ ] 消息通知支持消息中间件模式
|
||||
- [ ] 支持转账操作
|
||||
- [ ] 增加验签调试等功能的页面
|
||||
|
||||
### 2.1.X版本:
|
||||
|
||||
## 名词解释
|
||||
|
||||
## 🥞项目结构(dax-pay)
|
||||
- [ ] 增加账户金额表
|
||||
- [ ] 增加统计管理
|
||||
- [ ] 支持微信消息通知
|
||||
- [ ] 支持钉钉消息通知
|
||||
- [ ] 新增支付单预警功能, 处理支付单与网关状态不一致且无法自动修复的情况
|
||||
|
||||
|
||||
## 🥂 Bootx 项目合集
|
||||
- Bootx-Platform:单体版脚手架 [Gitee地址](https://gitee.com/bootx/bootx-platform)
|
||||
- Bootx-Cloud:微服务版脚手架 [Gitee地址](https://gitee.com/bootx/bootx-cloud)
|
||||
- dax-pay:开源支付系统 [Gitee地址](https://gitee.com/bootx/daxpay)
|
||||
- bpm-plus:协同办公系统 [Gitee地址](https://gitee.com/bootx/bpm-plus)
|
||||
- mybatis-table-modify:数据表结构管理 [Gitee地址](https://gitee.com/bootx/mybatis-table-modify)
|
||||
|
||||
## 🥪 关于我们
|
||||
@@ -45,13 +101,11 @@ QQ扫码加入QQ交流群
|
||||
<img src="_doc/images/qq_qun.jpg" width = "330" height = "500"/>
|
||||
</p>
|
||||
|
||||
## 💾 系统截图
|
||||
|
||||
|
||||
## 🍻 鸣谢
|
||||
感谢 JetBrains 提供的免费开源 License:
|
||||
|
||||
[](https://www.jetbrains.com/?from=bootx)
|
||||
[](https://www.jetbrains.com/?from=bootx)
|
||||
|
||||
感谢其他提供灵感和思路的开源项目
|
||||
|
||||
|
BIN
_doc/images/jetbrains.png
Normal file
BIN
_doc/images/jetbrains.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@@ -14,7 +14,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PayRefundStatusEnum {
|
||||
public enum RefundStatusEnum {
|
||||
|
||||
/**
|
||||
* 接口调用成功不代表成功
|
||||
@@ -32,7 +32,7 @@ public enum PayRefundStatusEnum {
|
||||
/**
|
||||
* 根据编码获取枚举
|
||||
*/
|
||||
public static PayRefundStatusEnum findByCode(String code){
|
||||
public static RefundStatusEnum findByCode(String code){
|
||||
return Arrays.stream(values())
|
||||
.filter(statusEnum -> Objects.equals(statusEnum.getCode(), code))
|
||||
.findFirst()
|
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PayRefundSyncStatusEnum {
|
||||
public enum RefundSyncStatusEnum {
|
||||
SUCCESS("refund_success","退款成功"),
|
||||
FAIL("refund_fail","退款失败"),
|
||||
PROGRESS("refund_progress","退款中");
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.result.order;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -52,7 +52,7 @@ public class RefundOrderResult {
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
/**
|
||||
* @see PayRefundStatusEnum
|
||||
* @see RefundStatusEnum
|
||||
*/
|
||||
@Schema(description = "退款状态")
|
||||
private String status;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.result.pay;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PaySyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.result.CommonResult;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -24,7 +24,7 @@ public class SyncResult extends CommonResult {
|
||||
/**
|
||||
* 支付网关同步状态
|
||||
* @see PaySyncStatusEnum
|
||||
* @see PayRefundSyncStatusEnum
|
||||
* @see RefundSyncStatusEnum
|
||||
*/
|
||||
@Schema(description = "支付网关同步状态")
|
||||
private String gatewayStatus = FAIL.getCode();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.common.context;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.PayCallbackStatusEnum;
|
||||
import lombok.Data;
|
||||
@@ -33,7 +33,7 @@ public class CallbackLocal {
|
||||
/**
|
||||
* 网关返回状态
|
||||
* @see PayStatusEnum 支付状态
|
||||
* @see PayRefundStatusEnum 退款状态
|
||||
* @see RefundStatusEnum 退款状态
|
||||
*/
|
||||
private String gatewayStatus;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.common.context;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class RefundLocal {
|
||||
/**
|
||||
* 退款状态, 默认为成功, 通常含有异步支付时, 才会出现别的状态
|
||||
*/
|
||||
private PayRefundStatusEnum status = PayRefundStatusEnum.SUCCESS;
|
||||
private RefundStatusEnum status = RefundStatusEnum.SUCCESS;
|
||||
|
||||
/** 错误码 */
|
||||
private String errorCode;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.core.channel.alipay.service;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
|
||||
import cn.bootx.platform.daxpay.service.code.AliPayCode;
|
||||
import cn.bootx.platform.daxpay.service.common.context.RefundLocal;
|
||||
@@ -49,10 +49,10 @@ public class AliPayRefundService {
|
||||
}
|
||||
// 接口返回fund_change=Y为退款成功,fund_change=N或无此字段值返回时需通过退款查询接口进一步确认退款状态
|
||||
if (response.getFundChange().equals("Y")){
|
||||
// refundInfo.setStatus(PayRefundStatusEnum.SUCCESS)
|
||||
// refundInfo.setStatus(RefundStatusEnum.SUCCESS)
|
||||
// .setGatewayOrderNo(response.getTradeNo());
|
||||
}
|
||||
refundInfo.setStatus(PayRefundStatusEnum.PROGRESS)
|
||||
refundInfo.setStatus(RefundStatusEnum.PROGRESS)
|
||||
.setGatewayOrderNo(response.getTradeNo());
|
||||
}
|
||||
catch (AlipayApiException e) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.bootx.platform.daxpay.service.core.channel.alipay.service;
|
||||
|
||||
import cn.bootx.platform.common.core.util.LocalDateTimeUtil;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PaySyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.AliPayCode;
|
||||
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
|
||||
@@ -96,7 +96,7 @@ public class AliPaySyncService {
|
||||
* 退款同步查询
|
||||
*/
|
||||
public RefundGatewaySyncResult syncRefundStatus(PayRefundOrder refundOrder) {
|
||||
RefundGatewaySyncResult syncResult = new RefundGatewaySyncResult().setSyncStatus(PayRefundSyncStatusEnum.FAIL);
|
||||
RefundGatewaySyncResult syncResult = new RefundGatewaySyncResult().setSyncStatus(RefundSyncStatusEnum.FAIL);
|
||||
try {
|
||||
AlipayTradeFastpayRefundQueryModel queryModel = new AlipayTradeFastpayRefundQueryModel();
|
||||
// 退款请求号
|
||||
@@ -109,7 +109,7 @@ public class AliPaySyncService {
|
||||
syncResult.setSyncInfo(JSONUtil.toJsonStr(response));
|
||||
// 失败
|
||||
if (!Objects.equals(AliPayCode.SUCCESS, response.getCode())) {
|
||||
syncResult.setSyncStatus(PayRefundSyncStatusEnum.FAIL);
|
||||
syncResult.setSyncStatus(RefundSyncStatusEnum.FAIL);
|
||||
syncResult.setErrorCode(response.getSubCode());
|
||||
syncResult.setErrorMsg(response.getSubMsg());
|
||||
return syncResult;
|
||||
@@ -120,9 +120,9 @@ public class AliPaySyncService {
|
||||
// 成功
|
||||
if (Objects.equals(tradeStatus, AliPayCode.REFUND_SUCCESS)){
|
||||
LocalDateTime localDateTime = LocalDateTimeUtil.of(response.getGmtRefundPay());
|
||||
return syncResult.setRefundTime(localDateTime).setSyncStatus(PayRefundSyncStatusEnum.SUCCESS);
|
||||
return syncResult.setRefundTime(localDateTime).setSyncStatus(RefundSyncStatusEnum.SUCCESS);
|
||||
} else {
|
||||
return syncResult.setSyncStatus(PayRefundSyncStatusEnum.FAIL).setErrorMsg("支付宝网关反正退款未成功");
|
||||
return syncResult.setSyncStatus(RefundSyncStatusEnum.FAIL).setErrorMsg("支付宝网关反正退款未成功");
|
||||
}
|
||||
} catch (AlipayApiException e) {
|
||||
log.error("退款订单同步失败:", e);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.bootx.platform.daxpay.service.core.channel.wechat.service;
|
||||
|
||||
import cn.bootx.platform.common.core.util.LocalDateTimeUtil;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PaySyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.WeChatPayCode;
|
||||
import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConfig;
|
||||
@@ -126,16 +126,16 @@ public class WeChatPaySyncService {
|
||||
if (Objects.equals(tradeStatus, WeChatPayCode.REFUND_SUCCESS)) {
|
||||
String timeEnd = result.get(WeChatPayCode.REFUND_SUCCESS_TIME);
|
||||
LocalDateTime time = LocalDateTimeUtil.parse(timeEnd, DatePattern.NORM_DATETIME_PATTERN);
|
||||
return syncResult.setRefundTime(time).setSyncStatus(PayRefundSyncStatusEnum.SUCCESS);
|
||||
return syncResult.setRefundTime(time).setSyncStatus(RefundSyncStatusEnum.SUCCESS);
|
||||
}
|
||||
// 退款中
|
||||
if (Objects.equals(tradeStatus, WeChatPayCode.REFUND_PROCESSING)) {
|
||||
return syncResult.setSyncStatus(PayRefundSyncStatusEnum.PROGRESS);
|
||||
return syncResult.setSyncStatus(RefundSyncStatusEnum.PROGRESS);
|
||||
}
|
||||
return syncResult.setSyncStatus(PayRefundSyncStatusEnum.FAIL);
|
||||
return syncResult.setSyncStatus(RefundSyncStatusEnum.FAIL);
|
||||
} catch (Exception e) {
|
||||
log.error("查询退款订单失败:", e);
|
||||
syncResult.setSyncStatus(PayRefundSyncStatusEnum.PROGRESS).setErrorMsg(e.getMessage());
|
||||
syncResult.setSyncStatus(RefundSyncStatusEnum.PROGRESS).setErrorMsg(e.getMessage());
|
||||
}
|
||||
return syncResult;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.core.channel.wechat.service;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
|
||||
import cn.bootx.platform.daxpay.service.code.WeChatPayCode;
|
||||
import cn.bootx.platform.daxpay.service.common.context.RefundLocal;
|
||||
@@ -59,7 +59,7 @@ public class WechatRefundService {
|
||||
if (StrUtil.isBlank(weChatPayConfig.getP12())){
|
||||
String errorMsg = "微信p.12证书未配置,无法进行退款";
|
||||
refundInfo.setErrorMsg(errorMsg);
|
||||
refundInfo.setErrorCode(PayRefundStatusEnum.FAIL.getCode());
|
||||
refundInfo.setErrorCode(RefundStatusEnum.FAIL.getCode());
|
||||
throw new PayFailureException(errorMsg);
|
||||
}
|
||||
byte[] fileBytes = Base64.decode(weChatPayConfig.getP12());
|
||||
@@ -69,7 +69,7 @@ public class WechatRefundService {
|
||||
Map<String, String> result = WxPayKit.xmlToMap(xmlResult);
|
||||
this.verifyErrorMsg(result);
|
||||
// 微信退款是否成功需要查询状态或者回调, 所以设置为退款中状态
|
||||
refundInfo.setStatus(PayRefundStatusEnum.PROGRESS)
|
||||
refundInfo.setStatus(RefundStatusEnum.PROGRESS)
|
||||
.setGatewayOrderNo(result.get("refund_id"));
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.core.order.pay.service;
|
||||
|
||||
import cn.bootx.platform.common.core.exception.DataNotExistException;
|
||||
import cn.bootx.platform.common.core.util.ResultConvertUtil;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
|
||||
import cn.bootx.platform.daxpay.service.common.context.AsyncPayLocal;
|
||||
@@ -91,7 +91,7 @@ public class PayChannelOrderService {
|
||||
int refundableBalance = payChannelOrder.getRefundableBalance() - refundChannelOrder.getAmount();
|
||||
payChannelOrder.setRefundableBalance(refundableBalance);
|
||||
// 支付通道订单状态
|
||||
if (Objects.equals(refundChannelOrder.getStatus(), PayRefundStatusEnum.SUCCESS.getCode())){
|
||||
if (Objects.equals(refundChannelOrder.getStatus(), RefundStatusEnum.SUCCESS.getCode())){
|
||||
PayStatusEnum status = refundableBalance == 0 ? PayStatusEnum.REFUNDED : PayStatusEnum.PARTIAL_REFUND;
|
||||
payChannelOrder.setStatus(status.getCode());
|
||||
refundChannelOrder.setRefundTime(LocalDateTime.now());
|
||||
|
@@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.core.order.refund.entity;
|
||||
|
||||
import cn.bootx.platform.common.core.function.EntityBaseFunction;
|
||||
import cn.bootx.platform.common.mybatisplus.base.MpCreateEntity;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.core.order.refund.convert.RefundOrderChannelConvert;
|
||||
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundChannelOrderDto;
|
||||
import cn.bootx.table.modify.annotation.DbColumn;
|
||||
@@ -52,7 +52,7 @@ public class PayRefundChannelOrder extends MpCreateEntity implements EntityBaseF
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
* @see PayRefundStatusEnum
|
||||
* @see RefundStatusEnum
|
||||
*/
|
||||
@DbColumn(comment = "退款状态")
|
||||
private String status;
|
||||
|
@@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.order.refund.entity;
|
||||
import cn.bootx.platform.common.core.function.EntityBaseFunction;
|
||||
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.core.order.refund.convert.PayRefundOrderConvert;
|
||||
import cn.bootx.platform.daxpay.service.dto.order.refund.PayRefundOrderDto;
|
||||
import cn.bootx.table.modify.annotation.DbColumn;
|
||||
@@ -95,7 +95,7 @@ public class PayRefundOrder extends MpBaseEntity implements EntityBaseFunction<P
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
* @see PayRefundStatusEnum
|
||||
* @see RefundStatusEnum
|
||||
*/
|
||||
@DbColumn(comment = "退款状态")
|
||||
private String status;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.core.payment.callback.service;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.PayCallbackStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.RefundRepairWayEnum;
|
||||
import cn.bootx.platform.daxpay.service.common.context.CallbackLocal;
|
||||
@@ -54,12 +54,12 @@ public class PayRefundCallbackService {
|
||||
return;
|
||||
}
|
||||
// 退款单已经被处理, 记录回调记录
|
||||
if (!Objects.equals(PayRefundStatusEnum.PROGRESS.getCode(), refundOrder.getStatus())) {
|
||||
if (!Objects.equals(RefundStatusEnum.PROGRESS.getCode(), refundOrder.getStatus())) {
|
||||
callbackInfo.setCallbackStatus(PayCallbackStatusEnum.IGNORE).setMsg("退款单状态已处理,记录回调记录");
|
||||
}
|
||||
|
||||
// 退款成功还是失败
|
||||
if (Objects.equals(PayRefundStatusEnum.SUCCESS.getCode(), callbackInfo.getGatewayStatus())) {
|
||||
if (Objects.equals(RefundStatusEnum.SUCCESS.getCode(), callbackInfo.getGatewayStatus())) {
|
||||
RefundRepairResult repair = reflectionService.repair(refundOrder, RefundRepairWayEnum.SUCCESS);
|
||||
callbackInfo.setPayRepairNo(repair.getRepairNo());
|
||||
} else {
|
||||
|
@@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.payment.refund.service;
|
||||
import cn.bootx.platform.common.core.exception.ValidationFailedException;
|
||||
import cn.bootx.platform.common.core.util.CollUtil;
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
|
||||
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.bootx.platform.daxpay.code.PayRefundStatusEnum.SUCCESS;
|
||||
import static cn.bootx.platform.daxpay.code.RefundStatusEnum.SUCCESS;
|
||||
|
||||
/**
|
||||
* 支付退款支撑服务
|
||||
@@ -148,7 +148,7 @@ public class PayRefundAssistService {
|
||||
// 生成退款订单
|
||||
PayRefundOrder refundOrder = new PayRefundOrder()
|
||||
.setPaymentId(payOrder.getId())
|
||||
.setStatus(PayRefundStatusEnum.PROGRESS.getCode())
|
||||
.setStatus(RefundStatusEnum.PROGRESS.getCode())
|
||||
.setBusinessNo(payOrder.getBusinessNo())
|
||||
.setRefundNo(refundParam.getRefundNo())
|
||||
.setOrderAmount(payOrder.getAmount())
|
||||
|
@@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.payment.refund.service;
|
||||
import cn.bootx.platform.common.core.exception.RepetitiveOperationException;
|
||||
import cn.bootx.platform.common.core.function.CollectorsFunction;
|
||||
import cn.bootx.platform.common.core.util.ValidationUtil;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
|
||||
import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException;
|
||||
@@ -180,7 +180,7 @@ public class PayRefundService {
|
||||
}
|
||||
catch (Exception e) {
|
||||
// 5. 失败处理
|
||||
PaymentContextLocal.get().getRefundInfo().setStatus(PayRefundStatusEnum.FAIL);
|
||||
PaymentContextLocal.get().getRefundInfo().setStatus(RefundStatusEnum.FAIL);
|
||||
this.errorHandler(refundOrder);
|
||||
throw e;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class PayRefundService {
|
||||
// 剩余可退款余额
|
||||
int refundableBalance = payRefundOrder.getRefundableBalance();
|
||||
// 设置支付订单状态
|
||||
if (asyncRefundInfo.getStatus() == PayRefundStatusEnum.PROGRESS) {
|
||||
if (asyncRefundInfo.getStatus() == RefundStatusEnum.PROGRESS) {
|
||||
// 设置为退款中
|
||||
payOrder.setStatus(PayStatusEnum.REFUNDING.getCode());
|
||||
} else if (refundableBalance == 0) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.bootx.platform.daxpay.service.core.payment.refund.strategy;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
|
||||
import cn.bootx.platform.daxpay.service.core.channel.alipay.entity.AliPayConfig;
|
||||
import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayConfigService;
|
||||
@@ -61,7 +61,7 @@ public class AliPayRefundStrategy extends AbsRefundStrategy {
|
||||
@Override
|
||||
public void doSuccessHandler() {
|
||||
// 更新退款订单数据状态
|
||||
PayRefundStatusEnum refundStatusEnum = PaymentContextLocal.get()
|
||||
RefundStatusEnum refundStatusEnum = PaymentContextLocal.get()
|
||||
.getRefundInfo()
|
||||
.getStatus();
|
||||
this.getRefundChannelOrder().setStatus(refundStatusEnum.getCode());
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.bootx.platform.daxpay.service.core.payment.refund.strategy;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
|
||||
import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConfig;
|
||||
import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WeChatPayConfigService;
|
||||
@@ -65,7 +65,7 @@ public class WeChatPayRefundStrategy extends AbsRefundStrategy {
|
||||
@Override
|
||||
public void doSuccessHandler() {
|
||||
// 更新退款订单数据状态
|
||||
PayRefundStatusEnum refundStatusEnum = PaymentContextLocal.get()
|
||||
RefundStatusEnum refundStatusEnum = PaymentContextLocal.get()
|
||||
.getRefundInfo()
|
||||
.getStatus();
|
||||
this.getRefundChannelOrder().setStatus(refundStatusEnum.getCode());
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.core.payment.repair.result;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -17,9 +17,9 @@ public class RefundRepairResult {
|
||||
/** 修复号 */
|
||||
private String repairNo;
|
||||
/** 退款修复前状态 */
|
||||
private PayRefundStatusEnum beforeRefundStatus;
|
||||
private RefundStatusEnum beforeRefundStatus;
|
||||
/** 退款修复后状态 */
|
||||
private PayRefundStatusEnum afterRefundStatus;
|
||||
private RefundStatusEnum afterRefundStatus;
|
||||
/** 支付修复前状态 */
|
||||
private PayStatusEnum beforePayStatus;
|
||||
/** 支付修复后状态 */
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.bootx.platform.daxpay.service.core.payment.repair.service;
|
||||
|
||||
import cn.bootx.platform.common.core.function.CollectorsFunction;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.RefundRepairWayEnum;
|
||||
@@ -106,7 +106,7 @@ public class RefundRepairService {
|
||||
// 订单相关状态
|
||||
PayStatusEnum beforePayStatus = PayStatusEnum.findByCode(refundOrder.getStatus());
|
||||
PayStatusEnum afterPayRefundStatus;
|
||||
PayRefundStatusEnum beforeRefundStatus = PayRefundStatusEnum.findByCode(refundOrder.getStatus());
|
||||
RefundStatusEnum beforeRefundStatus = RefundStatusEnum.findByCode(refundOrder.getStatus());
|
||||
|
||||
// 判断订单全部退款还是部分退款
|
||||
if (Objects.equals(payOrder.getRefundableBalance(),0)){
|
||||
@@ -115,7 +115,7 @@ public class RefundRepairService {
|
||||
afterPayRefundStatus = PayStatusEnum.PARTIAL_REFUND;
|
||||
}
|
||||
// 设置退款为完成状态
|
||||
refundOrder.setStatus(PayRefundStatusEnum.SUCCESS.getCode());
|
||||
refundOrder.setStatus(RefundStatusEnum.SUCCESS.getCode());
|
||||
payOrder.setStatus(afterPayRefundStatus.getCode());
|
||||
|
||||
// 执行退款成功逻辑
|
||||
@@ -139,7 +139,7 @@ public class RefundRepairService {
|
||||
.setBeforePayStatus(beforePayStatus)
|
||||
.setAfterPayStatus(afterPayRefundStatus)
|
||||
.setBeforeRefundStatus(beforeRefundStatus)
|
||||
.setAfterRefundStatus(PayRefundStatusEnum.SUCCESS);
|
||||
.setAfterRefundStatus(RefundStatusEnum.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public class RefundRepairService {
|
||||
|
||||
// 订单修复前状态
|
||||
PayStatusEnum beforePayStatus = PayStatusEnum.findByCode(refundOrder.getStatus());
|
||||
PayRefundStatusEnum beforeRefundStatus = PayRefundStatusEnum.findByCode(refundOrder.getStatus());
|
||||
RefundStatusEnum beforeRefundStatus = RefundStatusEnum.findByCode(refundOrder.getStatus());
|
||||
repairResult.setBeforePayStatus(beforePayStatus)
|
||||
.setBeforeRefundStatus(beforeRefundStatus);
|
||||
|
||||
@@ -170,7 +170,7 @@ public class RefundRepairService {
|
||||
|
||||
// 更新支付订单相关的可退款金额
|
||||
payOrder.setRefundableBalance(payOrderAmount);
|
||||
refundOrder.setStatus(PayRefundStatusEnum.CLOSE.getCode());
|
||||
refundOrder.setStatus(RefundStatusEnum.CLOSE.getCode());
|
||||
|
||||
// 执行关闭退款逻辑
|
||||
repairStrategies.forEach(AbsRefundRepairStrategy::doCloseHandler);
|
||||
@@ -222,7 +222,7 @@ public class RefundRepairService {
|
||||
*/
|
||||
private PayRepairRecord refundRepairRecord(PayRefundOrder refundOrder, RefundRepairWayEnum repairType, RefundRepairResult repairResult){
|
||||
// 修复后的状态
|
||||
String afterStatus = Optional.ofNullable(repairResult.getAfterRefundStatus()).map(PayRefundStatusEnum::getCode).orElse(null);
|
||||
String afterStatus = Optional.ofNullable(repairResult.getAfterRefundStatus()).map(RefundStatusEnum::getCode).orElse(null);
|
||||
// 修复发起来源
|
||||
String source = PaymentContextLocal.get()
|
||||
.getRepairInfo()
|
||||
|
@@ -1,12 +1,12 @@
|
||||
package cn.bootx.platform.daxpay.service.core.payment.sync.result;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum.PROGRESS;
|
||||
import static cn.bootx.platform.daxpay.code.RefundSyncStatusEnum.PROGRESS;
|
||||
|
||||
/**
|
||||
* 支付退款同步结果
|
||||
@@ -19,9 +19,9 @@ public class RefundGatewaySyncResult {
|
||||
|
||||
/**
|
||||
* 支付网关订单状态, 默认为退款中
|
||||
* @see PayRefundSyncStatusEnum
|
||||
* @see RefundSyncStatusEnum
|
||||
*/
|
||||
private PayRefundSyncStatusEnum syncStatus = PROGRESS;
|
||||
private RefundSyncStatusEnum syncStatus = PROGRESS;
|
||||
|
||||
/** 同步时网关返回的对象, 序列化为json字符串 */
|
||||
private String syncInfo;
|
||||
|
@@ -2,8 +2,8 @@ package cn.bootx.platform.daxpay.service.core.payment.sync.service;
|
||||
|
||||
import cn.bootx.platform.common.core.exception.BizException;
|
||||
import cn.bootx.platform.common.core.exception.RepetitiveOperationException;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
|
||||
import cn.bootx.platform.daxpay.param.pay.RefundSyncParam;
|
||||
import cn.bootx.platform.daxpay.result.pay.SyncResult;
|
||||
@@ -67,7 +67,7 @@ public class PayRefundSyncService {
|
||||
return new SyncResult().setSuccess(false).setRepair(false).setErrorMsg("订单没有异步通道的退款,不需要同步");
|
||||
}
|
||||
// 如果订单已经关闭, 直接返回失败
|
||||
if (Objects.equals(refundOrder.getStatus(), PayRefundStatusEnum.CLOSE.getCode())){
|
||||
if (Objects.equals(refundOrder.getStatus(), RefundStatusEnum.CLOSE.getCode())){
|
||||
return new SyncResult().setSuccess(false).setRepair(false).setErrorMsg("订单已经关闭,不需要同步");
|
||||
}
|
||||
return this.syncRefundOrder(refundOrder);
|
||||
@@ -93,7 +93,7 @@ public class PayRefundSyncService {
|
||||
RefundGatewaySyncResult syncResult = syncPayStrategy.doSyncStatus();
|
||||
|
||||
// 判断是否同步成功
|
||||
if (Objects.equals(syncResult.getSyncStatus(), PayRefundSyncStatusEnum.FAIL)) {
|
||||
if (Objects.equals(syncResult.getSyncStatus(), RefundSyncStatusEnum.FAIL)) {
|
||||
// 同步失败, 返回失败响应, 同时记录失败的日志
|
||||
return new SyncResult().setErrorMsg(syncResult.getErrorMsg());
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class PayRefundSyncService {
|
||||
}
|
||||
} catch (PayFailureException e) {
|
||||
// 同步失败, 返回失败响应, 同时记录失败的日志
|
||||
syncResult.setSyncStatus(PayRefundSyncStatusEnum.FAIL);
|
||||
syncResult.setSyncStatus(RefundSyncStatusEnum.FAIL);
|
||||
this.saveRecord(refundOrder, syncResult, false, null, e.getMessage());
|
||||
return new SyncResult().setErrorMsg(e.getMessage());
|
||||
}
|
||||
@@ -137,26 +137,26 @@ public class PayRefundSyncService {
|
||||
|
||||
/**
|
||||
* 检查状态是否一致
|
||||
* @see PayRefundSyncStatusEnum 同步返回类型
|
||||
* @see PayRefundStatusEnum 退款单状态
|
||||
* @see RefundSyncStatusEnum 同步返回类型
|
||||
* @see RefundStatusEnum 退款单状态
|
||||
*/
|
||||
private boolean checkSyncStatus(RefundGatewaySyncResult syncResult, PayRefundOrder order){
|
||||
PayRefundSyncStatusEnum syncStatus = syncResult.getSyncStatus();
|
||||
RefundSyncStatusEnum syncStatus = syncResult.getSyncStatus();
|
||||
String orderStatus = order.getStatus();
|
||||
// 退款完成
|
||||
if (Objects.equals(syncStatus, PayRefundSyncStatusEnum.SUCCESS)&&
|
||||
Objects.equals(orderStatus, PayRefundStatusEnum.SUCCESS.getCode())) {
|
||||
if (Objects.equals(syncStatus, RefundSyncStatusEnum.SUCCESS)&&
|
||||
Objects.equals(orderStatus, RefundStatusEnum.SUCCESS.getCode())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 退款失败
|
||||
if (Objects.equals(syncStatus, PayRefundSyncStatusEnum.FAIL)&&
|
||||
Objects.equals(orderStatus, PayRefundStatusEnum.FAIL.getCode())) {
|
||||
if (Objects.equals(syncStatus, RefundSyncStatusEnum.FAIL)&&
|
||||
Objects.equals(orderStatus, RefundStatusEnum.FAIL.getCode())) {
|
||||
return true;
|
||||
}
|
||||
// 退款中
|
||||
if (Objects.equals(syncStatus, PayRefundSyncStatusEnum.PROGRESS)&&
|
||||
Objects.equals(orderStatus, PayRefundStatusEnum.PROGRESS.getCode())) {
|
||||
if (Objects.equals(syncStatus, RefundSyncStatusEnum.PROGRESS)&&
|
||||
Objects.equals(orderStatus, RefundStatusEnum.PROGRESS.getCode())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -166,7 +166,7 @@ public class PayRefundSyncService {
|
||||
* 进行退款订单和支付订单的补偿
|
||||
*/
|
||||
private RefundRepairResult repairHandler(RefundGatewaySyncResult syncResult, PayRefundOrder order){
|
||||
PayRefundSyncStatusEnum syncStatusEnum = syncResult.getSyncStatus();
|
||||
RefundSyncStatusEnum syncStatusEnum = syncResult.getSyncStatus();
|
||||
RefundRepairResult repair = new RefundRepairResult();
|
||||
// 对支付网关同步的结果进行处理
|
||||
switch (syncStatusEnum) {
|
||||
|
@@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.record.sync.entity;
|
||||
import cn.bootx.platform.common.core.function.EntityBaseFunction;
|
||||
import cn.bootx.platform.common.mybatisplus.base.MpCreateEntity;
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PaySyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum;
|
||||
import cn.bootx.platform.daxpay.service.core.record.sync.convert.PaySyncRecordConvert;
|
||||
@@ -63,7 +63,7 @@ public class PaySyncRecord extends MpCreateEntity implements EntityBaseFunction<
|
||||
/**
|
||||
* 网关返回状态
|
||||
* @see PaySyncStatusEnum
|
||||
* @see PayRefundSyncStatusEnum
|
||||
* @see RefundSyncStatusEnum
|
||||
*/
|
||||
@DbColumn(comment = "网关返回状态")
|
||||
private String gatewayStatus;
|
||||
|
@@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.dto.order.refund;
|
||||
|
||||
import cn.bootx.platform.common.core.rest.dto.BaseDto;
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -61,7 +61,7 @@ public class PayRefundOrderDto extends BaseDto {
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
/**
|
||||
* @see PayRefundStatusEnum
|
||||
* @see RefundStatusEnum
|
||||
*/
|
||||
@Schema(description = "退款状态")
|
||||
private String status;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.bootx.platform.daxpay.service.dto.order.refund;
|
||||
|
||||
import cn.bootx.platform.common.core.rest.dto.BaseDto;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.table.modify.annotation.DbColumn;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -43,7 +43,7 @@ public class RefundChannelOrderDto extends BaseDto {
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
* @see PayRefundStatusEnum
|
||||
* @see RefundStatusEnum
|
||||
*/
|
||||
@Schema(description = "退款状态")
|
||||
private String status;
|
||||
|
@@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.dto.record.sync;
|
||||
|
||||
import cn.bootx.platform.common.core.rest.dto.BaseDto;
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PaySyncStatusEnum;
|
||||
import cn.bootx.table.modify.mysql.annotation.DbMySqlFieldType;
|
||||
import cn.bootx.table.modify.mysql.constants.MySqlFieldTypeEnum;
|
||||
@@ -53,7 +53,7 @@ public class PaySyncRecordDto extends BaseDto {
|
||||
/**
|
||||
* 网关返回状态
|
||||
* @see PaySyncStatusEnum
|
||||
* @see PayRefundSyncStatusEnum
|
||||
* @see RefundSyncStatusEnum
|
||||
*/
|
||||
@Schema(description = "网关返回状态")
|
||||
private String gatewayStatus;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.func;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayChannelOrder;
|
||||
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
|
||||
@@ -52,7 +52,7 @@ public abstract class AbsRefundRepairStrategy implements PayStrategy{
|
||||
payChannelOrder.setStatus(PayStatusEnum.PARTIAL_REFUND.getCode());
|
||||
|
||||
}
|
||||
refundChannelOrder.setStatus(PayRefundStatusEnum.SUCCESS.getCode());
|
||||
refundChannelOrder.setStatus(RefundStatusEnum.SUCCESS.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ public abstract class AbsRefundRepairStrategy implements PayStrategy{
|
||||
}
|
||||
// 如果失败, 可退余额设置为null
|
||||
refundChannelOrder.setRefundableAmount(null);
|
||||
refundChannelOrder.setStatus(PayRefundStatusEnum.CLOSE.getCode());
|
||||
refundChannelOrder.setStatus(RefundStatusEnum.CLOSE.getCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.bootx.platform.daxpay.service.func;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
|
||||
import cn.bootx.platform.daxpay.param.pay.RefundParam;
|
||||
@@ -76,7 +76,7 @@ public abstract class AbsRefundStrategy implements PayStrategy{
|
||||
*/
|
||||
public void doSuccessHandler() {
|
||||
// 更新退款订单数据状态
|
||||
this.refundChannelOrder.setStatus(PayRefundStatusEnum.SUCCESS.getCode()).setRefundTime(LocalDateTime.now());
|
||||
this.refundChannelOrder.setStatus(RefundStatusEnum.SUCCESS.getCode()).setRefundTime(LocalDateTime.now());
|
||||
|
||||
// 支付通道订单可退余额
|
||||
int refundableBalance = this.getPayChannelOrder().getRefundableBalance() - this.refundChannelOrder.getAmount();
|
||||
|
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
|
||||
@QueryParam
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "支付订单查询参数")
|
||||
public class PayOrderQuery extends QueryOrder {
|
||||
public class PayOrderQuery extends QueryOrder {
|
||||
|
||||
@QueryParam(type = QueryParam.CompareTypeEnum.EQ)
|
||||
@Schema(description = "支付订单id")
|
||||
|
@@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.param.order;
|
||||
|
||||
import cn.bootx.platform.common.core.annotation.QueryParam;
|
||||
import cn.bootx.platform.common.core.rest.param.QueryOrder;
|
||||
import cn.bootx.platform.daxpay.code.PayRefundStatusEnum;
|
||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -38,7 +38,7 @@ public class PayRefundOrderQuery extends QueryOrder {
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* @see PayRefundStatusEnum
|
||||
* @see RefundStatusEnum
|
||||
*/
|
||||
@Schema(description = "退款状态")
|
||||
private String status;
|
||||
|
@@ -27,20 +27,6 @@ spring:
|
||||
adaptive: true
|
||||
# 群集拓扑刷新周期
|
||||
period: 60s
|
||||
# 如果不使用MQ的话, 可以将项目中 @EnableRabbit 给注释掉, 就不会一直报错了
|
||||
rabbitmq:
|
||||
# 虚拟主机
|
||||
virtual-host: dax-pay
|
||||
host: 127.0.0.1
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
listener:
|
||||
simple:
|
||||
# 重试机制
|
||||
retry:
|
||||
enabled: true
|
||||
max-attempts: 5
|
||||
#静态资源加载配置
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
|
Reference in New Issue
Block a user