ref 更新支付相关参数字段名称

This commit is contained in:
bootx
2024-04-18 23:24:34 +08:00
parent 135451dc35
commit c9bed94a76
54 changed files with 181 additions and 462 deletions

View File

@@ -27,6 +27,7 @@
> DaxPay是一套基于Bootx-Platform脚手架构建的开源支付网关系统已经对接支付宝、微信支付相关的接口以及扩展了钱包支付、储值卡支付、现金支付等新的支付方式。
> 可以独立部署,提供接口供业务系统进行调用,不对原有系统产生影响
> **gateway为开发分支本地运行请使用master分支进行测试**
## 🧭 特色功能
- 封装各类支付通道的接口为统一的接口,方便业务系统进行调用,简化对接多种支付方式的复杂度
- 已对接`微信支付``支付宝`和云闪付相关的接口,后续版本将支持`V3`版本的接口

View File

@@ -5,9 +5,9 @@ import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.common.core.rest.dto.LabelValue;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.daxpay.param.pay.AllocationSyncParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationFinishParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationResetParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationSyncParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationFinishParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationResetParam;
import cn.bootx.platform.daxpay.service.core.order.allocation.service.AllocationOrderService;
import cn.bootx.platform.daxpay.service.core.payment.allocation.service.AllocationService;
import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDetailDto;
@@ -72,7 +72,7 @@ public class AllocationOrderController {
@Operation(summary = "同步分账结果")
@PostMapping("/sync")
public ResResult<Void> sync(Long id){
AllocationSyncParam param = new AllocationSyncParam();
AllocationSyncParam param = new AllocationSyncParam();
param.setAllocationId(id);
allocationService.sync(param);
return Res.ok();

View File

@@ -5,9 +5,9 @@ import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.daxpay.param.pay.PayCloseParam;
import cn.bootx.platform.daxpay.param.pay.PaySyncParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayCloseParam;
import cn.bootx.platform.daxpay.param.payment.pay.PaySyncParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.result.pay.SyncResult;
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
import cn.bootx.platform.daxpay.service.core.order.pay.service.PayChannelOrderService;

View File

@@ -4,7 +4,7 @@ import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.daxpay.param.pay.RefundSyncParam;
import cn.bootx.platform.daxpay.param.payment.refund.RefundSyncParam;
import cn.bootx.platform.daxpay.result.pay.SyncResult;
import cn.bootx.platform.daxpay.service.core.order.refund.service.RefundOrderService;
import cn.bootx.platform.daxpay.service.core.payment.refund.service.RefundService;

View File

@@ -1,51 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.code.PayWayEnum;
import cn.bootx.platform.daxpay.param.channel.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;
/**
* 同意下单支付方式参数
*
* @author xxm
* @since 2020/12/8
*/
@Data
@Schema(title = "支付通道参数")
public class PayChannelParam {
/**
* @see PayChannelEnum#getCode()
*/
@Schema(description = "支付通道编码")
@NotBlank(message = "支付通道编码不可为空")
private String channel;
/**
* @see PayWayEnum#getCode()
*/
@Schema(description = "支付方式编码")
@NotBlank(message = "支付方式编码不可为空")
private String way;
@Schema(description = "支付金额")
@NotNull(message = "支付金额不可为空")
private Integer amount;
/**
* 附加支付参数, 传输json格式字符串
* @see AliPayParam
* @see WeChatPayParam
* @see VoucherPayParam
* @see WalletPayParam
* @see UnionPayParam
*/
@Schema(description = "附加支付参数")
private Map<String,Object> channelParam;
}

View File

@@ -1,69 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import cn.bootx.platform.daxpay.serializer.TimestampToLocalDateTimeDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
/**
* 统一下单参数
*
* @author xxm
* @since 2020/12/9
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "支付参数")
public class PayParam extends PaymentCommonParam {
@Schema(description = "业务号")
@NotBlank(message = "业务号不可为空")
private String businessNo;
@Schema(description = "支付标题")
@NotBlank(message = "支付标题不可为空")
private String title;
@Schema(description = "支付描述")
private String description;
@Schema(description = "是否开启分账")
private boolean allocation;
@Schema(description = "过期时间, 多次传输以第一次为准")
@JsonDeserialize(using = TimestampToLocalDateTimeDeserializer.class)
private LocalDateTime expiredTime;
@Schema(description = "用户付款中途退出返回商户网站的地址(部分支付场景中可用)")
private String quitUrl;
@Schema(description = "支付通道信息参数")
@NotNull(message = "支付通道信息参数不可为空")
@Valid
private List<PayChannelParam> payChannels;
/** 商户扩展参数,回调时会原样返回 */
@Schema(description = "商户扩展参数,回调时会原样返回")
private String attach;
/** 同步跳转URL, 不传输跳转到默认地址 */
@Schema(description = "同步跳转URL")
private String returnUrl;
/** 是否不启用异步通知 */
@Schema(description = "是否不启用异步通知")
private boolean notNotify;
/** 异步通知地址 */
@Schema(description = "异步通知地址")
private String notifyUrl;
}

View File

@@ -1,24 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 支付订单查询参数
* @author xxm
* @since 2024/1/15
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "支付订单查询参数")
public class QueryPayOrderParam extends PaymentCommonParam {
@Schema(description = "支付号")
private Long paymentId;
@Schema(description = "业务号")
private String businessNo;
}

View File

@@ -1,24 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 查询退款订单参数
* @author xxm
* @since 2024/1/15
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "查询退款订单参数")
public class QueryRefundOrderParam extends PaymentCommonParam {
@Schema(description = "退款订单ID")
private Long refundId;
@Schema(description = "退款订单号")
private String refundNo;
}

View File

@@ -1,34 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 分通道退款参数
* @author xxm
* @since 2023/12/18
*/
@Data
@Accessors(chain = true)
@Schema(title = "分通道退款参数")
public class RefundChannelParam {
/**
* @see PayChannelEnum#getCode()
*/
@Schema(description = "支付通道编码")
@NotBlank(message = "支付通道编码不可为空")
private String channel;
@Schema(description = "退款金额")
@NotNull(message = "退款金额不可为空")
@Min(1)
private Integer amount;
}

View File

@@ -1,61 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.Valid;
import java.util.List;
/**
* 退款参数,适用于组合支付的订单退款操作中,
* @author xxm
* @since 2023/12/18
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "退款参数")
public class RefundParam extends PaymentCommonParam {
@Schema(description = "支付单ID")
private Long paymentId;
@Schema(description = "业务号")
private String businessNo;
/**
* 部分退款需要传输支付通道参数参数
*/
@Schema(description = "是否全部退款")
private boolean refundAll;
/**
* 退款号可以为空, 但不可以重复, 如果退款号为空, 则系统会自动生成退款号, 与退款ID一致
*/
@Schema(description = "退款号")
private String refundNo;
/**
* 部分退款时必传
*/
@Valid
@Schema(description = "退款参数列表")
private List<RefundChannelParam> refundChannels;
@Schema(description = "退款原因")
private String reason;
/** 商户扩展参数,回调时会原样返回 */
@Schema(description = "商户扩展参数,回调时会原样返回")
private String attach;
/** 是否不启用异步通知 */
@Schema(description = "是否不启用异步通知")
private boolean notNotify;
/** 异步通知地址 */
@Schema(description = "异步通知地址")
private String notifyUrl;
}

View File

@@ -1,71 +0,0 @@
package cn.bootx.platform.daxpay.param.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import cn.bootx.platform.daxpay.param.channel.AliPayParam;
import cn.bootx.platform.daxpay.param.channel.WalletPayParam;
import cn.bootx.platform.daxpay.param.channel.WeChatPayParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 简单退款参数,只可以用于非组合的支付订单
* @author xxm
* @since 2023/12/18
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "简单退款参数")
public class SimpleRefundParam extends PaymentCommonParam {
/**
* 优先级高于业务号
*/
@Schema(description = "支付单ID")
private Long paymentId;
@Schema(description = "业务号")
private String businessNo;
/**
* 部分退款时此项必填, 不传输系统会自动生成
*/
@Schema(description = "退款订单号")
private String refundNo;
/**
* 部分退款需要传输refundModes参数
*/
@Schema(description = "是否全部退款")
private boolean refundAll;
@Schema(description = "退款金额")
private Integer amount;
/**
* 预留的扩展参数, 暂时未使用
* @see AliPayParam
* @see WeChatPayParam
* @see VoucherPayParam
* @see WalletPayParam
*/
@Schema(description = "附加退款参数")
private String channelExtra;
@Schema(description = "退款原因")
private String reason;
/** 商户扩展参数,回调时会原样返回 */
@Schema(description = "商户扩展参数,回调时会原样返回")
private String attach;
/** 是否不启用异步通知 */
@Schema(description = "是否不启用异步通知")
private boolean notNotify;
/** 异步通知地址 */
@Schema(description = "异步通知地址")
private String notifyUrl;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay.allocation;
package cn.bootx.platform.daxpay.param.payment.allocation;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay.allocation;
package cn.bootx.platform.daxpay.param.payment.allocation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay.allocation;
package cn.bootx.platform.daxpay.param.payment.allocation;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.allocation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -12,9 +12,9 @@ import lombok.Data;
@Schema(title = "分账同步请求参数")
public class AllocationSyncParam {
@Schema(description = "分账单ID")
private Long allocationId;
@Schema(description = "分账单号")
@Schema(description = "分账")
private String allocationNo;
@Schema(description = "商户分账号")
private String outAllocationNo;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay.allocation;
package cn.bootx.platform.daxpay.param.payment.allocation;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;

View File

@@ -0,0 +1,24 @@
package cn.bootx.platform.daxpay.param.payment.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 支付订单撤销
* 并不是所有的订单都可以被撤销,只有部分类型的支持撤销,主要是当面付
* @author xxm
* @since 2024/4/18
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "支付订单撤销")
public class PayCancelParam extends PaymentCommonParam {
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "商户订单号")
private String outTradeNo;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -15,13 +15,9 @@ import lombok.EqualsAndHashCode;
@Schema(title = "支付关闭参数")
public class PayCloseParam extends PaymentCommonParam {
@Schema(description = "支付单ID")
private Long paymentId;
@Schema(description = "业务号")
private String businessNo;
@Schema(description = "使用撤销来关闭订单")
private Boolean cancel;
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "商户订单号")
private String outTradeNo;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.pay;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.code.PayWayEnum;
@@ -19,18 +19,19 @@ import java.time.LocalDateTime;
import java.util.Map;
/**
* 简单下单参数
* 统一下单参数
*
* @author xxm
* @since 2023/12/17
* @since 2020/12/9
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "简单下单参数")
public class SimplePayParam extends PaymentCommonParam {
@Schema(title = "支付参数")
public class PayParam extends PaymentCommonParam {
@Schema(description = "业务")
@NotBlank(message = "业务号不可为空")
private String businessNo;
@Schema(description = "商户订单")
@NotBlank(message = "商户订单号不可为空")
private String outTradeNo;
@Schema(description = "支付标题")
@NotBlank(message = "支付标题不可为空")
@@ -61,7 +62,7 @@ public class SimplePayParam extends PaymentCommonParam {
*/
@Schema(description = "支付方式编码")
@NotBlank(message = "支付方式编码不可为空")
private String payWay;
private String way;
@Schema(description = "支付金额")
@NotNull(message = "支付金额不可为空")
@@ -71,7 +72,6 @@ public class SimplePayParam extends PaymentCommonParam {
/**
* @see AliPayParam
* @see WeChatPayParam
* @see VoucherPayParam
* @see WalletPayParam
*/
@Schema(description = "附加通道支付参数")
@@ -81,7 +81,7 @@ public class SimplePayParam extends PaymentCommonParam {
@Schema(description = "商户扩展参数,回调时会原样返回")
private String attach;
/** 同步跳转URL, 不传输跳转到默认地址 */
/** 同步跳转URL, 支付完毕后用户浏览器返回到该地址, 不传输跳转到默认地址 */
@Schema(description = "同步通知URL")
private String returnUrl;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -15,10 +15,10 @@ import lombok.EqualsAndHashCode;
@Schema(title = "支付状态同步参数")
public class PaySyncParam extends PaymentCommonParam {
@Schema(description = "支付单ID")
private Long paymentId;
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "业务号")
private String businessNo;
private String outTradeNo;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.pay;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -15,9 +15,9 @@ import lombok.EqualsAndHashCode;
@Schema(title = "支付单查询参数")
public class QueryPayParam extends PaymentCommonParam {
@Schema(description = "支付单ID")
private Long paymentId;
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "商户订单号")
private String businessNo;
private String outTradeNo;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.refund;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -15,9 +15,9 @@ import lombok.EqualsAndHashCode;
@Schema(title = "查询退款订单参数类")
public class QueryRefundParam extends PaymentCommonParam {
@Schema(description = "退款订单ID")
private Long refundId;
@Schema(description = "退款订单号")
@Schema(description = "退款")
private String refundNo;
@Schema(description = "商户退款号")
private String outRefundNo;
}

View File

@@ -0,0 +1,72 @@
package cn.bootx.platform.daxpay.param.payment.refund;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import cn.bootx.platform.daxpay.param.channel.AliPayParam;
import cn.bootx.platform.daxpay.param.channel.WalletPayParam;
import cn.bootx.platform.daxpay.param.channel.WeChatPayParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.util.Map;
/**
* 退款参数,适用于组合支付的订单退款操作中,
* @author xxm
* @since 2023/12/18
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "退款参数")
public class RefundParam extends PaymentCommonParam {
/**
* 商户退款号,不可以为空,同样的商户退款号多次请求,同一退款单号多次请求只退一笔
*/
@Schema(description = "商户退款号")
@NotBlank(message = "商户退款号不可为空")
private String outRefundNo;
/**
* 支付操作是返回的订单号,与商户订单号至少要传输一个,同时传输以订单号为准
*/
@Schema(description = "订单号")
private String orderNo;
/**
* 支付操作时传入的的商户订单号,与订单号至少要传输一个,同时传输以订单号为准
*/
@Schema(description = "商户订单号")
private String outTradeNo;
@Schema(description = "退款金额")
@Min(value = 1,message = "退款金额至少为0.01元")
private Integer amount;
/**
* 预留的退款扩展参数
* @see AliPayParam
* @see WeChatPayParam
* @see WalletPayParam
*/
@Schema(description = "退款扩展参数")
private Map<String, Object> channelParam;
@Schema(description = "退款原因")
private String reason;
/** 商户扩展参数,回调时会原样返回 */
@Schema(description = "商户扩展参数,回调时会原样返回")
private String attach;
/** 是否不启用异步通知 */
@Schema(description = "是否不启用异步通知")
private boolean notNotify;
/** 异步通知地址 */
@Schema(description = "异步通知地址")
private String notifyUrl;
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.param.pay;
package cn.bootx.platform.daxpay.param.payment.refund;
import cn.bootx.platform.daxpay.param.PaymentCommonParam;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -15,16 +15,10 @@ import lombok.EqualsAndHashCode;
@Schema(title = "退款状态同步参数")
public class RefundSyncParam extends PaymentCommonParam {
/**
* 退款订单IDrefundId和refundNo 必传一个, 同时传输时 refundId 为准
*/
@Schema(description = "退款订单ID")
private Long refundId;
/**
* 退款订单号refundId和refundNo 必传一个同时传输时 refundId 为准
*/
@Schema(description = "退款订单号")
@Schema(description = "退款号")
private String refundNo;
@Schema(description = "商户退款号")
private String outRefundNo;
}

View File

@@ -4,8 +4,7 @@ import cn.bootx.platform.common.core.util.LocalDateTimeUtil;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayAmountAbnormalException;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.param.pay.PayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.hutool.core.date.DatePattern;
import lombok.experimental.UtilityClass;

View File

@@ -3,9 +3,13 @@ package cn.bootx.platform.daxpay.gateway.controller;
import cn.bootx.platform.common.core.annotation.CountTime;
import cn.bootx.platform.common.core.annotation.IgnoreAuth;
import cn.bootx.platform.daxpay.code.PaymentApiCode;
import cn.bootx.platform.daxpay.param.pay.*;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationFinishParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationFinishParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayCloseParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PaySyncParam;
import cn.bootx.platform.daxpay.param.payment.refund.RefundParam;
import cn.bootx.platform.daxpay.param.payment.refund.RefundSyncParam;
import cn.bootx.platform.daxpay.result.DaxResult;
import cn.bootx.platform.daxpay.result.allocation.AllocationResult;
import cn.bootx.platform.daxpay.result.pay.PayResult;

View File

@@ -3,8 +3,8 @@ package cn.bootx.platform.daxpay.gateway.controller;
import cn.bootx.platform.common.core.annotation.CountTime;
import cn.bootx.platform.common.core.annotation.IgnoreAuth;
import cn.bootx.platform.daxpay.code.PaymentApiCode;
import cn.bootx.platform.daxpay.param.pay.QueryPayParam;
import cn.bootx.platform.daxpay.param.pay.QueryRefundParam;
import cn.bootx.platform.daxpay.param.payment.pay.QueryPayParam;
import cn.bootx.platform.daxpay.param.payment.refund.QueryRefundParam;
import cn.bootx.platform.daxpay.result.DaxResult;
import cn.bootx.platform.daxpay.result.order.PayOrderResult;
import cn.bootx.platform.daxpay.result.order.RefundOrderResult;

View File

@@ -133,10 +133,5 @@
<artifactId>lock4j-redis-template-spring-boot-starter</artifactId>
<version>${lock4j.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>

View File

@@ -3,7 +3,6 @@ package cn.bootx.platform.daxpay.service.core.channel.alipay.service;
import cn.bootx.platform.daxpay.code.PayWayEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.channel.AliPayParam;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.code.AliPayCode;
import cn.bootx.platform.daxpay.service.code.AliPayWay;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;

View File

@@ -3,7 +3,6 @@ package cn.bootx.platform.daxpay.service.core.channel.union.service;
import cn.bootx.platform.daxpay.code.PayWayEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.channel.UnionPayParam;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.code.UnionPayCode;
import cn.bootx.platform.daxpay.service.code.UnionPayWay;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;

View File

@@ -6,7 +6,6 @@ import cn.bootx.platform.common.jackson.util.JacksonUtil;
import cn.bootx.platform.common.spring.exception.RetryableException;
import cn.bootx.platform.daxpay.code.PayWayEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.result.pay.SyncResult;
import cn.bootx.platform.daxpay.service.code.WeChatPayCode;
import cn.bootx.platform.daxpay.service.code.WeChatPayWay;

View File

@@ -10,7 +10,7 @@ import cn.bootx.platform.daxpay.code.AllocationDetailResultEnum;
import cn.bootx.platform.daxpay.code.AllocationOrderStatusEnum;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.code.PayOrderAllocationStatusEnum;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.service.core.order.allocation.dao.AllocationOrderDetailManager;
import cn.bootx.platform.daxpay.service.core.order.allocation.dao.AllocationOrderManager;
import cn.bootx.platform.daxpay.service.core.order.allocation.entity.AllocationOrder;

View File

@@ -3,8 +3,7 @@ package cn.bootx.platform.daxpay.service.core.order.pay.builder;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.code.PayOrderAllocationStatusEnum;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.param.pay.PayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.bootx.platform.daxpay.result.pay.PayResult;
import cn.bootx.platform.daxpay.service.common.context.ApiInfoLocal;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;

View File

@@ -4,7 +4,6 @@ import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.common.core.util.ResultConvertUtil;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayChannelOrderManager;

View File

@@ -6,7 +6,7 @@ import cn.bootx.platform.common.core.rest.PageResult;
import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.QueryPayParam;
import cn.bootx.platform.daxpay.param.payment.pay.QueryPayParam;
import cn.bootx.platform.daxpay.result.order.PayChannelOrderResult;
import cn.bootx.platform.daxpay.result.order.PayOrderResult;
import cn.bootx.platform.daxpay.service.core.order.pay.convert.PayOrderConvert;

View File

@@ -7,8 +7,8 @@ import cn.bootx.platform.common.core.rest.param.PageParam;
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
import cn.bootx.platform.common.spring.util.WebServletUtil;
import cn.bootx.platform.daxpay.code.PaymentApiCode;
import cn.bootx.platform.daxpay.param.pay.QueryRefundParam;
import cn.bootx.platform.daxpay.param.pay.RefundParam;
import cn.bootx.platform.daxpay.param.payment.refund.QueryRefundParam;
import cn.bootx.platform.daxpay.param.payment.refund.RefundParam;
import cn.bootx.platform.daxpay.result.order.RefundChannelOrderResult;
import cn.bootx.platform.daxpay.result.order.RefundOrderResult;
import cn.bootx.platform.daxpay.service.core.order.refund.convert.RefundOrderChannelConvert;

View File

@@ -6,10 +6,10 @@ import cn.bootx.platform.daxpay.code.AllocationOrderResultEnum;
import cn.bootx.platform.daxpay.code.AllocationOrderStatusEnum;
import cn.bootx.platform.daxpay.code.PayOrderAllocationStatusEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.AllocationSyncParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationFinishParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationResetParam;
import cn.bootx.platform.daxpay.param.pay.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationSyncParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationFinishParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationResetParam;
import cn.bootx.platform.daxpay.param.payment.allocation.AllocationStartParam;
import cn.bootx.platform.daxpay.result.allocation.AllocationResult;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.order.allocation.dao.AllocationOrderDetailManager;

View File

@@ -5,7 +5,7 @@ import cn.bootx.platform.common.core.function.CollectorsFunction;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException;
import cn.bootx.platform.daxpay.param.pay.PayCloseParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayCloseParam;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayChannelOrderManager;
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayChannelOrder;

View File

@@ -2,7 +2,6 @@ package cn.bootx.platform.daxpay.service.core.payment.pay.factory;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.core.payment.pay.strategy.*;
import cn.bootx.platform.daxpay.service.func.AbsPayStrategy;
import cn.hutool.core.collection.CollectionUtil;

View File

@@ -3,8 +3,7 @@ package cn.bootx.platform.daxpay.service.core.payment.pay.service;
import cn.bootx.platform.common.core.util.LocalDateTimeUtil;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.param.pay.PayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.bootx.platform.daxpay.service.common.context.ApiInfoLocal;
import cn.bootx.platform.daxpay.service.common.context.NoticeLocal;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;

View File

@@ -3,9 +3,7 @@ package cn.bootx.platform.daxpay.service.core.payment.pay.service;
import cn.bootx.platform.common.core.exception.RepetitiveOperationException;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.param.pay.PayParam;
import cn.bootx.platform.daxpay.param.pay.SimplePayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.bootx.platform.daxpay.result.pay.PayResult;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
@@ -20,8 +18,6 @@ import cn.bootx.platform.daxpay.service.core.payment.notice.service.ClientNotice
import cn.bootx.platform.daxpay.service.core.payment.pay.factory.PayStrategyFactory;
import cn.bootx.platform.daxpay.service.func.AbsPayStrategy;
import cn.bootx.platform.daxpay.util.PayUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.baomidou.lock.LockInfo;
@@ -32,7 +28,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@@ -67,21 +62,12 @@ public class PayService {
/**
* 简单下单, 可以视为不支持组合支付下单接口
* 支付下单流程
*/
public PayResult simplePay(SimplePayParam simplePayParam) {
// 组装支付参数
PayParam payParam = new PayParam();
PayChannelParam payChannelParam = new PayChannelParam();
payChannelParam.setChannel(simplePayParam.getChannel());
payChannelParam.setWay(simplePayParam.getPayWay());
payChannelParam.setAmount(simplePayParam.getAmount());
payChannelParam.setChannelParam(simplePayParam.getChannelParam());
BeanUtil.copyProperties(simplePayParam,payParam, CopyOptions.create().ignoreNullValue());
payParam.setPayChannels(Collections.singletonList(payChannelParam));
// 复用支付下单接口
return this.pay(payParam);
}
return null;
}
/**
@@ -204,7 +190,7 @@ public class PayService {
PayLocal payInfo = PaymentContextLocal.get().getPayInfo();
// 获取支付方式,通过工厂生成对应的策略组
List<AbsPayStrategy> strategies = PayStrategyFactory.createAsyncLast(payParam.getPayChannels());
List<AbsPayStrategy> strategies = PayStrategyFactory.createAsyncLast(payParam.getPayChannels());
if (CollectionUtil.isEmpty(strategies)) {
throw new PayUnsupportedMethodException();
}

View File

@@ -4,7 +4,6 @@ import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayAmountAbnormalException;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.channel.AliPayParam;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.channel.alipay.entity.AliPayConfig;

View File

@@ -4,7 +4,6 @@ import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayAmountAbnormalException;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.channel.UnionPayParam;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.channel.union.entity.UnionPayConfig;

View File

@@ -2,7 +2,6 @@ package cn.bootx.platform.daxpay.service.core.payment.pay.strategy;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayAmountAbnormalException;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.service.common.context.PayLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConfig;

View File

@@ -2,7 +2,6 @@ package cn.bootx.platform.daxpay.service.core.payment.refund.factory;
import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException;
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundChannelOrder;
import cn.bootx.platform.daxpay.service.core.payment.refund.strategy.*;
import cn.bootx.platform.daxpay.service.func.AbsRefundStrategy;

View File

@@ -6,8 +6,7 @@ import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
import cn.bootx.platform.daxpay.param.pay.RefundParam;
import cn.bootx.platform.daxpay.param.payment.refund.RefundParam;
import cn.bootx.platform.daxpay.service.common.context.ApiInfoLocal;
import cn.bootx.platform.daxpay.service.common.context.NoticeLocal;
import cn.bootx.platform.daxpay.service.common.context.PlatformLocal;

View File

@@ -9,9 +9,7 @@ import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException;
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
import cn.bootx.platform.daxpay.param.pay.RefundParam;
import cn.bootx.platform.daxpay.param.pay.SimpleRefundParam;
import cn.bootx.platform.daxpay.param.payment.refund.RefundParam;
import cn.bootx.platform.daxpay.result.pay.RefundResult;
import cn.bootx.platform.daxpay.service.common.context.RefundLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;

View File

@@ -6,7 +6,7 @@ import cn.bootx.platform.common.core.util.LocalDateTimeUtil;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.code.PaySyncStatusEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.PaySyncParam;
import cn.bootx.platform.daxpay.param.payment.pay.PaySyncParam;
import cn.bootx.platform.daxpay.result.pay.SyncResult;
import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum;
import cn.bootx.platform.daxpay.service.code.PayRepairWayEnum;

View File

@@ -5,7 +5,7 @@ import cn.bootx.platform.common.core.exception.RepetitiveOperationException;
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.param.payment.refund.RefundSyncParam;
import cn.bootx.platform.daxpay.result.pay.SyncResult;
import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum;
import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum;

View File

@@ -1,8 +1,7 @@
package cn.bootx.platform.daxpay.service.func;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.param.pay.PayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.bootx.platform.daxpay.service.core.order.pay.builder.PayBuilder;
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayChannelOrder;
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;

View File

@@ -3,7 +3,6 @@ package cn.bootx.platform.daxpay.service.func;
import cn.bootx.platform.daxpay.code.PayStatusEnum;
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayChannelOrder;
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundChannelOrder;

View File

@@ -1,6 +1,5 @@
package cn.bootx.platform.daxpay.service.param.order;
import cn.bootx.platform.daxpay.param.pay.RefundChannelParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@@ -1,6 +1,6 @@
package cn.bootx.platform.daxpay.service.task;
import cn.bootx.platform.daxpay.param.pay.PaySyncParam;
import cn.bootx.platform.daxpay.param.payment.pay.PaySyncParam;
import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.payment.pay.dao.PayExpiredTimeRepository;

View File

@@ -2,8 +2,7 @@ package cn.bootx.platform.daxpay.core.util;
import cn.bootx.platform.daxpay.param.channel.AliPayParam;
import cn.bootx.platform.daxpay.param.channel.WeChatPayParam;
import cn.bootx.platform.daxpay.param.pay.PayChannelParam;
import cn.bootx.platform.daxpay.param.pay.PayParam;
import cn.bootx.platform.daxpay.param.payment.pay.PayParam;
import cn.bootx.platform.daxpay.util.PaySignUtil;
import cn.hutool.core.bean.BeanUtil;
import lombok.extern.slf4j.Slf4j;